NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Rare Tokens Degenerate All Tokens: Improving Neural Text Generation via Adaptive Gradient Gating for Rare Token Embeddings

Sangwon Yu, Jongyoon Song, Heeseung Kim, Seongmin Lee, Woo-Jong Ryu, Sungroh Yoon

Introduction: The Representation Degeneration Problem

Neural language models frequently encounter "representation degeneration," where word embeddings collapse into a narrow, anisotropic cone instead of being distributed uniformly across the embedding space. This lack of diversity in the vector space makes it difficult for models to distinguish between semantically distinct words, leading to repetitive and low-quality text generation.

Evolution of token embeddings during training, showing the collapse into a narrow cone.

While previous attempts to mitigate this issue relied on post-processing or global regularization, these methods often over-regularize frequent tokens. This paper investigates the root cause of this collapse during the training process itself.

Identifying the "Patient Zero": Rare Tokens

Through empirical study, the authors identified that rare tokens are the primary drivers of degeneration. These tokens degenerate first and subsequently drag the rest of the vocabulary into the narrow cone. By decomposing the gradient of the loss function for a rare token embedding ($w_r$), three distinct forces were identified:

  1. Target Attraction: Pulls the embedding toward the correct target feature vector.
  2. Frequent Token Repulsion: Pushes the embedding away from feature vectors of non-rare tokens.
  3. Rare Token Repulsion: Pushes the embedding away from feature vectors of other rare tokens.

The study revealed that the "push-away" force from frequent tokens dominates for rare tokens due to their low frequency, driving them into a corner of the vector space and initiating a chain reaction.

Adaptive Gradient Gating (AGG)

To address this, the authors proposed Adaptive Gradient Gating (AGG). This method dynamically manages embedding gradients without altering the underlying loss function:

  • Dynamic Rare Token Grouping: A "token counter memory" tracks token frequency in recent training batches to identify currently rare tokens.
  • Gradient Gating: A gate is applied to the gradients of rare tokens. It preserves the "attraction" force while scaling down the harmful "repulsion" forces based on the token's rarity. This prevents rare tokens from spiraling into anisotropy while leaving frequent tokens unaffected.

Key Insights: The Degenerative Chain Reaction

Degeneration is not a global failure from the start; it is a localized issue that spreads. The authors found that freezing rare token embeddings early in training actually improves the quality of frequent token representations.

Isotropy and cosine similarity dynamics during training, highlighting the impact of rare tokens.

Furthermore, AGG demonstrates synergy with other diversity-promoting techniques like Unlikelihood Training (UL), producing better results when combined than either method achieves individually.

Experimental Results

The authors evaluated AGG on WikiText-103 (Language Modeling), WMT14 English→German (Machine Translation), and various word similarity datasets.

  • Isotropy: On WikiText-103, AGG significantly improved the isotropy score ($I(W)$) from 0.377 to 0.813.
  • Semantic Quality: On the MEN dataset, Spearman correlation for word similarity jumped from 33.57 to 55.13, indicating much better semantic capture.
  • Generation Diversity: The number of unique tokens generated increased substantially, aligning more closely with human-like distributions.
  • Translation Performance: AGG achieved a 1.41 BLEU score improvement over a standard Transformer-Big baseline on WMT14 En-De.

Limitations and Future Work

Current limitations include the use of a simplified two-level rarity classification. Future research could explore more granular rarity scales. Additionally, while effective on standard Transformers, the dynamics in extremely large-scale models (100B+ parameters) require further investigation. The sensitivity to the rare token group size hyperparameter ($\alpha$) also remains a factor for careful tuning.

Summary updated

BibTeX
@inproceedings{yu2022rare,
  author = {Sangwon Yu and Jongyoon Song and Heeseung Kim and Seongmin Lee and Woo-Jong Ryu and Sungroh Yoon},
  title = {{Rare Tokens Degenerate All Tokens: Improving Neural Text Generation via Adaptive Gradient Gating for Rare Token Embeddings}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-long.3},
}
Figure