Capturing the Relationship Between Sentence Triplets for LLM and Human-Generated Texts to Enhance Sentence Embeddings
Paper · 2024 · Na Min An, Sania Waheed and James Thorne
Summary
A sentence can resemble another in wording while describing a different event. A useful sentence embedding, a vector that represents a whole sentence, should make it possible to tell the difference. An and colleagues investigate this problem in training examples that come as triplets. Each triplet contains a reference sentence, a positive sentence that follows from it, and a hard negative that conflicts with it. Earlier training objectives compare the reference with each of the other sentences. Those comparisons can succeed while the positive and the hard negative remain close to each other. This matters when the resulting vectors are used to rank sentence pairs by semantic similarity.
The authors first ask whether automatically written triplets provide the same kind of supervision as triplets written by people. They compare datasets using checks for wording overlap, differences in sentence length, variation in positive-pair scores, and the plausibility of hard negatives. The human-written natural language inference data fare best on the checks, within the set of datasets that each check covers. For instance, the positive pairs in the human data have a normalized score compactness of 0.073, compared with 0.094 for CLAIF. The lower result indicates a wider spread of similarity judgments within the selected positives. Some automatically written negatives also turn ordinary situations into extravagant ones, offering a shortcut for recognizing a contradiction.
The authors then change the training objective. Positive–Negative Augmentation, or PNA, compares the positive sentence directly with hard negatives. It retains the comparisons centered on the reference and allows different reference–positive pairs to receive different training weights. The extra comparison changes the geometry of the learned representations. In a diagnostic on training triplets, adding PNA spreads out the reference–positive similarities and generally lowers the similarities of pairs containing a hard negative. Under CLHAIF without PNA, almost all reference–positive similarities in the corresponding diagnostic sit at 1.0, despite the use of graded feedback during training.
The strongest benchmark results come from RoBERTa-large. Its CLHAIF configuration reaches 82.91 in average Spearman correlation across the semantic textual similarity tasks with PNA, compared with 81.44 without it. SimCSE on the same backbone rises from 78.49 to 81.63. PNA also tends to reduce the similarity of arbitrary Wikipedia sentences, although the setting that ranks benchmark pairs best need not yield the most dispersed vectors. The gains vary with the backbone, the amount of triplet data, and the evaluation task. The results show what an explicit positive–negative comparison can add when triplets are already available.
Deep dive: Capturing the Relationship Between Sentence Triplets for LLM and Human-Generated Texts to Enhance Sentence Embeddings
The paper studies how sentence triplets from people and AI shape sentence embeddings and tests a loss that separates positives from negatives. · about 34 minutes to read
The problem and its context
What a sentence vector is supposed to preserve
A sentence encoder converts text into a vector that can be compared with another sentence vector. The comparison is useful only to the extent that the arrangement of vectors reflects distinctions readers make. A short restatement may preserve almost all of the original information. A broader description can still follow from the same reference while leaving out key details. A contradiction may repeat many of the original words. If all of these sentences land in much the same region, the vector comparison loses distinctions that were present in the text.
The paper approaches this as a problem in natural language understanding and uses semantic textual similarity, abbreviated STS, as its main test. In STS, people judge how much meaning a pair of sentences shares. The encoder supplies its own ordering by scoring pairs of vectors. A system can be useful on this test even if its scores have a different numerical scale from the human judgments. The test asks whether pairs judged more similar by people also tend to rank higher under the encoder.
The authors start from an observation about contextual representations. A token representation can depend on the sentence around the token, giving the encoder information that a fixed representation of the token cannot express by itself. The authors also point to earlier work on the geometry of contextual representations. A vector space can have a preferred direction, so sentences with little connection still receive high cosine similarity. That tendency is called anisotropy. The paper therefore asks both whether sentence vectors order human-judged pairs well and whether supposedly arbitrary pairs occupy an excessively narrow part of the space. Contextualized word representations
Those questions operate at different levels. An STS benchmark presents pairs with meanings selected for comparison. An anisotropy measurement examines the overall distribution of vectors for ordinary corpus sentences. A system could give useful relative scores to the benchmark pairs while still placing many vectors in roughly the same direction. The paper treats the distribution as a property worth inspecting alongside the ranking score.
How earlier work obtained training pairs
Contrastive learning gives a sentence encoder examples of which representations should lie close and which should be separated. The paper describes the first aim as alignment and the second as uniformity. The practical question is how to obtain good examples of closeness and separation. A reference sentence comes with no automatic guarantee that any particular rewrite preserves its meaning, or that any randomly selected sentence provides a useful contrast.
Unsupervised approaches can make a positive pair by processing the same sentence under different dropout patterns. Dropout changes which activations are available in a pass through the encoder, producing different views of the same input. The pair carries a dependable identity of meaning, since its text is the same in both passes. It supplies less direct evidence about which changes to the text preserve meaning. The paper also describes prior approaches using token shuffling, cutting parts of a representation, or changing the prompt template around a sentence. Other work tries to identify challenging negatives within a batch, diversify positive representations by whitening features, or align attention across positive views. SimCSE
Supervised approaches can use distinctions that people have annotated. The paper focuses on natural language inference, or NLI. A reader sees a premise and decides how a second sentence relates to it. An entailment follows from the premise, a contradiction conflicts with it, and a neutral sentence leaves the relationship undecided on the available information. The SNLI and MNLI corpora provide annotated examples of these relationships. The authors describe these corpora as especially useful sources of supervision for sentence embeddings. SNLI, MNLI
Different encoders use those annotations in different ways. Sentence-BERT uses the NLI categories in a classification task and employs network structures that process related sentences together. Supervised SimCSE uses entailments as positives and contradictions as hard negatives. A negative is hard in this setting because the annotation ties it to the same reference as the positive. It can share vocabulary or subject matter with the reference while opposing its meaning. Sentences from other examples in a batch supply additional contrasts without that explicit annotation for the current reference. Sentence-BERT
The NLI annotations give a training system a direction for each comparison. They leave room for different degrees of similarity inside a category. A positive sentence can restate the reference quite closely or express a broader fact that the reference supports. Both count as entailments. Training that puts every positive at the same extreme can lose the variation that an STS evaluator looks for. A three-way inference category and a graded semantic similarity judgment answer different questions about a pair.
Why generated text and graded feedback entered the picture
People take time and effort to write and annotate large numbers of suitable sentences. The authors also situate the work against earlier analysis of annotation artifacts in NLI. A surface cue can become associated with a label because of how examples are written. If the cue is reliable enough, the trained system can lean on it without learning the relationship the dataset was designed to test. The cost of human annotation and the difficulty of eliciting informative examples both motivate experiments with automatic assistance. Annotation artifacts in NLI
The authors describe two roles for large language models in earlier work. They can write sentences by responding to prompts that specify a relation, and they can judge the similarity of sentences already available. DINO exemplifies the generation route. CLAIF uses generated text and automatic similarity labels. CLHAIF is the hybrid case in this paper. It keeps human-written inference texts and uses GPT-3 judgments to provide graded feedback for their positive pairs. The distinction matters because a useful automatic score on an existing pair and a useful automatically written sentence are separate achievements.
The context for the study is a performance gap reported in earlier comparisons. The paper describes systems trained with generated text as frequently competitive with unsupervised alternatives while trailing strong systems trained on human-written NLI. The authors therefore use human supervision as a point of comparison for their generated data. They also question how sharply to draw the boundary. A generator trained on human text, or with human feedback, carries some human supervision into the resulting examples even when people do not write those examples directly. GPT-3, InstructGPT
For the downstream similarity task, the paper uses pretrained sentence encoders that can be further trained on these examples. This separates the role of the generator or grader from the role of the encoder being evaluated. The generator may supply text or labels. The encoder maps sentences to vectors. The researchers can then inspect the encoder's learned geometry and compare its similarity rankings with human judgments. The paper frames fine-tuning as the step that adapts a pretrained representation to this use.
The missing relation inside a triplet
The immediate motivation for PNA is a gap in the contrastive objective. With a reference, a positive, and a negative, the system has a comparison between reference and positive and a comparison between reference and negative. The positive and negative also form a pair in their own right. Neither of the reference-centered comparisons directly assigns a score to that pair.
Consider a triplet about a scene at a pool, one of the kinds of examples the paper uses. A positive can describe the scene more generally. A hard negative can preserve people, water, or the act of jumping while changing a central fact about the event. A reference-centered objective rewards the positive for outranking the contradictory sentence when the reference is the query. The constraint allows different layouts of the three vectors. How high the negative scores against the more general positive depends on where each vector lies, including its direction relative to the other. The paper's geometric examples illustrate that the relative separation of the positive and the negative can vary across layouts that follow the same training directions about the reference.
The question is therefore more specific than whether contrastive learning recognizes negatives. The earlier objectives already expose the reference to a labeled hard negative and to other batch candidates. The authors ask whether training would produce better sentence vectors if the objective also discouraged similarity between the positive and negative. The dataset analysis asks a complementary question about what the examples contain. The training study asks what relationships the objective extracts from them.
The method, step by step
Assemble and examine the sentence data
The work has a dataset study and a training study. The dataset study examines texts and labels already available for training, including examples newly generated for the paper. It applies checks to the collections with the necessary fields. The training study compares existing objectives with versions that include PNA. A heuristic score such as wording repetition is a measurement for the dataset study. PNA does not use that score to weight an individual training sentence.
The reference point for the dataset study is the human-written NLI collection used in supervised contrastive learning. It supplies premises, entailed sentences, and contradictions. To study the spread of graded positive scores, the authors use GPT-3 similarities made available for these human-written pairs. The analysis selects positive pairs with GPT-3 scores higher than 0.5, leaving n =198,479 in the selected NLI set. Human authorship here describes the sentences. The compactness measurement concerns automatic judgments on those sentences.
DINO provides pairs of sentences generated with GPT2-XL and organized by levels of similarity. The descriptions attached to its levels are completely different at 0, somewhat similar at 0.5, and the same at 1. For the positive-pair analysis, the authors choose the group with similarity near 1 and report n =20,013. That selection follows DINO's own categories. It differs from selecting examples by a continuously graded judgment.
CLAIF provides sentence pairs obtained by having GPT-3 complete masked text. GPT-3 also assigns similarity scores on a scale from 0 to 1. The authors select pairs above 0.5 as positives and report n = 53,041. Those pairs share the threshold used for the graded NLI comparison. Their generation process still differs from NLI's. Different references, different ways of writing the paired sentence, and different criteria for keeping a pair can all affect a dataset comparison.
For the new DINO GPT-3.5 condition, the authors sample 100k NLI references for generation and fine-tuning. GPT-3.5-turbo receives separate requests for a sentence that would be true of the reference situation and one that would be false of it. The requests draw on the directions originally used for human MNLI annotators. Generation uses a temperature of 1.0. The shared premise source lets the authors compare what people and the generator do when asked to produce the same kinds of relations. It also gives the new DINO condition a training format compatible with supervised SimCSE.
The dataset-analysis description separately reports n =198,479 for a DINO GPT-3.5 selection made using the same indices as the selected NLI examples. It describes that condition as lacking corresponding graded similarity scores. The paper also describes the 100k sampling operation when explaining generation and fine-tuning. It does not give a mapping between these reported counts, so each belongs to the procedure in which the authors state it.
Measure wording, scores, length, and plausibility
The repetition check asks how much of a positive was carried over from the reference. The authors identify the subject with spaCy and exclude it from the comparison. Reusing the subject may be necessary simply to talk about the same participant. The remaining overlap is measured with BLEU-1, using single-token matches. If a generator often keeps the wording outside the subject, its positives offer less evidence about how the same meaning can be expressed in different language. Low overlap by itself says nothing about whether the positive follows from the reference. The inference relation comes from how the examples were obtained. BLEU score
Positive score compactness asks how much the graded similarity values vary among reference–positive pairs. The authors use the reciprocal of the variance. A broad spread gives a lower compactness value, while scores bunched around a narrow range give a higher one. The paper illustrates the motivation with values of 0.9 and 0.7. Both can describe positives, yet the score distinguishes a closer match from a looser one. This measure requires graded pair scores. A dataset with positive labels alone cannot support the same calculation, and the measurement concerns variation among examples classified as positive.
The length difference penalty tracks how far a positive's length departs from that of its reference. A lower value indicates that the lengths tend to match more closely. The check measures a different property from wording overlap. A positive can be approximately as long as the reference and still be expressed differently. A pair can also overlap substantially when its longer member retains familiar wording and adds more material. The paper describes the direction of the penalty without specifying a full algebraic form for it.
The implausibility check concerns the hard negative by itself. GPT-3.5-turbo is asked whether the described event could plausibly happen. The prompt offers yes, no, and an uncertainty response and requests a supporting reference for a yes. It uses a temperature of 0.0 and treats recognized option identifiers as valid answers. The implausibility score is the share of valid outputs counted as negative answers to that question. The training label says that the negative conflicts with its reference. The diagnostic asks whether the negative describes an unlikely event even when its reference is out of view.
The distinction is easiest to see with the supplied examples. One generated negative puts swimmers in chocolate syrup, and another adds chainsaw juggling to a dirt-bike scene. Each introduces a cue that can be detected from the negative sentence alone. The human alternatives in the appendix more frequently describe events that could occur but differ from the premise. The authors use the plausibility check to investigate that possible shortcut. They normalize the heuristic scores for their cross-dataset presentation and compare datasets within the fields they have. The plausibility measure requires hard negatives, just as compactness requires graded scores.
Turn the triplet into vector comparisons
For PNA training, the encoder receives a batch of sentence triplets. It processes every reference and both of its companion sentences. The experiments use BERT-base, RoBERTa-base, and RoBERTa-large as the backbones. For the reproduced comparisons, the researchers use average pooling. They take the token vectors from the last layer and average them to get a single vector per sentence. This common choice matters because an encoder can otherwise be evaluated through a designated classification token or a different readout, changing the comparison along with the loss. BERT, RoBERTa
Training an encoder with Positive–Negative Augmentation
The steps in order.
The ordinary reference-centered part begins with the reference and its own positive. That pair has the highest target weight. The reference also competes against the other positives in the batch and against all the negatives. A positive belonging to a different example is considered an implicit negative for the current reference. It may be a perfectly good entailment of its own premise. The sampling assumption is that it should receive less weight than the positive chosen for the current premise.
PNA adds comparisons from the current positive to the batch's negative sentences. This includes its own hard negative and negatives attached to the other references. A high score for a positive–negative pair now competes with the reference's intended match in the same normalization. The added competition can penalize a positive and a hard negative for ending up close even when the relative ordering of the reference-centered comparisons is correct. The batch both supplies examples and defines which competing comparisons are available to the loss.
The quantities compared are cosine similarities. Cosine similarity concerns the direction of each vector, and increases as the vectors point more nearly the same way. Before normalization, the cosine is divided by a temperature and exponentiated. A small temperature makes differences in cosine have a stronger effect on the share of probability assigned to each comparison. The paper fixes the loss temperature at 0.05. This parameter controls how the scores compete in training and is separate from the temperatures used to generate or judge sentences.
How the objective assigns weight
The training target is graded in the PNA formulation. The positive weight comes from a similarity score associated with the reference and its positive. Where CLHAIF supplies GPT-3 scores, the authors use those scores. For the SimCSE-based variant the paper describes drawing scores from a uniform distribution from 0 to 1. A draw in that regime supplies a training weight without claiming that a person judged that pair to have the resulting degree of similarity. The different scores serve the same mathematical role but carry different information about the sentences.
yᵢ⁺ = SimScore(xᵢ, xᵢ⁺)
Here i identifies the current example, xᵢ is its reference text, and xᵢ⁺ is its positive text. SimScore supplies the scalar weight for that pair under the training variant being used. The result yᵢ⁺ is the target weight assigned to the intended reference–positive comparison. The superscript ⁺ marks the positive, and the equals sign defines the weight.
yᵢ⁻ = (1 − yᵢ⁺) / (3N − 1)
Here yᵢ⁻ is the weight assigned to each competing comparison for example i. The numerator is the share of the unit target mass left after yᵢ⁺ has been assigned to the intended match. N denotes the number of triplets in the batch and therefore the number of available positives and of available negatives. The denominator 3N − 1 counts the competitors across the groups of comparisons, excluding the intended match. The parentheses group the share left over, and the slash divides that share evenly among the competitors. The superscript ⁻ denotes the weight for those alternatives, including comparisons that use another example's positive.
This allocation is a form of label smoothing. A target that used a one-hot label would put all of its weight on the intended match. The smoothed version reserves weight for the alternatives. A higher score for the intended match leaves less weight to distribute. A lower score leaves more. Accordingly, the comparison set and the supplied positive score jointly determine what distribution the encoder is encouraged to fit. The loss still draws a distinction between the positive and its competitors through both the choice of comparison and the amount of weight assigned.
How the comparison scores combine
S = ∑ⱼ₌₁ᴺ [exp(cos(hᵢ, hⱼ⁺) / τ) + exp(cos(hᵢ, hⱼ⁻) / τ) + exp(cos(hᵢ⁺, hⱼ⁻) / τ)]
S denotes the normalizing sum for the current example i. The index j runs from 1 through N and identifies candidates in the batch. The reference encoding is hᵢ and the current positive encoding is hᵢ⁺. The vectors hⱼ⁺ and hⱼ⁻ encode the positive and hard negative of candidate example j. In each term, cos measures the cosine similarity of the two vector arguments, τ is the temperature fixed at 0.05, and exp is the exponential function. The square brackets group the terms contributed by each j. The plus signs between terms add their exponentiated scores. The superscript signs on encodings identify sentence roles.
The first term includes the intended reference–positive match when j equals i. It includes other examples' positives at the remaining indices. The second term covers reference–negative comparisons. The third gives PNA its additional source of evidence. It scores the current positive against each negative candidate. All of these terms enter the same sum. For any individual comparison, its exponentiated score divided by S is its share of the distribution, relative to every comparison contributing to S.
Lᵢ = yᵢ⁺ log[exp(cos(hᵢ, hᵢ⁺) / τ) / S]
+ yᵢ⁻ {∑ⱼ₌₁,ⱼ≠ᵢᴺ log[exp(cos(hᵢ, hⱼ⁺) / τ) / S]
+ ∑ⱼ₌₁ᴺ (log[exp(cos(hᵢ, hⱼ⁻) / τ) / S]
+ log[exp(cos(hᵢ⁺, hⱼ⁻) / τ) / S])}
Lᵢ is the paper's weighted log-probability expression for sample i. The function log takes the logarithm of a comparison's share of S. The first line multiplies the intended match's log probability by yᵢ⁺. The braces collect the competitors that receive weight yᵢ⁻. The condition j ≠ i in the first sum omits the already counted match. The final sum spans all N negative candidates, contributing both a reference–negative term and a positive–negative term for each j. The parentheses inside that sum group those contributions. The encodings, cosine, exponential, and temperature have the same meanings as in the normalization. As written, larger weighted log probability corresponds to a better fit. The quantity to minimize under the usual loss convention is its negative.
The effect of adding a term goes beyond asking for one extra score after the others have been trained. The score changes both the competitor list and the denominator used to compute the intended match's probability. If the positive points in much the same direction as a hard negative, that comparison receives a large share relative to its target weight and competes for probability mass with the match. Training can improve the fit by changing the representation of the positive, the negative, or both. The encoder's parameters are shared, so those changes also affect other comparisons in which the representations participate.
The formulation is applicable wherever the training data supply triplets of the required form. No triplet is required to encode an individual sentence once training is complete. The training relations influence the parameters that produce the vector. Afterwards, a sentence is encoded and pooled on its own, and its vector can be compared with another sentence's vector.
Keep the training comparisons interpretable
The paper compares supervised SimCSE, hybrid CLHAIF, and the generated-companion DINO GPT-3.5 setting with versions using PNA. It also investigates SimCLHAIF, which begins with an encoder already trained as supervised SimCSE and continues with the CLHAIF procedure. Its starting point matters whenever the paper varies the amount of data used during the subsequent training stage. It already incorporates supervision even at the start of that experiment.
According to the implementation description, the RoBERTa SimCSE reproduction runs used 276,501 NLI examples and a learning rate of 5e-5, with training lasting three epochs and batches of 128 examples per GPU. Validation uses STS-B Spearman correlation every 125 training steps. The authors specify the same training implementation for the reproduced RoBERTa CLHAIF variants, using the GPT-3 similarity scores and the smooth-all option. Some comparisons instead use published scores or evaluate available checkpoints under average pooling. The controlled comparisons of the loss are most direct where the paper pairs a reproduced baseline with its PNA variant.
A separate intervention drops a likely false negative. The authors identify the highest-cosine candidate among the negatives for a reference and remove it. That candidate can be the reference's own hard negative or another example's positive or negative. The approach uses similarity as an indication that the competition might be misleading. A highly similar candidate can also be a useful challenge, so the ranking rule is a proxy. This intervention changes which example stays in the negative set. PNA changes which relationships are scored. The paper compares the interventions to see how they affect the same evaluation measures. The authors make the implementation available in the eacl2024-pna code repository.
Experiments and results
What the evaluation measures
The main benchmark is a collection of STS tasks covering STS 2012-2016, STS-Benchmark, and SICK-Relatedness. Each task supplies human judgments about sentence pairs. The system compares the vectors of each pair and ranks the pairs by their scores. Spearman correlation measures the agreement of that ordering with the ordering from human judgments. The paper reports scores by task and an average across tasks. STS-B also serves as the validation task in the training setup, so its training-time role and its place among the reported evaluations both matter when interpreting the results. Semantic Textual Similarity and STS-Benchmark
The second evaluation examines anisotropy on Wikipedia. The authors describe a sampling procedure involving 100k sentence pairs and use cosine similarity between the resulting embeddings to quantify how concentrated arbitrary sentences are in the vector space. Lower similarity is preferable for this diagnostic because unrelated sentences should have room to occupy different directions. The Wikipedia measurement gives no human similarity rank for the individual pairs and serves a different purpose from STS. The study also analyzes cosine distributions within training triplets, where the positives and negatives have assigned roles.
The comparisons include static token embeddings, pretrained encoders used without triplet training, human supervision, automatic supervision, and the hybrid setting. The static condition averages input token representations. The pretrained-only condition uses contextual vectors from the last layer. The supervised comparisons include SBERT or SRoBERTa, depending on the backbone, alongside SimCSE. The generated supervision comparisons include DINO variants and CLAIF. CLHAIF uses NLI sentences written by people and similarity scores from GPT-3. The authors exclude the enlarged CLAIF variant because it was designed to use a larger training set than the other comparisons.
These settings allow several kinds of comparison. An off-the-shelf representation can be compared with a trained one to ask how much the downstream task depends on adaptation. Within a backbone, trainable objectives can be compared with and without PNA. Across different training sources, the scores reveal which configurations perform well in the tested setup. The source comparison is broader than the change of loss because the generated and human-written conditions can also differ in construction and labeling.
The data produced different kinds of supervision
The human-written NLI data score lowest on the four reported heuristics when compared with the applicable generated-data results. The lower repetition score indicates that these NLI positives overlap less with their references under the subject-excluded token check. This provides a specific account of one kind of diversity. The pairs put more pressure on the encoder to recognize a relation across wording changes. Repetition penalizes one surface behavior, so the result identifies that behavior without judging all aspects of the sentences.
For score compactness, the normalized result is 0.073 for NLI and 0.094 for CLAIF in the selected positive pairs used for the heuristic comparison. The NLI value indicates a wider distribution of graded scores under the paper's measure. Since both selections use scores above 0.5, this comparison concerns variation within the chosen positive region. It says little by itself about the range of scores for neutrals or contradicting pairs. The scores also come from GPT-3 rather than an independent human assessment of the amount of variation.
The length comparison shows a different pattern. CLAIF has positives that differ more in length from their references. The human NLI data and the DINO GPT-3.5 condition tend to have more closely matched lengths. That means the generated condition can resemble the human data on one dimension while differing on another. In the plausibility comparison, DINO GPT-3.5 receives more judgments of implausibility for its negatives than the human NLI set. This fits the examples in which the generator changes a realistic premise by adding something remarkable.
The plausibility and repetition results suggest potential shortcuts in opposite parts of the triplet. A positive that reuses the premise gives lexical overlap a strong correlation with the desired label. A negative with implausible content gives unusual events a correlation with the other label. An encoder trained with either shortcut may find the training problem easy while the representations retain less of the distinction needed for ordinary sentence comparison. The paper uses the heuristic findings to motivate this explanation. It does not measure how much of the downstream gap each shortcut accounts for.
The largest backbone gains most consistently on STS
The strongest STS average in the main comparison is CLHAIF with PNA on RoBERTa-large. Its score of 82.91 exceeds the corresponding CLHAIF baseline of 81.44. On that backbone, SimCSE with PNA reaches 81.63, compared with 78.49 for SimCSE. The authors report these average improvements as 1.47% for CLHAIF and 3.14% for SimCSE. The chart uses the benchmark scores themselves, keeping the metric fixed across systems.
RoBERTa-large systems on average STS Spearman correlation
CLHAIF with PNA leads the comparison, and both paired baselines gain from PNA.
The numbers
| System or setting | Spearman correlation, reported scale |
|---|---|
| SRoBERTa | 76.68 |
| DINO GPT-3.5 | 77.97 |
| CLAIF | 81.49 |
| SimCSE | 78.49 |
| SimCSE + PNA | 81.63 |
| CLHAIF | 81.44 |
| CLHAIF + PNA (this paper) | 82.91 |
The task scores show why an average is useful and why it needs to be read alongside its components. With RoBERTa-large, CLHAIF rises from 84.43 to 87.08 on STS13 and from 73.67 to 77.20 on SICK-R when PNA is applied. It drops from 77.81 to 77.13 on STS12. In the SimCSE comparison, STS14 rises from 77.10 to 81.62. STS12 moves from 77.45 to 76.07. These observations place the overall gain in context. The altered training objective affects the rankings of different evaluation sets in different ways.
The other backbones produce a more mixed picture. With BERT-base, SimCSE moves from 80.52 to 80.48 on average, while CLHAIF moves from 81.01 to 81.21 in the detailed STS comparison. With RoBERTa-base, SimCSE moves from 78.63 to 79.01 and CLHAIF moves from 81.01 to 80.71. The gains are therefore concentrated in particular combinations of backbone and starting objective. The overview table separately gives 81.01 for BERT-base CLHAIF with PNA, whereas the detailed comparison gives 81.21 for that row. The paired BERT-base comparison here follows the detailed STS table.
The newer DINO configuration also puts the supervision comparison in perspective. With BERT-base, DINO GPT-3.5 obtains an average of 76.66, compared with 76.26 for DINO GPT-3. Its RoBERTa-base average is 77.44, compared with 77.15 for DINO GPT-3. In both backbone comparisons, supervised SimCSE is higher, at 80.52 and 78.63, respectively. A newer generator improves this pair of DINO results while leaving a gap to supervised SimCSE. Other generated-data rows differ. For instance, the RoBERTa-large CLAIF result of 81.49 is competitive in the chart. The comparison depends on the system, training source, and backbone together.
Adaptation changes both rankings and vector geometry
The pretrained-only baselines show that taking the last layer and averaging its tokens does not guarantee a better similarity ranking than averaging static input embeddings. In the overview, BERT-base goes from 56.02 for static representations to 52.58 for the pretrained last layer on average STS Spearman correlation. RoBERTa-base moves from 55.88 to 53.49, and RoBERTa-large from 55.47 to 52.80. With triplet fine-tuning, the scores are substantially higher. Because those comparisons add the training stage as a whole, they measure more than the contribution of PNA alone.
The Wikipedia result for RoBERTa-large illustrates a corresponding change in the spread of the representations. Its pretrained-only last layer yields anisotropy of 0.9911. In the overview, the trained SimCSE and CLHAIF variants with PNA yield 0.4051 and 0.3959, respectively. The introduction also reports a -7% change in Wikipedia anisotropy against CLHAIF for its highlighted RoBERTa-large result. The overview chart below compares the trained variants with static and pretrained-only readouts. The comparison between PNA and a matched triplet-trained baseline is addressed separately in the intervention study.
RoBERTa-large settings on Wikipedia sentence anisotropy
The triplet-trained settings give arbitrary sentence pairs lower similarity than either readout without triplet training.
The numbers
| System or setting | cosine similarity |
|---|---|
| Static token embeddings | 0.9100 |
| Pre-trained-only last-layer embeddings | 0.9911 |
| SimCSE + PNA | 0.4051 |
| CLHAIF + PNA (this paper) | 0.3959 |
The change depends in part on where the backbone starts. RoBERTa-base has a static anisotropy of 0.5693, lower than its pretrained-only last-layer value of 0.9554. Its triplet-trained values in the overview, 0.7911 for SimCSE with PNA and 0.7964 for CLHAIF with PNA, lie between the static and pretrained-only readings. Accordingly, training can increase STS performance while yielding more concentrated vectors than a static readout of the same backbone. The direction of the anisotropy result depends on the chosen baseline.
Transfer results vary by task and training setup
The appendix applies the encoders to transfer tasks outside the main STS collection. These include sentiment, subjectivity, question categorization, and paraphrase evaluation. The paper reports them together in a table labeled Spearman correlation. The results give a broader comparison of the tested variants and show that the improvements on STS cannot be carried over as a uniform expectation.
With RoBERTa-large, the reported transfer average for SimCSE goes from 89.03 to 87.97 after adding PNA. The CLHAIF comparison goes from 89.53 to 89.06. Individual tasks can move in different directions within the same configuration. For RoBERTa-large CLHAIF, the reported TREC value falls from 93.20 to 91.40, while MRPC goes from 75.59 to 75.88. These task-level results help establish the scope of the main finding. Improving the orientation of vectors for similarity ranking and improving all uses of those vectors are separate empirical questions.
What the ablations show
Adding the extra comparison changes the training geometry
The central controlled comparison retains a training setup and adds PNA. Its STS results show where the change improves aggregate rankings. The authors also inspect what happens to the representations of the training NLI triplets. They separate the cosine distributions for reference–positive, reference–negative, and positive–negative comparisons so a change in one pair type cannot be hidden in an aggregate.
For BERT-base CLHAIF, the reference–positive score distribution is concentrated near 1.0 without PNA. That is striking because the baseline uses the smooth-all setting and already receives graded GPT-3 scores. A set of graded training labels gives the encoder variation it could learn. This diagnostic shows that the baseline's raw cosines for those positives preserve little of that variation at the top of the scale. With PNA added, the reference–positive scores span a wider range, and the distributions for both kinds of pairs containing a negative shift toward lower similarity.
That comparison narrows the interpretation. The shift cannot be attributed simply to giving CLHAIF a graded label for the first time. The baseline already has those labels. With the positive–negative comparison present, bringing a reference and its positive very close still affects the score of other comparisons sharing those vectors. The training signal now gives the encoder a reason to distribute the positives and negatives differently around the reference. The comparison demonstrates the change in the resulting distributions without tracing which individual parameter changes account for it.
The appendix repeats the diagnostic for RoBERTa-base SimCSE. With PNA, its reference–positive cosines also become less concentrated at the upper end. The two pair types involving a negative show slightly lower cosine scores. The repeat is informative because the supervision differs from CLHAIF. The same directional change in the triplet distributions appears with the SimCSE variant, without relying on the GPT-3 feedback used for CLHAIF.
The paper's explanation for the near-ceiling similarities is a hypothesis about how contrastive training allocates its effort. The number of competing relationships across examples can make separation among examples a dominant part of the task. At the same time, the aim of identifying the correct positive can encourage placing it extremely close to its reference. The observed histograms are consistent with this explanation. They do not track the relative contributions of within-triplet and across-triplet gradients during training, so the mechanism remains an interpretation of the observed geometry.
A broader positive histogram is itself a useful diagnostic only at a particular level. It shows that the positive cosines are no longer almost identical. To establish that the newly differentiated values represent meaningful degrees of closeness, one also needs evidence about how pairs are ordered. The STS evaluations supply that evidence on benchmark data. Conversely, a higher STS average does not show exactly how the new objective shaped training triplets. The results support the embedding change from these complementary observations.
Dropping the closest negative answers a different question
The false-negative experiment compares strategies for dealing with hard or potentially misleading competitors. A negative from another triplet can resemble the current reference in meaning. Treating it as dissimilar merely because it appeared in a different example supplies a noisy learning signal. The removal strategy takes the negative with the highest cosine relative to the reference as the candidate most likely to cause this problem and drops it.
Using RoBERTa-large, the paper reports that this removal improves average STS correlation for DINO GPT-3.5, SimCSE, and CLHAIF. The authors compare these runs with the versions using PNA and also include the SimCLHAIF setting. In their comparison figure, PNA produces the more consistent STS improvement across the systems tested. The error bars describe variation summarized as standard error across the STS tasks. They reflect the range of task outcomes in this comparison.
The two techniques alter different parts of training. Negative removal reduces the influence of an unusually close competitor. PNA extends the competition to pairs involving the positive as well as pairs involving the reference. These strategies can therefore change what the encoder learns even when they start with the same minibatch. The experiment shows that the gains from expanding the comparisons cannot be inferred from the gains of throwing away the most similar negative.
For anisotropy, the RoBERTa-large intervention figure shows that the similarity of arbitrary sentence pairs decreases with PNA for three out of four settings relative to their baselines. The paper observes a tradeoff between the STS and anisotropy outcomes in much of this comparison. The highest benchmark correlation and the lowest average Wikipedia cosine can belong to different variants. The loss influences both properties, but an improvement on one indicator does not specify the expected shift on the other.
The gains depend on the amount of fine-tuning data
The data-size experiment varies the amount of NLI fine-tuning data from 0, which corresponds to the pretrained-only starting point in the overview, to a full-data endpoint reported in this experiment as n =275,601. This endpoint is stated differently from the 276,501 examples listed in the implementation recipe. The experiment is informative about the training range described for its curves, while the two sample counts remain distinct reports in the paper.
For RoBERTa-large, CLHAIF with PNA performs poorly compared with the other settings when its fine-tuning set is below 10k. From 10k onward, the paper places it behind only SimCLHAIF with PNA in average STS performance. This is a concrete qualification to the apparent benefit of the extra comparison. Its best results occur in a regime where it sees enough diverse triplets to make the added training signal useful. The experiment establishes a change in the observed ranking around the tested data sizes. It does not determine a general minimum amount of data for PNA.
SimCLHAIF with PNA starts from a different point because its encoder was already fine-tuned on the full NLI data as SimCSE. Its high STS values early in the subsequent training comparison therefore incorporate previous supervision. It answers a question about further training of a supervised encoder. CLHAIF and the other configurations starting from pretraining alone answer a question about acquiring the task-specific representation from the data available in that run. The distinction matters most when the horizontal axis indicates little or no additional data.
The Wikipedia anisotropy curves settle later for PNA variants than the authors report for their STS rankings. The cosine curves also appear noisier. A configuration can reach a strong average ranking on the benchmark before its arbitrary sentence vectors settle into a comparable distribution across the evaluated sizes. SimCLHAIF with PNA provides the upper STS curve without attaining the lowest anisotropy in the part of the experiment above 10k. This supports treating convergence on the similarity tasks and convergence of the corpus geometry as separate observations.
Taken together, the comparisons give a narrower answer than the aggregate headline alone. The direct positive–negative relation is associated with a change in how triplets are embedded, the benefit comes through most clearly with RoBERTa-large, and the expected outcome depends on data size and the criterion used to judge it. The dataset heuristics explain why the authors investigated triplet construction in the first place. The with-and-without-PNA comparisons supply the evidence for changing the objective.
Limitations
Limits identified by the authors
PNA requires a training example with an explicit positive and negative. The authors say that approaches that construct only positive views during training may be unable to use it directly. For example, applying dropout to the same sentence can provide the two encodings needed for a positive-pair objective. It leaves the triplet relation proposed in this paper undefined unless another sentence is assigned the role of hard negative. How that role is filled becomes part of the supervision.
The authors also limit their empirical claims primarily to STS. The Wikipedia result characterizes geometry on that corpus, and the transfer experiments offer a broader check with mixed results. There is no corresponding demonstration that all purposes for which sentence vectors are used benefit from the same objective. In particular, the transfer results show instances where triplet geometry and better STS rankings do not translate into higher task scores.
The paper leaves open how to classify automatically supplied supervision. A generated sentence written in response to a prompt has a different provenance from a human-written annotation. The generator still draws on prior human text and, in some cases, human feedback. The authors consider it reasonable to compare against human-supervised systems and acknowledge that the fairness of such comparisons remains open. This caveat applies especially when terms such as unsupervised and generated are used to imply that no human contribution underlies the examples.
The authors also recognize that the generation procedure may produce harmful content. Their expectation of limited harm rests on using reference sentences from the NLI collections and on the topics of the relevant sentence and contradiction. The statement gives the rationale for their expectation. The paper offers no separate measurement of the frequency or content of harmful generations.
Limits visible in the comparisons
The checks characterize the datasets used in this study. They cannot establish that differences between human and generated triplets are inherent to their sources. The collections vary in how they obtain a reference, generate or elicit a related sentence, select positives, and assign scores. DINO GPT-3.5 starts from human NLI premises, CLAIF uses masked completion, and DINO organizes pairs into levels of similarity. A change in the resulting distribution can reflect any of these procedural choices. The evidence identifies properties of particular collections and generators under the paper's settings.
The measures themselves answer limited questions. BLEU-1 overlap after removing the subject measures shared tokens, with the role of the subject dependent on the tool used to identify it. It does not identify every shortcut in a sentence or decide whether a rewritten positive preserves meaning. Length similarity describes a textual property that can coexist with either repetition or variety. Compactness summarizes dispersion of scores assigned to selected positives. A broad spread can be desirable for graded learning, yet the dispersion alone gives no test of whether each score matches human judgment.
The implausibility result depends on automated judgments of likelihood. The detector and the generator for the new DINO condition use GPT-3.5-turbo in different roles. The appendix shows a plausibility prompt with an uncertainty option, even though the method also describes the desired judgment in binary terms. The reported score counts negative answers among valid responses. It is best read as the behavior of that prompt and scoring procedure on the available negatives. The vivid appendix examples make the phenomenon recognizable, but the examples themselves do not establish how prevalent or damaging it is.
The downstream comparisons do not isolate the effect of improving any one heuristic. A direct test of the implausibility account would need to vary plausibility while keeping other relevant aspects of the negatives comparable. The study evaluates the available collections and then varies the training objective. This supports a claim about the observed dataset differences and a separate claim about the utility of PNA on several training configurations. It gives less direct support to a causal claim about why a particular generated-data system ranks below a human-supervised one.
The triplet histograms examine examples from the training NLI collection. They demonstrate how the learned encodings behave on that distribution. They do not directly measure how accurately the positive cosines reflect graded judgments on unseen triplets, or how frequently separating positives from negatives would be counterproductive on unusually ambiguous examples. The STS rankings offer evaluation beyond that diagnostic, but their human judgments concern pairs, not the complete set of relationships within a triplet.
Similarly, lower average cosine on sampled Wikipedia text captures a particular property of the representation space. An arbitrary pair from a corpus is a proxy for sentences that need room to be represented separately. This measure does not establish that all useful neighborhoods in the space have been preserved. The tradeoff seen in the experiments limits any claim that minimizing anisotropy alone would select the strongest semantic similarity system.
Finally, the main comparisons establish a pattern across benchmark tasks and tested backbones. The standard errors in the intervention and size figures summarize variation across tasks, rather than uncertainty across independent training runs. The strongest evidence is the agreement among several observations in particular setups, including the RoBERTa-large improvements, the training-triplet distributions, and the Wikipedia measurements. The weaker and reversed results with smaller backbones and on transfer tasks set the bounds of that pattern.
What came after
Diffusion Models Through a Global Lens: Are They Culturally Inclusive? cites the sentence-triplet paper. The later work's title places its inquiry in the cultural inclusivity of diffusion systems. The citation establishes a connection between the papers, but the available account of the later work does not identify how it uses sentence triplets, PNA, or the analysis of generated training text. It therefore documents a later citation without establishing a particular extension of the method or a replication of its results.
Cite
Cite as Na Min An, Sania Waheed and James Thorne. 2024. Capturing the Relationship Between Sentence Triplets for LLM and Human-Generated Texts to Enhance Sentence Embeddings. Findings of the Association for Computational Linguistics: EACL 2024.
@inproceedings{an2024capturing,
title = {{Capturing the Relationship Between Sentence Triplets for LLM and Human-Generated Texts to Enhance Sentence Embeddings}},
author = {Na Min An, Sania Waheed and James Thorne},
booktitle = {Findings of the Association for Computational Linguistics: EACL 2024},
year = {2024},
doi = {10.18653/v1/2024.findings-eacl.43},
url = {https://doi.org/10.18653/v1/2024.findings-eacl.43}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/an-2024-capturing-relationship-between-sentence-triplets/