Introduction
In Natural Language Processing, the Word-in-Context (WiC) task evaluates a model's ability to determine if a target word shares the same meaning across two different sentences. For example, distinguishing between "bank" as a financial institution versus a riverbank. While most modern systems rely on contextualized embeddings from models like BERT or XLM-R, they typically utilize only the final layer.
The "Time-Embedding Travelers" team argues that this approach ignores the rich linguistic hierarchy captured across Transformer layers. Research indicates that lower layers handle surface features, middle layers manage syntax, and higher layers process semantics. By analyzing the interplay across all layers, the team proposed a novel metric to capture nuanced shifts in meaning.
Methodology
The core innovation of this approach is the transition from comparing single vectors to analyzing the relationship between entire trajectories of embeddings across the model's depth.
- Multi-Layer Extraction: For a target word in two contexts, embeddings are extracted from every layer (e.g., all 12 layers of XLM-R base).
- The Similarity Matrix ($S$): A $12 \times 12$ matrix is constructed where each cell $(i, j)$ represents the cosine similarity between the word's representation in Layer $i$ of Sentence A and Layer $j$ of Sentence B.
- The Condition Number (COND): Instead of simple averaging, the team calculates the condition number of this matrix using the Frobenius norm. In linear algebra, the condition number measures a function's sensitivity to small input changes.
- Hypothesis: A stable meaning across contexts results in a "well-conditioned" matrix (lower COND value), while a semantic shift creates an "ill-conditioned" or unstable relationship between layer representations.
Classification is performed using a simple threshold-based approach: if the COND score exceeds a specific value, the meanings are labeled as different.
Key Insights and Results
The study utilized the WiC-ITA benchmark from EVALITA 2023, covering monolingual Italian (L) and cross-lingual Italian-English (XL) pairs. The system relied on pre-trained XLM-RoBERTa (XLM-R) and mBERT without any additional fine-tuning, demonstrating the strength of zero-shot geometric analysis.
Performance Highlights
- Holistic Model Advantage: Utilizing the complete set of embeddings consistently outperformed using only the final layer ($CS_{12}$) or an average of the last four layers.
- Middle Layer Significance: Semantic information was found to be heavily concentrated in the middle layers. A subset of these layers ($COND_M$) often performed nearly as well as the full model.
- Competitive Rankings: The COND metric allowed the team to dominate the official WiC-ITA competition, particularly in cross-lingual tasks.
As shown in the competition results, the team achieved first place in both the Cross-lingual (XL) Classification and Ranking subtasks, and second place in the Monolingual (L) subtasks. Quantitatively, the COND measure reached a Spearman correlation of 0.519 on the test set, a significant improvement over the 0.339 achieved by the 12th layer alone.
Conclusion and Future Work
The success of the condition number metric suggests that "meaning" in deep learning models is best understood as a trajectory across layers rather than a single point in vector space. While highly effective, the current system's reliance on threshold sensitivity presents an opportunity for future refinement through learnable interpretation methods. The authors intend to extend this multi-layer stability approach to Lexical Semantic Shift Detection, tracking how word meanings evolve over longer historical periods.
Summary updated