Mode recovery in neural autoregressive sequence modeling

Ilia Kulikov, Sean Welleck, Kyunghyun Cho

Abstract

Neural autoregressive models often exhibit pathological behaviors, such as generating infinite loops or empty sequences. This paper introduces a "learning chain" framework and a new metric, mode recovery cost, to identify where these failures occur—whether during data collection, training, or decoding. Using a tractable synthetic testbed, the authors demonstrate that mode recovery is most challenging for semi-structured data and that while training can improve upon empirical data in structured settings, decoding remains a significant bottleneck.

Introduction

Modern AI models for text are typically autoregressive, predicting the next token based on previous ones. Despite their success, they frequently suffer from quirks like hallucinations or repetitive loops. It is often unclear whether these issues stem from the decoding algorithm, the training objective, or the data itself. This paper diagnoses these failures by tracking how the modes (the most likely sequences) of a distribution are preserved or lost across the modeling pipeline.

The Learning Chain Framework

The authors define a four-stage learning chain:

  1. Ground-truth ($p^*$): The "true" distribution of data.
  2. Empirical ($p_{emp}$): The distribution represented by the finite dataset collected.
  3. Learned ($p_{model}$): The distribution captured by the neural network after training.
  4. Decoding-induced ($p_{\mathcal{F}}$): The distribution resulting from the specific generation algorithm (e.g., beam search).

To measure success, they propose Mode Recovery Cost ($O_k$): the number of top sequences from a target distribution one must check to find all of the top $k$ sequences from a source distribution.

Experimental Setup

The authors designed a synthetic testbed with a vocabulary of 7 tokens and a maximum length of 10 (~12 million possible sequences). They evaluated three ground-truth distributions:

  • Structured ($\alpha=1.0$): Generated by an LSTM (mimicking grammar).
  • Unstructured ($\alpha=0.0$): Random probabilities (mimicking noise).
  • Semi-structured ($\alpha=0.3$): A product of the two, resembling real human language.

Key Results

Data Collection as the First Failure

Mode recovery is hardest when data contains a mix of patterns and random exceptions. Even before training, the act of sampling a finite dataset ($p_{emp}$) introduces significant costs. As shown in Figure 2, increasing the training set size ($N_{train}$) reduces the recovery cost, but the semi-structured distribution remains orders of magnitude more expensive to recover than the others.

Mode recovery cost from ground-truth to empirical distribution as a function of training set size.

Training as a Mode Filter

If the model architecture matches the ground truth's structure, training can actually improve mode recovery compared to the raw dataset. This is measured by the log-rate reduction. In the structured case ($\alpha=1.0$), the learned model often achieves a positive reduction, indicating it is better at identifying likely sequences than the noisy dataset it was trained on (see Figure 3).

Log-rate reduction comparing model recovery to empirical recovery across different values of k.

Decoding Bottlenecks

In the final stage, both beam search and ancestral sampling fail to recover the modes of the learned model as $k$ increases. However, beam search is significantly more efficient at finding the distribution's peaks, confirming that sampling is often a poor choice for mode recovery.

Conclusion

The learning chain framework provides a systematic way to pinpoint where autoregressive models fail. Future work includes scaling these metrics to real-world datasets and exploring how different architectures and techniques like knowledge distillation affect mode recovery.

Summary updated

BibTeX
@inproceedings{kulikov2021mode,
  author = {Ilia Kulikov and Sean Welleck and Kyunghyun Cho},
  title = {{Mode recovery in neural autoregressive sequence modeling}},
  booktitle = {SPNLP @ ACL},
  year = {2021},
  doi = {10.18653/v1/2021.spnlp-1.5},
}
Figure