A Continuum of Generation Tasks for Investigating Length Bias and Degenerate Repetition

Darcey Riley, David Chiang

Introduction

In Natural Language Processing (NLP), different generation tasks are plagued by distinct "pathologies." Machine Translation (MT) models frequently exhibit length bias, producing translations shorter than the reference. Conversely, open-ended story generation often suffers from degenerate repetition, where the model enters an infinite loop.

Previous hypotheses suggested these issues stem from task constrainedness—the number of valid outputs for a given input. MT is highly constrained, while story generation is not. However, directly comparing these tasks is difficult due to differences in architectures and datasets. This research introduces a framework to isolate constrainedness and investigate its role as the root cause of these behaviors.

Methodology: The Source Truncation Knob

To study the effects of constrainedness in a controlled environment, the authors propose Source Truncation. Starting with a standard MT setup, they systematically truncate the source sentence to a percentage ($s$) of its original length.

Example of source truncation ($s$) creating a continuum from unconditioned generation to standard machine translation.

As shown in the figure above, at $s=100$, the task is standard MT. At $s=0$, the model receives no input, effectively becoming an Unconditioned Generation (UCG) model. This creates a smooth continuum of tasks. The study uses Transformer models trained on IWSLT 2017 German-to-English (de-en) and Chinese-to-English (zh-en) datasets.

Key Insights

The experimental framework revealed several critical properties of generation models:

  1. Repetition and Constraints: Degenerate repetition (internal looping) increases as the source sentence becomes shorter. This confirms that models require input "guidance" to avoid looping.
  2. The Length Bias Paradox: Length bias actually worsens as tasks become less constrained. This phenomenon is often overlooked in open-ended generation because researchers typically avoid beam search, the primary driver of this bias.
  3. Mode vs. Distribution: Pathologies primarily appear during mode-seeking decoding (like beam search). Random sampling from the same models does not exhibit significant length bias or repetition, suggesting the underlying probability distribution is healthy, but the "peaks" (modes) are problematic.
  4. Entropy is Not the Root Cause: Experiments with label smoothing showed that while entropy can be manipulated, it does not resolve repetition or length bias, indicating the problem lies deeper than the flatness of the distribution.

Results and Analysis

The researchers measured various metrics across the continuum of $s$ values to understand how the model's internal state changes with constrainedness.

Trends in entropy, total probability mass, and unique samples as task constrainedness increases.

As task constrainedness increases (higher $s$):

  • Entropy (a) decreases, as the model becomes more certain of the output given more input context.
  • Total probability mass (b) of the generated sequences increases, particularly for the German-English model, indicating that the model's "peaks" become more prominent.
  • Unique samples (c) decrease as the task becomes more constrained, as the model's output distribution narrows around a few valid translations.

In terms of length, pure MT ($s=100$) using beam search (size 4) yielded a length ratio of ~0.9. At $s=10$, this ratio dropped to ~0.6, meaning generated sentences were nearly half the expected length. Interestingly, greedy search ($k=1$) tended to produce sentences that were too long in unconstrained tasks, while beam search ($k>1$) produced sentences that were too short.

Conclusion

This work demonstrates that task constrainedness is a primary factor in generation pathologies. While repetition is a direct byproduct of low constraint, length bias is a more pervasive issue that intensifies in open-ended tasks. Future research should focus on developing decoding strategies or architectural modifications that can navigate high-probability regions without falling into these traps.

Summary updated

BibTeX
@inproceedings{riley2022continuum,
  author = {Darcey Riley and David Chiang},
  title = {{A Continuum of Generation Tasks for Investigating Length Bias and Degenerate Repetition}},
  booktitle = {BlackboxNLP @ EMNLP},
  year = {2022},
  url = {https://openreview.net/forum?id=sTf-Ys1wE6d},
}
Figure