Elamur Research

Always Keep your Target in Mind: Studying Semantics and Improving Performance of Neural Lexical Substitution

Paper · 2020 · Nikolay Arefyev, Boris Sheludko, Alexander Podolskiy et al.

Summary

A word can fit a sentence without preserving what the sentence says. In the paper’s example, someone buys a new car. Both automobile and bike can occupy the same position, but only automobile preserves the kind of purchase with much precision. Lexical substitution asks which words can replace a particular word in a particular sentence. The answer depends on what the substitutes are for. A paraphrase may call for a close equivalent, while a system that groups uses of an ambiguous word can benefit from a wider set of clues. The authors ask how to retain the original word as evidence while still letting the sentence determine which use of that word matters.

They compare context2vec, ELMo, BERT, RoBERTa and XLNet using their pretrained weights. A straightforward way to generate suggestions is to hide the target and ask what fits in the gap. The authors also try leaving the target visible, placing it beside the gap in a short coordination pattern, and putting an intact copy of the sentence next to the version with the gap. Their strongest approach, called +embs, combines two rankings using scores from each. One reflects what fits the surrounding sentence. The other reflects how close each candidate is to the original target in the system’s vocabulary representations. A setting called temperature controls how strongly that second source of evidence favors the closest candidates.

On the SemEval 2007 English Lexical Substitution Task, XLNet with +embs reached 49.48 for precision at the first prediction in the authors’ shared evaluation setup, compared with 31.70 for XLNet with the target already visible. On CoInCo, the corresponding scores were 51.48 and 38.16. The method surpassed several earlier baselines, while a previously published BERT system with an additional sentence-level validation step reported stronger scores where comparable results were available. In a separate experiment, the authors used substitutes to group occurrences of ambiguous words by sense. XLNet with +embs achieved the highest reported average scores in their comparison on both benchmarks, with leads within the earlier system’s reported standard deviations.

An analysis using WordNet helps explain what changed. For nouns and verbs, adding similarity to the target tended to favor synonyms and close relations of broader or narrower meaning. The same preference could also work against the sentence. In a question about a garbage can, XLNet’s contextual predictions included bin and container, while the combined method moved candidates associated with the modal verb can towards the top. The paper shows why the original word belongs in the decision and why its contribution needs to be calibrated.

Deep dive: Always Keep your Target in Mind: Studying Semantics and Improving Performance of Neural Lexical Substitution

Arefyev and colleagues show how combining sentence context with target-word similarity improves lexical substitution and word sense induction. · about 38 minutes to read

The problem and its context

A plausible completion can change the meaning

Lexical substitution begins with a sentence and a designated word occurrence. The system has to suggest replacements for that occurrence. The emphasis on an occurrence matters. A dictionary entry may cover several uses of a word, but the substitution is judged in the sentence where someone actually used it. The same spelling can therefore call for different substitutes across different examples. Conversely, two candidates that are quite different in meaning can both sound natural in a particular sentence. Successful substitution depends on the interaction between those facts.

Consider the purchase example. The surrounding sentence gives useful clues about what could occur after the description of something new. It admits many things a person might buy. If the only question were whether the completed sentence sounded natural, a bicycle could be a reasonable proposal. Once the original word is considered, automobile becomes a stronger choice for someone who wants to preserve meaning. A more general description such as motor vehicle relates to the original word in yet another way. It retains the broader category but loses some specificity. These alternatives explain why the authors treat the kind of semantic relation as a property worth measuring in its own right. This is a question about lexical semantics.

A separate difficulty arises when the target is ambiguous. A system can keep the original spelling and still favor candidates associated with the wrong use. In the paper’s sense-induction examples, bank can refer to a place beside water or to a financial institution. The spelling supplies a starting point for both. The surrounding words supply evidence for choosing between them. A representation that associates bank strongly with financial vocabulary could make an unhelpful contribution in a sentence about unloading a boat. A system needs a way to combine the strength of that general association with evidence from the particular sentence.

The authors describe lexical substitution as a component that can serve several tasks. For paraphrasing, the alternative wording may need to preserve as much of the original meaning as possible. Extracting lexical relationships can benefit from seeing broader terms or related categories because those relations are themselves of interest. In word sense induction, the goal is to discover groups of uses with similar meanings, so the collective pattern of proposed replacements can matter more than whether the first proposal is suitable for rewriting the sentence. The criterion for a useful substitute follows from the application.

Word sense induction is especially informative in this study because it changes the object of evaluation. A lexical substitution benchmark asks whether a proposal matches what people supplied for a particular word occurrence. A sense induction benchmark asks whether the evidence derived from one occurrence helps place it with other uses of the same sense. A word can contribute to that grouping without being an ideal edit. The paper uses the two tasks to examine whether the same intervention helps both direct prediction and a procedure that consumes an entire list of predictions.

What earlier approaches could use as evidence

One line of earlier work represented each word by a vector learned from its patterns of occurrence. Words that appear in similar environments can end up with similar representations. Those environments can be defined by nearby words or by grammatical relationships. For lexical substitution, such a representation offers a way to compare the target with possible replacements and, separately, to ask how well each replacement fits the surrounding words. The target and the sentence were already recognizable sources of evidence in this work. What changed was how the evidence could be obtained. The paper discusses this tradition through word embeddings and word2vec.

The paper describes an earlier embedding-based method that scored candidates by their relation to both the original word and the words around it. A subsequent method changed the representation of context words through a learned transformation and relied on dot products for scoring. In this family of approaches, information about the individual context words contributes to the score of a candidate. The replacement can receive strong evidence from its similarity to the target, from the particular context, or from both. The simple embedding approach to lexical substitution provides a point of comparison for understanding the newer estimators.

Context2vec offered a different way to represent the surroundings. It reads the material to the left of a position in one direction and the material to the right in the other, then combines information from those readings. Candidate word vectors are compared with the resulting representation. In the earlier work discussed by the paper, this approach improved performance when the possible replacements were supplied. There is a distinction between making finer judgments among a supplied group of alternatives and constructing a plausible group in the first place. The present paper tests both uses of context2vec.

ELMo also processes text in both directions, with each direction trained to predict words from its side of the sequence. Earlier work used ELMo for lexical substitution by putting each proposed candidate into the sentence and comparing its contextual representation with the target’s representation in the original. This gives the candidate its own opportunity to interact with the complete sentence. It also means the input must be built and processed separately for each candidate under consideration. The authors instead use ELMo’s prediction outputs to obtain evidence about a whole vocabulary from the left and right context. The two uses draw on different parts of ELMo.

BERT and RoBERTa have a pretraining task that already resembles filling a gap. They learn to recover a masked word with evidence from either side of its position. Applying that ability directly to lexical substitution is tempting. The difference lies in what a good answer stands for. In the pretraining exercise, the aim is to recover what had been there. In a lexical substitution exercise, the original word is known and the aim is to identify alternatives that preserve properties of its use. If a sentence permits many completions, hiding the original can throw away precisely the evidence that distinguishes those alternatives. The paper adapts BERT and RoBERTa to make that evidence available.

XLNet arrives at a vocabulary prediction through a different pretraining arrangement. It learns to predict a word at a specified position when some other positions are available as evidence, with the ordering of prediction varied during training. The authors can change which positions supply information when using it for substitution. That makes the meaning of “visible target” dependent on how XLNet is configured. For BERT and RoBERTa it can mean leaving the original word exactly where it appeared. With XLNet, it also involves controlling access to the target through attention.

The paper describes earlier BERT work that tackles the distinction between filling a gap and preserving meaning in two ways. It applies dropout to the original target representation, making it an incomplete cue. It also checks what happens to the representations of the surrounding words once a candidate has been put into the sentence. The latter operation evaluates the effect of a proposed substitution across the rest of the sentence. Its cost grows with the number of proposals it checks. Arefyev and colleagues investigate how much can be achieved by changing the input and scoring vocabulary items from a single pass.

Another precedent comes from word sense induction. Earlier work put the target into a short coordination pattern so a predictor could use the target as a nearby clue when filling the adjacent position. The pattern draws on the fact that words with related meanings can appear in coordination. It also leaves room for a different relationship. Two coordinated verbs may express a sequence of actions, for instance. The present study treats the pattern as one option to compare with other ways of exposing the target, drawing on Word Sense Induction with Neural biLM and Symmetric Patterns.

The related work also includes supervised substitution systems, some of which use manually assembled lexical information. The attraction of the pretrained alternatives in this paper is that the same basic prediction machinery can be used without training it anew on labeled substitution examples. This still leaves decisions about vocabulary, scoring and evaluation. In particular, “without task-specific training” describes how the pretrained weights are used. The experiments still have settings to select, and the authors use benchmark data to select them.

The method, step by step

From a word occurrence to a ranked list

The starting information is a stretch of text, the position of a target word, and the word itself. The paper illustrates this with fly in a short utterance about flying away. The words before the target form the left context and the material after it forms the right context. A context-only predictor estimates what could appear at the target position based on that surrounding material. Because a vocabulary contains many possible completions, the output is a distribution of scores, from which a ranking can be read.

The authors call their ways of adding evidence about the original word target-word injection. Some act on the input. The target can appear in its ordinary position, in an adjacent phrase, or in a separate copy of the sentence. The +embs approach changes the ranking by combining the prediction from context with an additional calculation. This calculation can be done for all vocabulary items using their existing vectors. The following sequence describes that approach through to the post-processing used in the shared substitution comparison.

Lexical substitution with target-word similarity

The steps in order.

Lexical substitution with target-word similarityStep 1: Identify the target and its surrounding text1. Identify the target and its surrounding textStep 2: Score vocabulary items in the sentence2. Score vocabulary items in the sentenceStep 3: Compare candidate vectors with the target vector3. Compare candidate vectors with the target vectorStep 4: Scale the similarity scores with temperature4. Scale the similarity scores with temperatureStep 5: Combine context and target scores5. Combine context and target scoresStep 6: Lemmatize candidates and exclude the target6. Lemmatize candidates and exclude the targetStep 7: Rank the remaining substitutes7. Rank the remaining substitutes

The context and similarity scores address distinct questions. Context supplies evidence that a candidate can occupy this position in this sentence. Similarity supplies evidence that it is suitable as a replacement for this word. Similarity on its own can favor a general association with the target, including one that belongs to a different sense. Context by itself can select a fluent completion that would change what someone had said. For some configurations the contextual prediction already has access to the target. In those configurations, the extra similarity score makes the target’s contribution more explicit.

Computing the target score

The paper writes the original target as T and the context as C. The context consists of the text to the left, L, and to the right, R. To avoid confusing the word T with the paper’s separate use of T for temperature, the following formulas use τ for temperature. A candidate substitute is s. The target-based score for most of the systems is built from an inner product and a temperature-scaled softmax.

P(s ∣ T) ∝ exp(⟨embₛ, embₜ⟩ / τ)

P(s ∣ T) is the probability assigned to candidate s by the target-based calculation, with the vertical bar read as “given.” T is the original word. The symbols embₛ and embₜ denote the vocabulary vectors for the candidate and target, and the angle brackets give their inner product. The exponential function is written exp. The slash divides the inner product by the temperature τ. The proportionality sign means that each candidate gets the displayed positive score and those scores are normalized over the vocabulary to form a distribution.

An inner product is large when the components of two vectors align strongly, and it also depends on their lengths. Temperature controls how large the score differences become after exponentiation. A lower temperature widens differences between the rescaled scores and concentrates mass among the strongest candidates. A higher temperature flattens the distribution, allowing candidates farther from the target to retain more weight. The authors introduce temperature because they found that a direct combination could leave the target-based score too weak against a sharply concentrated context distribution. The balance has practical consequences. A strong target preference can recover a good synonym that context alone ranks low, but it can also reward similarity to the wrong sense.

For RoBERTa with +embs, the authors use cosine similarity in place of the inner product. Cosine similarity compares vector directions, taking vector length into account through normalization. The authors also mask RoBERTa’s target when computing the context score for this configuration. With BERT and XLNet, the default +embs configurations use the original input for that score. Thus the context estimates in the formula serve the same role across the systems, even though the exact evidence available to produce them differs.

The vectors are taken from the same pretrained vocabulary as the context estimator. This choice makes it possible to compare the target with the items that estimator can propose. It also ties the approach to the entries of that vocabulary. Some entries represent full words and others are smaller pieces, depending on the underlying system’s subword tokenization. The authors identify the use of other embeddings as a possible extension. The reported comparison uses the vectors already available to each estimator.

Combining evidence and adjusting for frequency

The final ranking multiplies the context and target scores and optionally adjusts the result using a general estimate of the candidate’s frequency.

P(s ∣ C, T) ∝ P(s ∣ C) × P(s ∣ T) / P(s)ᵝ

P(s ∣ C, T) is the combined probability for candidate s when the text C and target T are supplied. P(s ∣ C) denotes the contextual prediction, while P(s ∣ T) denotes the target-based distribution just described. The multiplication sign combines those two sources of evidence. P(s) denotes the candidate’s general probability of occurrence, and β is the exponent that controls the frequency adjustment in the denominator. The slash indicates division. As before, the proportionality sign allows an overall normalization that leaves the ordering of candidates unchanged.

A candidate favored by both distributions will tend to do well after multiplication. A candidate that is strong according to one source and weak according to the other can still move up or down depending on how decisive those distributions are. The denominator reduces the standing of common candidates when β is positive. Setting β to 0.0, as the authors do for several systems in direct substitution, makes this adjustment inactive. A larger value puts more weight on the possibility that a candidate appears attractive in part because it is generally frequent.

The authors note a probabilistic interpretation for β = 1. Suppose that once a candidate has been specified, the observed surroundings and the observed target can be treated as independent sources of evidence. Applying Bayes’ rule to the product of the two separate conditional probabilities introduces the candidate’s general probability through each factor. Dividing by the prior accounts for its appearance in both. This interpretation gives one reason for the form of the equation. The paper also treats β as a setting that can be varied empirically, and formulations that leave the target visible use context evidence that already depends on the original word.

The general probabilities come from the wordfreq library, with an exception for ELMo. Its vocabulary is ordered by frequency, so the authors estimate probabilities from the ranks through a Zipf–Mandelbrot distribution. They report that the rank-based approach worked better for ELMo and suggest that it may better reflect the corpus used to pre-train it. In both cases the intended quantity is the general frequency of a candidate, distinct from how appropriate it is in the specific sentence.

Making the target available in the input

The simplest input treatment is to hide the target. For an estimator that reads around the target position, the authors can calculate a prediction using the left and right sides. For a system trained to restore hidden text, they put a mask in the target’s place. This gives a reference point for asking how much lexical evidence can be recovered from surrounding words alone. The rankings depend on which completions the sentence favors, including completions that describe something different from the original.

The dynamic-pattern method puts the target next to the prediction slot. In the pattern used in the paper, the word is followed by and, then the slot. With fly as the target, the input asks for something that could be coordinated with flying. The rest of the original text remains relevant to the prediction. This arrangement communicates the original word through an ordinary textual cue. It also adds a new construction, so some responses can be driven by what sounds natural in coordination. A word that works after and can be related by sequence, contrast or association while being unsuitable as a replacement for fly.

The duplicate-input method preserves an intact version of the example and repeats it with the target missing at the position to be predicted. The visible copy gives the predictor a way to recover the original target, while the repeated surroundings tell it where that word belongs. The authors’ motivation is that Transformer-based predictors can copy relevant material from the input while still assigning some probability to distributionally similar alternatives. The mechanism available here is textual. The candidate is scored at the position in the second copy, with the first copy providing an additional cue.

Under original input, BERT and RoBERTa receive the target at the very position where the prediction is read. This preserves the target in its natural context and avoids changing the sentence into a coordination pattern. Its weakness is that the original item can dominate the prediction. Even when that item will later be excluded, the residual ordering matters because it determines which alternatives survive at the top. If very little probability reaches those alternatives, the authors regard their relative ranking as less reliable. With XLNet, the attention setup is changed so that context positions in its content stream can receive information from the target. The query for the target position can then use contextual information that reflects the original word.

Original input is not used in the paper’s context2vec and ELMo implementations. The outputs chosen to predict the word at a particular position are designed to come from the surroundings. The authors found no suitable way to make those same prediction outputs directly depend on the word at that position without additional training. The absence of this setting for those systems follows from how their outputs are used. They can still benefit from the added vector score or receive an occurrence of the target elsewhere in a modified input.

Obtaining the context score

Context2vec reads the left and right parts with separate recurrent networks. In each direction, the network processes the relevant sequence and produces a representation of that side. The system passes those outputs through feed-forward layers to obtain a representation of the full context, then ranks candidate vectors by their dot product with it. The authors use the original implementation and weights pretrained on ukWac. This makes the comparison a test of adapting an existing system to substitution with different sources of target evidence.

For ELMo, the directional parts each yield a vocabulary distribution. The forward side predicts what can follow the left context and the backward side what can precede the right context. The pretrained system does not supply a corresponding set of layers for turning the pair of directional predictions into a joint one, so the authors use a previously proposed combination, BComb-LMs.

P(s ∣ L, R) = P(s ∣ L) × P(s ∣ R) / P(s)ᵞ

P(s ∣ L, R) is the combined score for candidate s using left context L and right context R. P(s ∣ L) is the estimate from the left, and P(s ∣ R) is the estimate from the right. The equality expresses the paper’s combination rule. The multiplication sign joins the directional scores, and the slash divides their product by the general probability P(s) raised to the exponent γ. Gamma controls the frequency adjustment at this directional combination stage. It has a distinct role from β, which belongs to the later fusion of the context and target scores when +embs is used. The ELMo weights are those of the largest original version, pretrained on the 1B Word Corpus.

In both BERT and RoBERTa, the authors take the distribution over the vocabulary from the position occupied by the target’s first sub-word. Their default checkpoints are BERT-large-cased and RoBERTa-large. Unless a setting requires masking, the original example remains intact. For XLNet they use XLNet-large-cased, again with original input as the default. They observed poorer behavior from XLNet on short contexts and addressed it by adding preceding text that ends with a special end-of-document marker. These choices affect how the text is prepared and where the predictions are read. The comparisons use the pretrained weights without fine-tuning.

Baselines and the treatment of output forms

The out-of-context baseline, OOC, uses cosine similarity to compare each candidate with the target. Its vectors are learned from dependency-based contexts, so their training reflects grammatical relationships. At substitution time, the same target is associated with the same candidate ranking regardless of the sentence. That property makes OOC a direct check on how far general lexical similarity can take the task.

The nPIC baseline uses dependency-based vectors too, and adds evidence from words directly connected to the target in the sentence’s dependency tree. The tree represents grammatical connections between words, which may be separated by other words in the sentence. The method assigns each candidate a target score and a score from those selected context words, then multiplies them. It therefore supplies an earlier analogue of the paper’s choice to combine the two kinds of evidence. The context has a different representation here, drawing on dependency parsing.

PₙPIC(s ∣ T, C) = P(s ∣ T) × Pₙ(s ∣ C)

PₙPIC(s ∣ T, C) is the nPIC score for candidate s when the target T and context C are given. The equality says how that score is calculated. P(s ∣ T) is the baseline’s target-based distribution and Pₙ(s ∣ C) is its non-parameterized context distribution. Here C is the collection of words with direct dependency links to the target. The multiplication sign combines the distributions.

P(s ∣ T) ∝ exp(⟨embₛ, embₜ⟩)

In this baseline equation, P(s ∣ T) is the target-based probability for candidate s given T. The angle brackets are the inner product of the dependency-based word vectors embₛ for the candidate and embₜ for the target. The function exp converts that score to a positive value. Proportionality indicates that the values are normalized over candidates. The baseline equation uses the inner product directly.

Pₙ(s ∣ C) ∝ exp(∑c∈C ⟨embₛ, emb′꜀⟩)

Pₙ(s ∣ C) is the baseline context probability for s. The summation sign instructs the calculation to add contributions for context words c. The membership sign indicates that those words come from C. Each contribution is the inner product, shown in angle brackets, of the candidate’s dependency-based word vector embₛ and the context vector emb′꜀ for c. The prime distinguishes the context vector from a word vector. The function exp turns the sum into a positive score, and the proportionality sign allows normalization over candidates.

The direct substitution comparison also needs a consistent way to match the predictions to the answers collected from annotators. A grammatical form proposed by a predictor may differ from the form recorded in the answer set. Lemmatization maps forms to a common dictionary form, or lemma. The authors then exclude the target itself. This matters particularly for configurations that see the intact target, since they can give it a high score. The shared post-processing applies to the reimplemented baselines as well as to the newer estimators. The authors provide an accompanying lexical-substitution code repository.

Turning substitutes into evidence about senses

In the sense induction experiment, each target occurrence gets its own substitute list. The authors lemmatize the proposals and keep the 200 most probable substitutes per occurrence. They treat that list as a document. In this use, a “document” describes an occurrence through alternatives generated for it. It is a representation derived from the sentence and target, with each proposed substitute acting as a feature.

The documents are represented with TF-IDF. The weighting downplays terms that occur widely across the documents being compared and gives more influence to terms that distinguish some of them. This is useful because a list can contain both general alternatives and words characteristic of a particular use. For different occurrences of bank, financial substitutes might help connect one group of sentences, while terms associated with the side of a river help connect another. The calculation uses the spread of substitute terms across occurrences as evidence about their usefulness for grouping.

The authors cluster the resulting vectors with agglomerative clustering, which starts from separate items and repeatedly joins groups. They use cosine distance to compare the representations and average linkage to compare clusters through member-to-member distances. The number of clusters is chosen separately for each target word by maximizing the silhouette score. That score favors a partition in which members are close to their own group relative to nearby alternatives. The algorithm is deterministic in the reported experiments, and the evaluation uses the resulting grouping of occurrences rather than a named sense assigned to each group.

Experiments and results

What the direct benchmarks ask

The authors use two datasets with human suggestions for replacing target words in context. SemEval 2007 contains 2010 sentences covering 201 ambiguous words, with 10 sentences for each word. Annotators were asked for up to 3 alternatives per example. CoInCo, short for Concepts-In-Context, has about 2500 sentences taken from fiction and news. Each content word in those sentences can be a target, yielding about 15K examples, and the paper reports at least 6 suggestions per example. The datasets therefore sample uses differently. SemEval concentrates on repeated occurrences of selected ambiguous words, while CoInCo makes targets from content words across a set of sentences.

A proposed substitute can receive more than one vote. In the reference answers, its weight is the number of annotators who supplied it for that occurrence. This gives the evaluation information about agreement as well as membership in the list. An answer that many annotators independently chose can be treated differently from an answer offered by a single person. The analysis of word relationships later in the paper uses those human lists as a separate point of comparison with the generated lists.

In candidate ranking, each system receives a list built by pooling the known substitutes for the target lemma across the corpus. A candidate can be present because people supplied it for a different occurrence of the same target. The system has to order those candidates for the current sentence. This puts pressure on sense selection when the pooled alternatives span several uses of the word. The authors use Generalized Average Precision, or GAP, which rewards putting relevant candidates near the top and accounts for their annotation weights. They remove multiword answers for this evaluation and drop cases that have no gold substitute after that restriction.

The all-vocabulary evaluation asks the system to propose its own candidates. There is no supplied list of plausible alternatives to narrow the decision. Precision at the first prediction, P@1, tracks how frequently the first proposal is a reference answer. P@3 measures precision among the top 3 proposals, and R@10 measures how much of the gold answer set is recovered in the top 10. A strong early precision score means the best proposals tend to match annotators. Recall gives credit for retrieving a wider share of their answers within the stated cutoff. These are different demands on the same ranking, which matters when some plausible alternatives have never been collected by the benchmark.

Comparing systems under the same output rules

A shared comparison gives all estimators the same lemmatization and target exclusion. OOC and nPIC are the reimplemented embedding baselines. Plain context2vec and ELMo predict from surrounding text, while the plain BERT, RoBERTa and XLNet configurations in this comparison get the original input. The latter already have some access to the target. Improvement from +embs for those systems therefore measures what the explicit similarity calculation can add beyond the particular original-input setup.

SemEval 2007 all-vocabulary ranking by precision at the first prediction

XLNet with target embeddings leads the shared comparison on the first proposed substitute.

SemEval 2007 all-vocabulary ranking by precision at the first predictionOOC: 16.82OOC16.82nPIC: 23.22nPIC23.22context2vec: 7.79context2vec7.79context2vec +embs: 28.01context2vec +embs28.01BERT: 38.34BERT38.34BERT +embs: 41.64BERT +embs41.64RoBERTa +embs: 44.13RoBERTa +embs44.13XLNet: 31.70XLNet31.70XLNet +embs (this paper): 49.48XLNet +embs (this paper)49.48
The numbers
System or settingP@1
OOC16.82
nPIC23.22
context2vec7.79
context2vec +embs28.01
BERT38.34
BERT +embs41.64
RoBERTa +embs44.13
XLNet31.70
XLNet +embs (this paper)49.48

On SemEval 2007, XLNet+embs also has P@3 of 34.88 and R@10 of 47.18 in the shared comparison. Plain XLNet has 22.80 and 34.90 on those measures. RoBERTa+embs reaches P@3 of 31.67 and R@10 of 44.70, while BERT+embs has P@3 of 30.57 and R@10 of 43.48. These scores show that the XLNet lead extends to measurements that look beyond the very first proposal. Plain BERT’s P@1 is higher than plain XLNet’s. The best combination therefore depends on both the pretrained system and how it gets information about the target.

The CoInCo results put XLNet+embs first in the shared comparison too. It records 51.48 at P@1, 39.91 at P@3 and 34.91 at R@10. Plain XLNet records 38.16, 28.58 and 26.46 on the respective metrics. The corresponding RoBERTa+embs scores are 46.54, 36.33 and 32.03. For the reimplemented nPIC baseline, P@1 is 25.75 and P@3 is 19.12. The pattern recurs on data that gives the evaluator more suggestions per occurrence and samples the target words differently.

One striking result concerns plain context2vec. It reaches GAP of 55.81 on SemEval 2007, ahead of plain BERT at 54.40 and plain ELMo at 53.63. But context2vec has P@1 of 7.79 when it must produce its own candidates from the vocabulary. Adding +embs raises that P@1 to 28.01 while reducing GAP to 53.40. The same component can help the system locate the right region of a vocabulary and be less effective when the benchmark has already narrowed the comparison to known substitutes. The two scores answer different questions about the ranking.

On CoInCo, context2vec’s GAP goes from 48.32 to 50.73 with +embs, and ELMo’s goes from 49.47 to 52.22. RoBERTa improves from 50.63 to 54.68, and XLNet from 53.39 to 55.63. In the all-vocabulary setting, every paired comparison in the shared table favors +embs on each reported precision and recall measure. GAP generally improves, with some exceptions on SemEval 2007. The stronger consistency of the open-vocabulary results is important because choosing among words that annotators have proposed somewhere already removes much of the competition from fluent but unrelated completions.

Comparison with published results

The authors also report a comparison with previously published scores. In that comparison, XLNet+embs has GAP of 59.6 and P@1 of 49.5 on SemEval 2007, and GAP of 55.6 and P@1 of 51.5 on CoInCo. The published PIC row has GAP of 52.4 and P@1 of 19.7 on SemEval 2007, and GAP of 48.3 and P@1 of 18.2 on CoInCo. These are the figures as reported in that comparison, which places them at a different precision of reporting from the shared comparison.

The strongest previously published comparator is the BERT lexical substitution system with candidate validation. Its reported SemEval 2007 results are 60.5 GAP and 51.1 P@1. On CoInCo it reports 57.6 GAP and 56.3 P@1. These scores are higher than those of XLNet+embs on the corresponding measures. The paper reports that the authors could not reproduce the earlier results and that the earlier code was unavailable to them. Their treatment of those scores is as published comparison points.

The two approaches use different evidence. The earlier system feeds a sentence containing a proposed replacement back through BERT. It compares representations of words in that revised sentence with representations in the original and uses the comparison to help score the candidate. That adds forward passes for candidate validation. The authors’ estimators score the vocabulary with one forward pass through the pretrained predictor, then combine or process the scores. They suggest that their approach and candidate validation could be combined. The reported score comparison does not test such a combination.

Grouping occurrences by sense

The downstream experiments use SemEval-2010 and SemEval-2013 data for word sense induction. The examples are occurrences of ambiguous target words. The system groups the occurrences of each target according to the sense expressed in each context. In the paper’s illustration, a person on a river bank and people unloading a boat to the bank belong together, while a bank offering a mortgage belongs in a separate group. The direction of the task is from examples to groups, with the groups inferred from the substitute representations. The paper places the task in the tradition of SemEval-2010 Word Sense Induction & Disambiguation.

SemEval-2010 word sense induction by reported average score

XLNet with target embeddings has the highest point score, with a lead within the earlier system’s reported variation.

SemEval-2010 word sense induction by reported average scorecontext2vec: 38.9context2vec38.9context2vec +embs: 28.5context2vec +embs28.5ELMo +embs: 45.3ELMo +embs45.3BERT: 52.0BERT52.0BERT +embs: 53.8BERT +embs53.8XLNet: 52.2XLNet52.2XLNet +embs (this paper): 54.2XLNet +embs (this paper)54.2
The numbers
System or settingAVG
context2vec38.9
context2vec +embs28.5
ELMo +embs45.3
BERT52.0
BERT +embs53.8
XLNet52.2
XLNet +embs (this paper)54.2

On SemEval-2010, the stronger earlier comparator has a reported AVG of 53.6±1.2, while XLNet+embs reaches 54.2. On SemEval-2013 the comparable figures are 37.0±0.5 and 37.3. BERT+embs is close to that SemEval-2013 result at 36.8, and plain XLNet reaches 33.4. The older symmetric-pattern system has a reported SemEval-2013 average of 25.43±0.48. The table presents earlier stochastic approaches as means with standard deviations. The present approach produces a single score from its deterministic procedure. The paper explicitly notes that the lead over the stronger earlier system lies within its reported standard deviation on both datasets.

Word sense induction has its own tuning procedure. The authors select the settings on TWSI and use them on both SemEval induction datasets. They set β to 2.0 for BERT+embs, XLNet+embs, RoBERTa+embs and ELMo+embs, and to 0.0 for context2vec+embs. The respective temperatures are 2.5 for BERT, 1.0 for XLNet, 10.0 for RoBERTa and 0.385 for ELMo, with 1.0 for context2vec. The parameters determine what goes into the substitute lists before the weighting and clustering stages. Their values differ from those used in direct substitution, where early agreement with annotators is the end point.

What the ablations show

Temperature and output handling affect different parts of the ranking

The clearest ablations start from the best direct substitution configuration and change one part of it. These comparisons examine the temperature of the target-based distribution and the post-processing of the output. Temperature changes the relative scores assigned to candidates. Lemmatization and target exclusion change how those candidates enter the evaluation. Both matter to the final result, but the failure modes they address differ.

XLNet+embs ablations on CoInCo by precision at the first prediction

Excluding the original target has the largest effect among the changes shown, and the full configuration scores highest.

XLNet+embs ablations on CoInCo by precision at the first predictionWithout target exclusion: 2.5Without target exclusion2.5Without lemmatization: 34.5Without lemmatization34.5Ordinary softmax: 40.5Ordinary softmax40.5Full XLNet +embs (this paper): 51.5Full XLNet +embs (this paper)51.5
The numbers
System or settingP@1
Without target exclusion2.5
Without lemmatization34.5
Ordinary softmax40.5
Full XLNet +embs (this paper)51.5

Using ordinary softmax, with temperature 1.0, gives GAP of 52.6 on SemEval 2007, compared with 59.6 for the full XLNet+embs setting in the same table. On CoInCo, the corresponding GAP scores are 49.4 and 55.6. The authors report decreases across the metrics in this comparison. The direct substitution configuration uses a temperature of 0.1 for XLNet+embs. This result supports the idea that a similarity calculation can have little practical value if its scale leaves it unable to move candidates into useful positions.

The effect of excluding the target appears especially strongly at the first prediction. With the target retained, SemEval 2007 P@1 is 0.4, compared with 49.5 for the full configuration. CoInCo P@1 is 2.5 with the target retained, compared with 51.5 in the full configuration. The original item is an exceptionally plausible prediction when the system has seen it. It also has a strong similarity relationship to itself. When it heads the list, the answer that would have been first among actual replacements becomes less visible in the evaluation. P@3 retains some ability to register useful candidates farther down the list, which helps explain why the P@1 effect is particularly pronounced.

Removing lemmatization gives P@1 of 38.3 on SemEval 2007 and 34.5 on CoInCo, both lower than the corresponding full-system results. This comparison identifies how much the match to reference answers depends on handling word forms. A form can reflect what fits grammatically at the position and still fail to match the reference representation. The higher score after lemmatization is evidence that aligning forms matters to the task as measured. It evaluates a different property from the temperature experiment, where the change alters the balance between the context and target scores before matching to the answers.

In the direct substitution setting, the authors use CoInCo to tune hyper-parameters for SemEval 2007 and use SemEval 2007 to tune them for CoInCo. Their motivation is the lack of a reasonably sized development split in SemEval 2007. The procedure selects the same settings in both directions. BERT+embs, XLNet+embs and ELMo+embs use temperature 0.1. RoBERTa+embs uses 0.25, and context2vec+embs uses 1.0. The frequency exponent β is 0.0 for the direct substitution versions of BERT, XLNet, RoBERTa and context2vec with +embs. For ELMo the directional combination uses γ = 0.5, and its +embs combination uses β = 1.5. The settings help explain why the result for ordinary softmax on XLNet cannot be extended wholesale to the other systems or to sense induction.

The way the target enters matters

The authors compare injection choices using R@10 on both substitution datasets. The coordination pattern can perform worse than hiding the target. Its behavior illustrates the difference between supplying a word as evidence and asking about the relation that matters. A verb next to and can elicit a plausible subsequent action. The new proposal may relate to the visible target, and the phrase may sound natural, while the proposal remains unsuitable as a synonym. The form of the input has in effect added a second cue with a meaning of its own.

Original input is a strong starting point for the systems that support it. A visible original word can move more closely related candidates up the list even without the separate embedding term. The shared comparison consequently sets a meaningful test for +embs with XLNet and BERT. The added score improves their open-vocabulary results over configurations that already have access to the target. For context2vec and ELMo, the gain has a somewhat different interpretation because the ordinary prediction derives from the surroundings only. The extra score gives them direct lexical evidence that their default prediction does not receive.

The duplicate input is effective for the Transformer-based systems in the comparison and offers little help to context2vec or ELMo. The authors highlight XLNet as a case where duplication can be particularly beneficial. They connect this to the ease with which the system can find the word elsewhere in the input, compared with obtaining its identity directly at the position being predicted. They also suggest that the ability to copy a word from its context helps retain nearby alternatives in the vocabulary. The measured recall shows a difference between architectures under the duplicate-input condition. Copying is the authors’ explanation of that pattern.

Across these injection comparisons +embs is generally strongest in R@10. A concrete example is SemEval 2007 context2vec, which has R@10 of 11.03 without the separate embedding score and 33.02 with it in the shared comparison. ELMo goes from 13.93 to 31.82 there. The gain can be large when the default prediction has little evidence about the word itself. The results also show that the appropriate comparison depends on the evaluation. On the same dataset, the context2vec version with the embedding score ranks less well by GAP even as it retrieves more of the open-vocabulary answers.

Clustering supplies a further paired comparison. On SemEval-2010, context2vec goes from 38.9 AVG to 28.5 AVG with +embs, whereas ELMo goes from 41.8 to 45.3 and BERT goes from 52.0 to 53.8. On SemEval-2013, context2vec improves from 18.2 to 21.7, and XLNet improves from 33.4 to 37.3. The authors suggest that the poor SemEval-2010 context2vec result may reflect suboptimal hyper-parameters. The comparison leaves open how much of the difference comes from tuning and how much comes from the lists that this particular estimator produces. A substitute list that looks stronger under direct precision and recall can still give the clustering procedure different cues about which occurrences belong together.

What kinds of alternatives move up

The analysis of semantic relations uses CoInCo and WordNet. For each candidate and target, the authors select the pair of WordNet synsets that gives the shortest path. A synset groups words expressing a shared meaning. If the chosen pair is connected through one of the direct relations of interest, the corresponding label is assigned. The categories include shared meaning, a narrower meaning, a broader meaning, and membership in related categories that have an immediate common parent. The analysis looks for indirect versions of the hierarchical relationships as well. For co-hyponyms, it allows a common ancestor up to 3 hops from each synset.

A hyponym is a narrower category relative to the word it is being compared with, and a hypernym is a broader category. Co-hyponyms share a broader category. In the paper’s purchase example, automobile illustrates the closest kind of replacement for car, motor vehicle supplies a broader description, and bike illustrates a related category that changes the object purchased. WordNet is used to operationalize distinctions of this kind across a large set of proposals, including pairs whose relationship is more distant.

The authors also distinguish cases where one member is absent from WordNet for the required part of speech, cases where both are in the same tree but their path does not match the tested relations, and cases where they are in different trees. This gives the analysis a place for outputs that cannot be classified as the intended lexical relations. The comparison uses the top 10 proposals from each system and all of the reference suggestions from annotators. Its unit is the relationship between a particular target and substitute pair, with proportions reported for categories of those relationships.

Even the gold suggestions include many pairs without a direct WordNet relation. For adjectives and adverbs, the proportions of human substitutes classed as unknown at the required part of speech are 18% and 25%, respectively. For nouns and verbs they are below 7%. The paper cites glitter as a suggestion for adjectival bright. It illustrates how a person can propose an associated word that receives no match under the expected grammatical category. Other unknown cases can arise from the lexical resource’s coverage, so the category is broader than an error in part of speech.

OOC and nPIC produce a particularly large proportion of unknown items in the analysis. The authors point to possible typos in their vocabularies and observe that these baselines frequently fail to preserve the target’s part of speech. The neural estimators produce fewer unknown items, and the +embs versions reduce the proportion further to levels comparable to those of the human suggestions. The authors interpret the result as evidence that explicit target similarity can help preserve grammatical category. An unknown label can arise in several ways, so the evidence is indirect.

The relations for nouns and verbs shift in a consistent direction with +embs. Synonyms and directly broader or narrower terms account for a larger share. Distant co-hyponyms and unrelated candidates account for a smaller share. The effect is particularly marked for context2vec and ELMo, whose ordinary predictions begin without the target identity. The direction of the change is consistent with the distinction between selecting general completions and finding terms that are close to the original word. It also brings the distribution of the reported relation types closer to the annotators’ suggestions.

Reading the successes and failures together

The paper’s examples show what these aggregate differences can look like within a sentence. In the example with phone, the sentence describes being unable to travel and having no phone. Bare XLNet suggests that there might be no electricity or internet. Each completion describes a plausible lack in the situation. The annotators favored telephone, and adding the similarity score moves alternatives such as telephone and cellphone upward. The change makes sense as a shift toward replacing the named object with a related term rather than imagining what else could have been absent.

The garbage-can example exhibits the opposite effect. Plain XLNet has bin, disposal and container among its top 10. The context specifies the object clearly enough for the system to find alternatives. The +embs output also contains relevant nouns, but promotes items such as could and will. Those items are closer to a different use of can. The authors attribute this to the target score pulling toward the more frequent use. A score derived from the original spelling helps only when its general associations are compatible with the sense selected by context.

The appendix’s example with drop makes the conflict visible in a fixed expression. The wording concerns getting in touch with someone, and the reference answers include write and send, as well as alternatives that involve more than one word. Some high-ranked generated alternatives instead track the ordinary lexical associations of drop or resemble its inflected forms. The surrounding expression supplies much of the intended meaning. Such cases help explain why increasing similarity to the target word can reward the wrong property when the substitution decision depends on an idiom. The paper’s displayed predictions are from before post-processing, so the repeated target and inflected forms in those examples show what the estimators originally produced.

Limitations

Limits the authors identify

The vocabulary is a direct limit on what the estimators can return. The paper gives approximate sizes of 30K sub-words for BERT and XLNet, 800K words for ELMo and 180K words for context2vec. A prediction taken at a single position can only propose an item available at that position. A lexical replacement that needs several tokens may be absent from the list even if its pieces occur individually in the vocabulary. The authors identify generating multi-token substitutes as a direction for improvement. The reported system does not establish how such generation would affect the comparison.

The method uses the pretrained system’s own vectors for target similarity. The authors leave the question of whether other embeddings might perform better for future work. Choosing vectors from the same system provides a straightforward match with the vocabulary used for prediction. It also means that a more informative representation of target meaning could change the balance of results. The reported tests measure the combination with the embeddings available in these systems.

Another limit the authors illustrate is sensitivity to the sense represented by the vocabulary item. The garbage-can prediction shows that a general association can outweigh better evidence from a particular sentence. The authors propose choosing a separate temperature for each example, guided by properties of the distributions being combined. They present that as a hypothesis. The reported experiments use temperatures selected for systems and evaluation settings, and the paper gives no result for a procedure that adapts the temperature to individual occurrences.

The authors acknowledge that the strongest published BERT comparison reports better direct substitution scores. They explain the extra computation required by the earlier substitute validation method and suggest that the two approaches might be complementary. The study provides a comparison between reported scores and describes the different amounts of forward computation involved. It does not evaluate a joint system or give a measured runtime tradeoff at matched substitution quality.

For sense induction, the authors state that the winning scores are within the earlier system’s reported variation. The deterministic result shows the score attained by this pipeline on each benchmark. A higher point score is the extent of the claimed numerical lead that can be directly read from the comparison. The difference in how results are reported leaves limited grounds for inferring a reliable ranking across other benchmark samples.

Limits implied by the evaluation

Candidate ranking begins with alternatives that are known to have been given for that lemma somewhere in the corpus. It measures how well the proposed scoring procedure orders an informative list for a specific occurrence. How frequently an estimator can find those same alternatives by searching its vocabulary is a separate question, addressed by the open-vocabulary evaluation. This difference matters when reading a GAP result alongside P@1. Context2vec’s uneven performance across the two settings shows how much information the supplied list contributes.

Open-vocabulary evaluation still relies on a finite set of human responses. A candidate can be grammatical and close in meaning while receiving no recorded vote. The datasets also give annotators different opportunities to propose alternatives. SemEval 2007 asks for up to 3, and CoInCo has at least 6 per occurrence. The scores measure agreement within those collection procedures. Likewise, dropping multiword answers and cases without a remaining answer from candidate ranking confines that result to examples with a suitable single-word reference. Expressions whose meaning is distributed over several words receive limited coverage in this setup.

Lemmatization and target exclusion substantially affect the numerical results. Those steps are shared across the authors’ controlled comparison, which supports comparisons within it. The figures also reflect a particular decision about which forms count as equal and what to do with the original word. They give less direct evidence about how well a raw output list would work as a list of ready-to-insert edits. A user of such a list would care about the form appropriate to the actual sentence as well as the lemma that matches an annotator’s choice.

The architecture comparisons change several things together. The systems differ in pretraining corpora, prediction objectives, vocabulary units and input settings. RoBERTa+embs even uses a different similarity measure and target visibility choice from BERT+embs and XLNet+embs. The experiments establish the performance of those configured estimators on these data. An overall lead for XLNet+embs leaves several possible explanations for why that configuration works better. The within-system comparisons are more informative about the effect of adding target similarity to a particular baseline.

The WordNet analysis measures closeness under a particular lexical inventory and a shortest-path procedure. Choosing the closest pair of synsets can associate a target and candidate through a sense different from the one intended in the sentence. The analysis can thus show that a relation exists between some senses of the words. Contextual correctness still depends on which senses the occurrence expresses. The part-of-speech filter and the treatment of indirect relationships also shape which links become visible in the results, especially for words whose reference suggestions are sparsely represented in WordNet.

Finally, the clustering results apply to a specific representation and sense induction procedure. The method uses 200 substitute terms per occurrence, TF-IDF weighting, cosine distance, average linkage and selection by silhouette score. A change in vocabulary preference can interact with any of those choices. The results show that suitably chosen substitutes can be useful features for grouping meanings in this setting. They do not evaluate every use proposed for lexical substitution. The study’s evidence about text rewriting, lexical relation extraction and data augmentation comes from the behavior of the substitute lists and the paper’s discussion of applications, while the measured downstream results concern word sense induction.

What came after

One later citation comes from work on detoxifying Russian text. That application shifts the purpose of a replacement from recovering a human-suggested alternative to changing an undesirable property of the text. The relationship to lexical substitution is the tension between the change an editor wants to make and the wording or meaning it wants to preserve. Arefyev and colleagues give an experimental account of one part of that tension, by measuring the effect of retaining evidence about the original word. The citation establishes a connection to the detoxification work, while the nature of any reuse of +embs or of a particular estimator remains unspecified. Methods for Detoxification of Texts for the Russian Language

The other later work is the RCML shared-task entry on lexical simplification. Its title identifies modular ranking of substitution candidates as the approach. Lexical simplification adds a preference for a replacement that is easier for the reader, alongside the need for it to fit the sentence and preserve the intended meaning. The connection to Arefyev and colleagues is at the candidate-ranking stage, where several kinds of evidence can bear on the same proposal. In the earlier study, contextual fit and closeness to the target enter through separate scores. The later entry addresses the ranking problem in a task with a different goal for the final substitution. The particular scoring modules inherited from the earlier paper, if any, are unspecified. RCML at TSAR-2022 Shared Task: Lexical Simplification With Modular Substitution Candidate Ranking

Cite

Cite as Nikolay Arefyev, Boris Sheludko, Alexander Podolskiy and Alexander Panchenko. 2020. Always Keep your Target in Mind: Studying Semantics and Improving Performance of Neural Lexical Substitution. Proceedings of the 28th International Conference on Computational Linguistics.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2020.coling-main.107

@inproceedings{arefyev2020always,
  title = {{Always Keep your Target in Mind: Studying Semantics and Improving Performance of Neural Lexical Substitution}},
  author = {Nikolay Arefyev, Boris Sheludko, Alexander Podolskiy and Alexander Panchenko},
  booktitle = {Proceedings of the 28th International Conference on Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.coling-main.107},
  url = {https://doi.org/10.18653/v1/2020.coling-main.107}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/arefyev-2020-always-keep-your-target-mind/