In the field of Large Language Models (LLMs), a common assumption is that staying faithful to a model's original probability distribution yields the best results. However, the paper "Local and Global Decoding in Text Generation" challenges this notion. The researchers demonstrate that the "distortion" introduced by standard decoding methods like top-$k$ and nucleus sampling is not a mathematical flaw, but a critical feature that enables models to generate high-quality, human-like text.
The Problem of Local Renormalization
When an LLM generates text, it uses a decoding algorithm to sample tokens. Popular methods like top-$k$ (selecting from the top $k$ candidates) and top-$p$ (selecting from a set comprising $p\%$ of the probability mass) involve two steps: pruning low-probability tokens and renormalizing the remaining probabilities to sum to 1.0.
Currently, this renormalization happens locally at every step. This process mathematically distorts the model's original distribution. For example, if a model initially prefers sequence A over sequence B, local renormalization can inadvertently flip this preference, making sequence B more likely to be sampled.
Methodology: Defining Global Decoding
To investigate whether this distortion is beneficial, the authors introduced Global Decoding. This approach prunes the vocabulary locally but ensures the final probability of the entire generated string remains proportional to the model's original distribution.
Because calculating the global normalization constant is computationally intractable, the authors utilized Independent Metropolis-Hastings (IMH). In this setup, standard local decoding serves as a proposal distribution, followed by an accept-reject step that steers the output toward the globally normalized distribution.
Empirical Results
The researchers evaluated their approach using the Pythia model family (70M to 2.8B parameters) against the WebText dataset. They measured quality using MAUVE (similarity to human text) and diversity using Self-BLEU (where higher scores indicate more repetition).
The results were definitive: Local decoding outperformed global decoding across almost all metrics. Global decoding consistently produced text that was shorter, more repetitive, and lower in quality. As shown in the Self-BLEU analysis, global decoding (the green line) exhibits significantly higher repetition than local decoding (the blue line), particularly at lower sampling thresholds.
Why Local Decoding Wins
The paper identifies three primary reasons why the "distorted" local decoding is superior:
- The Probability-Quality Paradox: The most mathematically likely strings in a language model are often short, repetitive, or generic. Global decoding, by being more faithful to these raw probabilities, falls into these traps.
- The Length Bonus: Local normalization constants are typically $\ge 1$. When multiplied over a sequence, they act as a cumulative "bonus" that encourages longer, more complete sentences. Global decoding lacks this bias, leading to truncated outputs.
- Repetition Suppression: Language models are prone to high-probability loops (e.g., "I don't know, I don't know..."). Local renormalization effectively discounts these loops at each step, whereas global decoding does not, leading to the high Self-BLEU scores observed in the results.
Conclusion
The study concludes that local renormalization should not be viewed as a mathematical error to be corrected. Instead, it serves as a beneficial inductive bias that helps LLMs overcome inherent modeling weaknesses, such as the tendency toward repetition and short sequences. Future research in decoding should focus on understanding and refining these biases rather than striving for perfect global consistency.
Summary updated