Abstract
Contrastive learning (CL) has become the standard for fine-tuning sentence embeddings, yet the internal geometric changes during this process remain poorly understood. This paper investigates the evolution of the embedding space through the lens of "Representation Rank"—a measure of the effective dimensionality of the data. Our analysis reveals a consistent two-phase pattern during fine-tuning: an initial Rank Expansion phase followed by a Rank Compression phase. We demonstrate that while high rank is initially beneficial for uniformity, it eventually correlates with performance instability and a loss of linguistic alignment. To leverage these insights, we introduce a Rank Reduction (RR) regularizer that penalizes high-rank representations. Empirical results across five state-of-the-art models show that RR significantly improves Semantic Textual Similarity (STS) performance and training stability.
Introduction
In Natural Language Processing (NLP), pre-trained models like BERT are frequently fine-tuned to produce sentence embeddings—vector representations that capture semantic meaning. The most effective method for this is Contrastive Learning (CL), which optimizes the embedding space by pulling semantically similar sentences together (alignment) and pushing dissimilar ones apart (uniformity).
Despite its success, CL-based fine-tuning is often treated as a "black box." Models frequently exhibit high variance in performance based on random seeds, and the relationship between the geometric structure of the embedding space and downstream performance is not fully characterized. This research addresses these gaps by analyzing the Effective Rank (erank) of representations during the fine-tuning process.
The Two-Phase Dynamics of Fine-Tuning
By monitoring the effective rank—the number of dimensions the data actually occupies—the researchers identified a predictable two-stage trajectory in the training process:
- Phase 1: Rank Expansion: In the early stages of training, the rank increases sharply. The model focuses on maximizing uniformity, spreading embeddings out to ensure that cosine similarity becomes a meaningful metric. However, this expansion often comes at the cost of "alignment" and certain structural linguistic abilities.
- Phase 2: Rank Compression: As training continues, the rank begins to decline. During this phase, the model recovers its alignment and linguistic skills while maintaining the uniformity established in Phase 1.
Linguistic probing using the SentEval toolkit revealed that the model's understanding of sentence structure (e.g., tree depth and grammar) actually dips during Phase 1, reaching its lowest point at the "peak rank" before recovering during Phase 2. This suggests that excessive dimensionality can actually interfere with the model's ability to represent linguistic nuances.
Rank as a Metric for Stability
A critical finding of this study is the relationship between rank and training stability. The authors discovered a massive 0.94 correlation between a model's average representation rank and its performance instability. High-rank models tend to be "jittery," with performance varying significantly across different random seeds. Conversely, lower-rank models demonstrate much higher consistency, suggesting that rank serves as a reliable anchor for model reliability.
Proposed Method: Rank Reduction (RR)
Based on the observation that performance improves as rank decreases during the second phase of training, the authors proposed a Rank Reduction (RR) regularizer. This is a straightforward mathematical term added to the standard contrastive loss function:
$$\mathcal{L}_{total} = \mathcal{L}_{CL} + \lambda \mathcal{L}_{RR}$$
The RR term encourages the model to reduce its representation rank throughout the entire training process. By penalizing high-rank representations, the regularizer essentially "fast-tracks" the benefits of Phase 2, leading to more efficient and stable learning.
Experimental Results
The RR strategy was evaluated on standard Semantic Textual Similarity (STS) benchmarks (STS 2012–2016, STS-B, and SICK-R) across various architectures, including BERT and RoBERTa.
Performance Gains
For the baseline SimCSE model, the addition of the RR regularizer improved the average STS score from 76.25 to 78.03 (+1.78 points). This improvement allowed the relatively simple SimCSE model to nearly match the performance of more complex, state-of-the-art architectures like PromptBERT.
Enhanced Stability
The impact on stability was even more pronounced. In SimCSE, the standard deviation of performance across different random seeds dropped from 0.81 to 0.30. This reduction in variance makes the training process significantly more reliable for researchers and practitioners.
Universality
The benefits of RR were consistent across different hidden layer sizes (512, 768, and 1024), suggesting that the relationship between rank and performance is a fundamental property of sentence embedding fine-tuning rather than an artifact of specific model sizes.
Conclusion and Future Work
This research provides a new framework for understanding the geometry of sentence embeddings. By identifying the two-phase nature of rank evolution and the correlation between high rank and instability, the authors offer a practical tool in the form of the Rank Reduction regularizer.
While the empirical results are robust, future work is needed to provide a full theoretical proof of why lower-rank representations yield better sentence embeddings. Additionally, while RR showed significant gains for most models, the effects were less pronounced for models already operating at peak performance (like InfoCSE), suggesting a potential saturation point for rank-based optimization. Extending this analysis to supervised tasks and other fine-tuning paradigms remains a promising avenue for future study.
Summary updated