Abstract
Neural text generation often suffers from "text degeneration," where models produce repetitive and generic language. This behavior stems from the inherent bias in standard Maximum Likelihood Estimation (MLE) toward high-frequency words, as dictated by Zipf’s Law. We present F^2-Softmax, a frequency-factorized softmax approach that decomposes next-token prediction into frequency class selection and intra-class token selection. Coupled with MefMax, a novel grouping algorithm that balances frequency mass across classes, our method significantly enhances vocabulary diversity and distributional accuracy. Evaluations on Wikitext-103 and a new Korean lyrics dataset (Melo-Lyrics) demonstrate that F^2-Softmax generates text that closely matches human-level diversity without compromising quality.
Introduction: The Challenge of Text Degeneration
A persistent issue in AI-driven text generation is the tendency for models to become "stuck in a loop" or rely on a narrow set of common words. This phenomenon, known as text degeneration, is largely a byproduct of the Zipfian distribution of human language. A small number of tokens (e.g., "the", "and", "of") appear with extreme frequency, while the vast majority of "flavorful" or descriptive words are rare.
When trained using standard Maximum Likelihood Estimation (MLE), models naturally optimize for these high-frequency "majority classes." Consequently, they "play it safe" during inference, overproducing common words and failing to utilize the rich, rare vocabulary that characterizes human communication.
Methodology
To address this imbalance, we propose a two-stage framework consisting of vocabulary re-balancing and factorized prediction.
MefMax: Mean Efficiency Maximization
MefMax is a greedy algorithm designed to group the vocabulary into "frequency classes" ($C_1, C_2, \dots, C_n$). Unlike traditional methods that create equal-sized buckets, MefMax maximizes "Normalized Entropy" (Efficiency) to ensure each class represents a similar total frequency mass. This creates a more uniform learning objective, making rare words as "visible" to the model as common ones during the optimization process.
F^2-Softmax: Frequency Factorized Softmax
During training and inference, the model factorizes the probability of the next token. Instead of a single large softmax over the entire vocabulary, the model predicts:
- Frequency Class Prediction: The probability that the next word belongs to a specific frequency class.
- Token Prediction: The probability of a specific token within that predicted class.
This decomposition forces the model to learn more uniform probability distributions within narrowed, balanced subsets. At inference time, Decoupled Decoding is employed, where the model first selects a frequency class and then samples a token from it.
Experimental Setup
The proposed method was evaluated on two distinct benchmarks:
- Wikitext-103: A large-scale English dataset of Wikipedia articles.
- Melo-Lyrics: A new dataset of Korean song lyrics, which presents a unique challenge due to the mix of repetitive structures (choruses) and creative, rhythmic vocabulary.
Key Results
F^2-Softmax consistently outperforms standard MLE across multiple diversity metrics:
- Vocabulary Richness: On Wikitext-103, F^2-Softmax utilized 15.7k unique tokens, nearly doubling the MLE baseline (8.48k) and even slightly exceeding the human gold standard (15.2k).
- Distributional Accuracy: The KL-Divergence between the model's word distribution and the ground truth decreased by approximately 60% compared to MLE.
- Qualitative Improvements: Generated samples show a higher frequency of descriptive, non-pronoun rare words (e.g., "eccentric," "vanished") compared to baseline models that tend to repeat common pronouns or generic terms.
Discussion and Future Work
While F^2-Softmax significantly improves stochastic (sampling-based) decoding, its impact on deterministic decoding (e.g., greedy search) is less pronounced. The "argmax" operation in greedy search may inherently conflict with the nearly even class distributions produced by our method.
Future research will focus on bridging the "vocabulary mismatch" encountered when applying F^2-Softmax to pre-trained models during fine-tuning, as well as exploring its application in broader transfer learning contexts.
Summary updated