TL;DR
Neural text generation models often produce repetitive and dull text due to the standard Maximum Likelihood Estimation (MLE) training objective. This paper introduces ScaleGrad, a novel training method that directly modifies the gradient of the loss function to encourage the use of novel tokens, significantly improving text generation quality in both open-ended and directed tasks.
What Problem Does This Paper Address?
Modern neural language models excel at many text generation tasks, but a persistent issue is "degeneration," where models produce repetitive, generic, or even nonsensical text. This problem is particularly evident in open-ended generation (like story writing or dialogue) but also affects directed tasks like summarization and image captioning. The prevalent training objective, Maximum Likelihood Estimation (MLE), which aims to maximize the probability of the ground truth sequence, is implicated. MLE encourages models to favor high-frequency tokens, leading to a lack of diversity and creativity in generated outputs. While existing methods like unlikelihood training and various decoding strategies (e.g., top-k, nucleus sampling) offer partial solutions, they either don't fully address the underlying modeling issue or are less effective in directed generation tasks.
Methods
The core contribution of this paper is ScaleGrad, a new training objective that directly manipulates the gradient of the loss function. Instead of altering the model architecture or adding auxiliary losses, ScaleGrad modifies how the model learns from the loss signal.
The key idea is to dynamically adjust the gradient based on whether the target token is "novel" (i.e., has not appeared in the generated sequence so far) or "non-novel." At each decoding step during training, ScaleGrad re-normalizes the probability distribution over the vocabulary. This re-normalization is designed to:
- Increase the gradient magnitude for novel target tokens: This forces the model to assign a higher probability to these novel tokens to reduce the gradient and move towards a local minimum.
- Decrease the gradient magnitude for non-novel target tokens: This encourages the model to assign lower probabilities to these tokens.
This is achieved by introducing a hyperparameter $\gamma \in (0, 1)$ that controls the degree to which novel tokens are encouraged. The method is architecturally simple and can be integrated into existing auto-regressive generation models.
Datasets
The paper evaluates ScaleGrad on several standard datasets:
- Wikitext-103: Used for language modeling and auto-completion tasks.
- Penn TreeBank (PTB): Used for language modeling and auto-completion.
- IMDB movie reviews: Used for open-ended generation.
- CNN/DM and NYT50: Used for abstractive text summarization.
- Visual Genome: Used for image paragraph captioning.
Key Insights and Ideas
- Gradient manipulation is a powerful tool: The paper demonstrates that directly modifying the gradient signal, rather than just the loss function itself, can effectively steer model behavior towards desired outcomes like generating novel tokens.
- Novelty as a key to quality: By explicitly encouraging the model to use tokens it hasn't seen before in the current generation, ScaleGrad combats the tendency towards repetition and generic output.
- Universality of the approach: ScaleGrad's gradient-based nature makes it a general training objective applicable to various neural text generation architectures (LSTM, Transformer) and tasks (open-ended and directed).
- Simplicity and effectiveness: The method is architecturally simple, requiring no complex components, yet achieves significant improvements over standard MLE and even competitive methods like unlikelihood training.
- Trade-off between quality and diversity: The hyperparameter $\gamma$ allows for tuning the balance between generation quality (e.g., perplexity) and diversity (e.g., unique tokens, repetition reduction).
Key Results
- Open-ended generation: ScaleGrad consistently improved metrics like repetition ratios (Rep/16, Rep/32, Rep/128) and unique word counts (uniq-w) on Wikitext-103 and PTB datasets, often outperforming MLE and unlikelihood training. For example, on Wikitext-103, ScaleGrad achieved a 19.7% reduction in Rep/128 compared to MLE and a 4.1% reduction compared to unlikelihood training, while also increasing unique words by 32% over MLE.
- Directed generation (Image Captioning): ScaleGrad significantly improved CIDEr scores, a key metric for image captioning, outperforming MLE and unlikelihood training, even when combined with tri-gram blocking.
- Directed generation (Text Summarization): ScaleGrad achieved better ROUGE scores on CNN/DM and improved all metrics on NYT50 compared to MLE and unlikelihood training.
- Human Evaluation: A user study showed that texts generated by ScaleGrad were preferred by human evaluators in a majority of cases compared to MLE and unlikelihood training.
Limitations and Future Work
- Hyperparameter sensitivity: While ScaleGrad introduces only one hyperparameter ($\gamma$), its optimal value might vary across tasks and datasets, requiring careful tuning. The paper explores this sensitivity, showing that smaller $\gamma$ values push more for novelty, potentially increasing perplexity.
- Future Work:
- Repurposing the novel token set: The authors suggest extending the concept of the "novel token set" to achieve other objectives beyond just novelty, potentially for tasks like automatic speech recognition.
- Dynamic hyperparameter adjustment: Investigating mechanisms to dynamically adjust $\gamma$ during decoding based on the context could further enhance generation quality.
Summary updated