In neural language modeling, high-dimensional vector spaces are expected to distribute token and sequence representations uniformly across their ambient dimensions. A space that utilizes all available geometric directions provides maximal representational capacity, allowing subtle semantic and syntactic differences between tokens to be resolved cleanly.
Empirical analysis across architectures from BERT and GPT-2 to modern frontier foundation models reveals the opposite behavior: learned token and sequence embeddings collapse into a narrow, low-dimensional cone. In this degenerate geometry, known as representation degeneration or embedding anisotropy, the majority of vectors point in virtually identical directions, causing pairwise cosine similarities between completely unrelated tokens to exceed 0.80 or approach 0.99 in upper layers.
This geometric collapse degrades text generation diversity, skews likelihood estimates for rare tokens, and impairs semantic retrieval in dense vector pipelines. Understanding why anisotropy arises from cross-entropy loss dynamics, how it propagates through transformer layers, and how post-processing and training regularizers resolve it is foundational to modern representation learning.

Defining Isotropy, Anisotropy, and Representation Degeneration
A vector distribution in -dimensional space is isotropic if its directional variance is uniformly distributed across all basis vectors on the unit hypersphere . For a normalized dataset of embeddings where :
- Isotropic expectation: The mean vector , and the covariance matrix . Under strict isotropy, the expected cosine similarity between two randomly chosen independent vectors and () is zero:
- Anisotropic reality: The distribution exhibits a massive directional bias. The mean vector has a large norm (), and the covariance matrix is dominated by a tiny fraction of its eigenvalues. The expected random pairwise cosine similarity is strictly positive and often close to unity:
Representation degeneration, formulated formally by Gao et al. (2019), describes this specific pathology where learned word embeddings and hidden states concentrate in a narrow cone centered around a shared direction vector, severely contracting the effective dimensionality of the representation space.
The Mathematical Mechanics of Representation Degeneration
Representation degeneration is not an incidental training artifact; it is an intrinsic consequence of optimizing standard cross-entropy loss with maximum likelihood estimation (MLE) over imbalanced natural language vocabularies.
1. The Cross-Entropy Push-Pull Dynamics
In standard autoregressive language modeling, given a context hidden state at step , the probability of predicting token from vocabulary is parameterized by a pre-softmax unembedding matrix with token vectors :
The cross-entropy loss for the ground-truth token at step is:
Computing the gradients of with respect to the target embedding and non-target embeddings () illustrates the directional forces:
When updating the parameters with gradient descent (step size ):
- Target token : The embedding is pushed in the direction of the hidden state .
- All non-target tokens (): Every other token in the entire vocabulary is pushed in the opposite direction, , with a force proportional to its current predicted probability .
2. Zipf's Law and Vocabulary Imbalance
Natural language follows a heavy-tailed Zipfian distribution. A small number of frequent words (punctuation, determiners, conjunctions) account for the vast majority of target occurrences, while the long tail of vocabulary words appears infrequently.
For a rare or moderately frequent word :
- It is selected as the ground truth token only a negligible fraction of the time.
- It serves as a non-target token on almost every single training step across the entire dataset.
Consequently, the cumulative gradient updates for are dominated by negative updates:
Because the probabilities are strictly positive, is driven into the negative cone generated by the convex hull of the hidden states .
3. The Convex Hull Theorem
Gao et al. (2019) established that if there exists a subset of tokens that never appear (or rarely appear) in a training partition, minimizing the training loss forces their embeddings to lie within the intersection of negative half-spaces defined by all contextual hidden states:
where is the convex hull of hidden states. As the training set grows, the convex hull expands, causing the dual negative cone to shrink. All rare and tail tokens are compressed into this vanishingly narrow directional cone.
Layer-Wise Propagation Across Transformers
Anisotropy is not limited to input and output embedding matrices; it compounds throughout the depth of transformer networks.
In a landmark empirical study, Ethayarajh (2019) analyzed the layer-by-layer geometry of BERT, ELMo, and GPT-2, measuring the average cosine similarity between randomly sampled words across different layers:
- Input Layers: Embeddings start with moderate directional diversity (average cosine similarity between 0.15 and 0.35).
- Intermediate Layers: Self-attention layers contextualize representations by mixing token embeddings with attention-weighted sums of surrounding tokens, pulling representations toward common subspace directions.
- Top Layers: In autoregressive models like GPT-2, the average cosine similarity of random word pairs reached 0.95 to 0.99 in the final layer. Two entirely unrelated words sampled from distinct contexts were nearly collinear.
This phenomenon explains why contextualized word representations exhibit high intra-sentence similarity and low self-similarity across contexts after adjusting for anisotropy: upper layers become dominated by static positional and grammatical bias vectors that dwarf token-specific semantic components.
Measuring Representation Degeneration and Anisotropy
Several formal metrics quantify the severity of representation collapse in deep models:
1. Average Pairwise Cosine Similarity
The simplest direct measure of directional concentration is the empirical mean cosine similarity across randomly sampled vector pairs:
In a fully isotropic space, . In severely anisotropic spaces, .
2. Singular Value Spectrum and Spectral Decay
Let be the centered matrix of hidden representations, with singular value decomposition , where are the singular values.
In anisotropic representations:
- The first singular value is disproportionately large compared to subsequent values ().
- The first 1 to 3 principal components account for over 50% to 80% of total variance.
- The singular values decay exponentially rather than exhibiting a flat, uniform spectrum.
3. Effective Rank ()
Effective rank measures how many orthogonal dimensions are actively utilized by the representation matrix:
For an embedding dimension of :
- An isotropic representation utilizes nearly all dimensions ().
- A degenerated representation collapses to a low-dimensional manifold ().
Downstream Consequences on Model Performance
Embedding anisotropy introduces critical failure modes across NLP and LLM workloads:
- Cosine Similarity Distortion:
In dense retrieval, vector search algorithms (HNSW, Flat IP, IVF) rely on cosine similarity or dot products. When all vectors share a large constant offset component , the cosine metric is dominated by , compressing the dynamic range of semantic similarity scores into a tiny band (e.g., [0.82, 0.88]). Minor semantic variations are masked by directional noise.
- Repetition and Degenerate Text Generation:
In autoregressive generation, narrow cone geometries in the unembedding matrix mean that multiple candidate tokens produce nearly identical logits for a given hidden state. When temperature sampling or greedy decoding is applied, the model struggles to sharply separate contextually appropriate tokens from generic, high-frequency tokens, promoting repetitive loops.
- Poor Zero-Shot Sentence Transfer:
Averaging unadjusted token embeddings from BERT or RoBERTa produces poor sentence representations for Semantic Textual Similarity (STS) benchmarks, often performing worse than simple GloVe averaging unless isotropy is restored.
Algorithmic and Architectural Mitigations
Several distinct techniques have been developed to counteract representation degeneration, ranging from post-processing transforms to loss regularizers and contrastive objectives.
1. Post-Processing: Centering and Whitening
For frozen, pre-trained models, post-processing can restore isotropy without retraining:
- Mean Centering: Subtract the global empirical mean :
This eliminates the shared bias direction that shifts all vectors into a positive orthant.
- BERT-Whitening (Su et al., 2021): Transforms representations to have zero mean and an identity covariance matrix:
Here, is the eigendecomposition of the covariance matrix. Whitening equalizes variance across all directions, directly boosting STS benchmark scores by 10 to 30 percentage points over raw averaged embeddings.
2. Regularization: Cosine Spectrum Control
During pre-training, Gao et al. (2019) proposed Cosine Spectrum Control, which adds an explicit regularization penalty to prevent singular value collapse in the embedding matrix :
Alternatively, Wang et al. (2020) proposed singular value regularization to penalize the ratio , ensuring that energy remains distributed across higher-order singular components during training.
3. Contrastive Learning: SimCSE and InfoNCE Alignment
Gao, Yao, & Chen (2021) demonstrated that unsupervised contrastive learning (SimCSE) directly solves anisotropy by optimizing the InfoNCE loss:
Wang and Isola (2020) showed that InfoNCE optimizes two competing geometric properties:
- Alignment: Pulls semantically identical pairs () close together.
- Uniformity: Pushes all negative pairs () apart, asymptotically forcing the embedding distribution to match a uniform distribution on the unit hypersphere .
Unsupervised SimCSE uses standard dropout masks inside the transformer encoder as data augmentation, completely eliminating anisotropy in sentence embeddings and establishing high semantic discriminability.
4. Architectural Adjustments
Modern large language models employ architectural patterns that reduce degeneration:
- Untied Input and Output Embeddings: Decoupling the input embedding matrix from the output projection head prevents gradient conflicts between vocabulary input lookups and softmax target classification.
- Pre-LayerNorm and RMSNorm: Applying normalization immediately before each attention and MLP block stabilizes activation magnitudes, preventing the runaway growth of dominant directional components.
- Rotational Coordinate Invariance (QuaRot / SpinQuant): Randomized orthogonal rotations (, where ) preserve inner products and cosine distances while scattering anisotropic outlier channels across all coordinates, facilitating outlier-free low-bit quantization.
Comparison of Anisotropy Mitigation Strategies
Evaluating the primary approaches across key operational parameters:
- Mean Centering:
- Operational Stage: Post-processing (Inference only)
- Compute Overhead: Negligible ( per vector)
- Training Required: No
- Primary Mechanism: Subtracts global centroid vector
- Limitations: Does not equalize non-uniform variance across orthogonal dimensions
- BERT-Whitening (ZCA / SVD):
- Operational Stage: Post-processing (Inference only)
- Compute Overhead: Very low ( projection)
- Training Required: No
- Primary Mechanism: Linearly transforms covariance matrix to identity
- Limitations: Sensitive to estimation noise in covariance matrices of out-of-domain data
- Cosine Spectrum Control:
- Operational Stage: Pre-training / Fine-tuning
- Compute Overhead: Moderate (pairwise comparisons or mini-batch SVD)
- Training Required: Yes
- Primary Mechanism: Penalizes high cosine similarity or steep singular value decay
- Limitations: Requires hyperparameter tuning of regularization weight and threshold
- Contrastive Learning (SimCSE / InfoNCE):
- Operational Stage: Post-training / Continual Fine-tuning
- Compute Overhead: Moderate ( batch contrastive loss)
- Training Required: Yes
- Primary Mechanism: Explicitly optimizes hyperspherical uniformity and alignment
- Limitations: Requires dedicated contrastive fine-tuning pass on unlabelled or paired text
- Untied Embeddings and RMSNorm:
- Operational Stage: Model Architecture Pre-training
- Compute Overhead: Negligible during training; slight parameter increase
- Training Required: Yes (Pre-training architecture design)
- Primary Mechanism: Decouples input/output gradient dynamics and normalizes residual streams
- Limitations: Must be specified prior to model pre-training
Sources
- Gao, J., He, D., Tan, X., Qin, T., Wang, L., & Liu, T. Y. (2019). Representation Degeneration Problem in Training Natural Language Generation Models. International Conference on Learning Representations (ICLR).
- Ethayarajh, K. (2019). How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddings. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP).
- Wang, L., Huang, J., Huang, K., Hu, Z., Wang, G., & Gu, Q. (2020). Improving Neural Language Generation with Spectrum Control. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (ACL).
- Su, J., Cao, J., Liu, W., & Ou, Y. (2021). Whitening Sentence Representations for Better Semantic Vector Space. arXiv preprint arXiv:2103.15316.
- Gao, T., Yao, X., & Chen, D. (2021). SimCSE: Simple Contrastive Learning of Sentence Embeddings. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP).
- Li, B., Zhou, H., He, J., Wang, M., Yang, Y., & Li, L. (2020). On the Sentence Embeddings from Pre-trained Language Models. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP).
- Wang, T., & Isola, P. (2020). Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere. International Conference on Machine Learning (ICML).



