Analyzing Semantic Change through Lexical Replacements

Francesco Periti, Pierluigi Cassotti, Haim Dubossarsky, Nina Tahmasebi · DOI

Introduction

Language is a dynamic entity, constantly evolving as new meanings emerge and old ones fade. For large language models (LLMs) like BERT or LLaMa, this evolution poses a significant challenge. These models are essentially "time capsules," their linguistic understanding frozen at the moment their training data was collected. When an LM encounters a word used in a novel context—such as "surfing" referring to the internet rather than the ocean—it experiences a form of "tension" between its internal, pre-trained knowledge and the current sentence context.

This paper introduces a novel "replacement schema" designed to quantify this tension. By systematically swapping target words with various substitutes (synonyms, antonyms, etc.) and measuring the resulting shifts in internal representations, the authors provide a method for detecting Lexical Semantic Change (LSC) that is both high-performing and linguistically interpretable.

The Replacement Schema

The core of the proposed methodology is the replacement schema. To simulate and measure semantic change, the authors identify a target word ($w$) within a sentence and replace it with a substitute ($r$). These substitutes are drawn from lexical resources like WordNet and Wiktionary and include synonyms, antonyms, hypernyms, and random words.

The primary metric used is Self-Embedding Distance (SED). SED is defined as the cosine distance between the embedding of the original word $w$ and its replacement $r$ within the exact same sentence context. A high SED suggests that the model finds the replacement difficult to reconcile with the surrounding context, indicating a high degree of "tension."

Beyond static replacements, the study also explores generative substitutes. By leveraging the capabilities of LLaMa 2, the authors generate context-aware substitutes to probe the model's internal understanding of a word's specific usage in a given sentence.

Layer-wise Contextualization

A key contribution of this work is the analysis of how this "tension" manifests across the different layers of a transformer-based model. By tracking SED layer by layer, the authors reveal how contextualization unfolds during processing.

Self-embedding distance (SED) across layers for different parts of speech and models.

As shown in Figure 1, SED generally decreases in the higher layers of the models (MBERT, XLMR, and BERT). This trend suggests that LMs rely heavily on their pre-trained, "dictionary-like" knowledge in the early layers. It is only in the final stages of processing that the models truly integrate the specific sentence context to refine the word's representation.

Furthermore, the analysis highlights differences across Parts of Speech (PoS). Verbs, for instance, tend to exhibit higher SEDs and less pronounced contextualization compared to nouns or adjectives. This suggests that LMs may be more "stubborn" regarding their pre-trained definitions for verbs, relying less on context to modify their internal representations.

Performance and Interpretability

The effectiveness of the replacement schema was evaluated on the SemEval-2020 Task 1 benchmark for English Lexical Semantic Change detection. The results demonstrate that this relatively simple approach is highly competitive with more complex, state-of-the-art models.

Comparison of Spearman correlation scores for LSC detection models.

As detailed in Figure 5, the synonym-replacement model achieved a Spearman correlation of 0.741, outperforming several established baselines and approaching the performance of the state-of-the-art XL-LEXEME model (0.757). Interestingly, even random replacements served as an effective proxy for detecting strong semantic shifts, such as homonymy.

One of the primary advantages of this method is its interpretability. Unlike "black-box" models, the replacement schema provides a clear linguistic trail. By identifying the "farthest replacements"—those that cause the most tension—researchers can pinpoint exactly how a word's meaning has shifted. For example, for the word record, the model identified a shift from meanings related to attainment in earlier time periods to meanings associated with evidence or documentation in later ones.

Conclusion

This research demonstrates that lexical replacement is a powerful tool for probing the internal states of language models and detecting semantic change. By quantifying the "tension" between pre-trained knowledge and new contexts, the authors provide a method that is not only accurate but also offers deep linguistic insights. Future work aims to reduce the dependency on external lexicons like WordNet by moving toward fully unsupervised, model-generated replacements, further enhancing the flexibility and cross-linguistic applicability of this approach.

Summary updated

BibTeX
@inproceedings{periti2024analyzing,
  author = {Francesco Periti and Pierluigi Cassotti and Haim Dubossarsky and Nina Tahmasebi},
  title = {{Analyzing Semantic Change through Lexical Replacements}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=H1TztbIecW},
}
Figure