Abstract
This paper challenges the widely held belief that anisotropy—the tendency for BERT embeddings to cluster in a narrow "hypercone"—is the primary reason for their poor performance on semantic similarity tasks. Through a series of targeted experiments, we demonstrate that anisotropy is a symptom of underlying data biases (such as word frequency and casing) rather than the root cause of poor performance. Our findings suggest that simply "fixing" the geometric shape of the embedding space does not necessarily improve its semantic utility.
Introduction
In Natural Language Processing (NLP), BERT is highly effective for fine-tuning but its "out-of-the-box" (vanilla) embeddings are surprisingly poor at capturing sentence meaning. Calculating the cosine similarity of average BERT embeddings often yields results inferior to older, static models like GloVe. Researchers previously diagnosed this as a "representation degeneration problem" characterized by anisotropy. The logic was that if all vectors point in nearly the same direction, they cannot effectively differentiate between distinct meanings. This study investigates whether this "squished" space is the actual problem or merely a distraction from deeper issues.
Methodology
We investigate the relationship between anisotropy (geometric distribution) and semantic isometry (how well geometry reflects meaning) through several approaches:
- Exploratory Bias Analysis: We isolated four specific biases—frequency (stopwords), subwords (token fragments), punctuation, and case (capitalization)—to observe their contribution to the "hypercone" effect.
- Pooling Comparison: We compared Average pooling, CLS tokens, and token-level representations to see how these choices affect isotropy and semantic accuracy.
- Model Comparison: We evaluated vanilla BERT (cased and uncased) against SimCSE, a contrastive learning model designed to improve sentence embeddings.
- Ablation (Bias Removal): We manually removed biased tokens (punctuation and stopwords) before pooling to measure the direct impact on semantic performance.
Key Insights: Biases as the Drivers of Anisotropy
Our analysis reveals that the "hypercone" is not a random geometric glitch but is constructed from non-semantic information. High-frequency stopwords and specific punctuation marks occupy distinct regions of the space, dragging the average of every sentence toward a common biased center.
As shown in Figure 6, punctuation tokens in vanilla BERT exhibit a significant peak at very high cosine similarity (~0.9), indicating they are highly clustered. This clustering contributes heavily to the overall anisotropy of the space. In contrast, SimCSE reduces this effect, distributing these tokens more broadly.
Furthermore, we identified a "Cased Paradox." BERT-base-cased is roughly 50% more anisotropic than the uncased version, yet it performs significantly better on semantic tasks. This directly contradicts the notion that anisotropy is the primary inhibitor of semantic performance.
Figure 4 illustrates how casing creates distinct clusters within the embedding space. The bimodal distribution for up_up pairs suggests that capitalized tokens occupy a specific sub-region, further driving the anisotropic nature of the model without necessarily destroying semantic relationships.
Results and Discussion
- The Anisotropy Myth: More isotropic does not mean more semantic. For instance, the
[CLS]token is more isotropic than average word embeddings but is significantly worse at capturing sentence meaning. - Bias Removal: Removing stopwords, punctuation, and subwords improved semantic correlation (STSB) in BERT's lower layers. However, it did not elevate vanilla BERT to the level of fine-tuned models like SimCSE, suggesting the presence of other latent biases.
- Anisotropy as a Symptom: We conclude that anisotropy and poor semantics are correlated only because they share underlying causes. Correcting anisotropy post-hoc (e.g., via "whitening") is a post-hoc fallacy; it alters the geometry without recovering lost semantic meaning.
Conclusion
Anisotropy is a symptom of data bias rather than the root cause of BERT's semantic limitations. While identifying biases like punctuation and casing helps explain the geometric distribution, future work must address "hidden" factors like positional bias. Developing training objectives that prevent non-semantic features from dominating the embedding space remains a critical challenge for the next generation of Transformer models.
Summary updated