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, Seong-min Lee, Woo-Jong Ryu, Sungroh Yoon · DOI

Abstract

Recent studies have determined that the learned token embeddings of large-scale neural language models are degenerated to be anisotropic with a narrow-cone shape. This phenomenon, called the representation degeneration problem, facilitates an increase in the overall similarity between token embeddings that negatively affect the performance of the models. Although the existing methods that address the degeneration problem based on observations of the phenomenon triggered by the problem improves the performance of the text generation, the training dynamics of token embeddings behind the degeneration problem are still not explored. In this study, we analyze the training dynamics of the token embeddings focusing on rare token embedding. We demonstrate that the specific part of the gradient for rare token embeddings is the key cause of the degeneration problem for all tokens during training stage. Based on the analysis, we propose a novel method called, adaptive gradient gating (AGG). AGG addresses the degeneration problem by gating the specific part of the gradient for rare token embeddings. Experimental results from language modeling, word similarity, and machine translation tasks quantitatively and qualitatively verify the effectiveness of AGG.

Introduction

Large-scale neural language models often struggle with producing repetitive or generic text. This issue is frequently linked to the representation degeneration problem, where token embeddings—the mathematical vectors representing words—collapse into a narrow, directional cone (anisotropy) instead of spreading out evenly (isotropy). When embeddings are too similar, the model fails to capture unique semantic relationships, leading to "boring" text generation.

While previous research has identified this "narrow cone" shape, most solutions have focused on post-processing symptoms. This paper investigates the root cause: the training dynamics of rare tokens.

The Dynamics of Representation Degeneration

The authors conducted an empirical study of training dynamics and discovered that rare tokens are the primary trigger for embedding collapse. Visualization using SVD projection reveals that rare tokens degenerate first, dragging medium and frequent tokens into the same degenerate space as training progresses.

Evolution of token embedding distributions over training steps, illustrating the transition from isotropy to a degenerate narrow-cone shape.

The mathematical cause lies in the negative log-likelihood loss, which generates a gradient that aggressively pushes rare tokens away from non-rare targets. Because rare tokens appear infrequently, they are constantly "pushed away" but rarely "pulled toward" meaningful semantic targets, eventually poisoning the entire embedding space.

Adaptive Gradient Gating (AGG)

To address this, the authors propose Adaptive Gradient Gating (AGG). This method selectively throttles the gradients that push rare tokens into degenerate zones without muting useful learning signals. AGG consists of two main components:

  1. Dynamic Rare Token Grouping: A "token counter memory" tracks token frequency within mini-batches, allowing the model to adapt to fluctuating "rarity" during training.
  2. Gradient Gating: The gradient is mathematically decomposed, and a "gate" (a multiplier between 0 and 1) is applied to the specific "pushing" components for rare tokens.

Experimental Evaluation

The effectiveness of AGG was verified across language modeling (WikiText-103), word similarity, and machine translation (WMT14 En-De) tasks. A key insight from the pilot experiments was that simply freezing rare token embeddings for a period prevents the initial collapse of the frequent token space.

Training dynamics of isotropy I(W) and cosine similarity when rare token embeddings are frozen until step 18k.

Key results include:

  • Isotropy Boost: On WikiText-103, the isotropy metric $I(W)$ increased from 0.377 to 0.813.
  • Rare Word Learning: Perplexity (PPL) for rare tokens dropped from 438.67 to 75.39.
  • Semantic Accuracy: Word similarity scores nearly doubled on some datasets (e.g., RG65 correlation rose from 35.48 to 65.45).
  • Translation Gains: AGG achieved a BLEU score of 29.81 on WMT14 En-De, outperforming standard Transformers and other regularization methods.

Conclusion

By identifying rare tokens as the catalyst for representation degeneration, this work provides a more fundamental solution to text generation issues. AGG effectively maintains embedding isotropy, leading to richer semantic representations and more diverse text generation. Future work may explore continuous, multi-level gating strategies to further refine the balance between learning and stability for tokens of varying frequencies.

Summary updated

BibTeX
@inproceedings{yu2022rare,
  author = {Sangwon Yu and Jongyoon Song and Heeseung Kim and Seong-min 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