[Paper Review] Consistency of a Recurrent Language Model With Respect to Incomplete Decoding
This paper identifies and resolves inconsistency in recurrent language models during incomplete decoding, where decoding algorithms like beam search or nucleus sampling can generate infinite-length sequences with zero probability under the model. The authors propose consistent sampling variants and a self-terminating model architecture that guarantee finite outputs, empirically showing reduced non-termination in GPT-2 while maintaining strong language modeling quality.
Despite strong performance on a variety of tasks, neural sequence models trained with maximum likelihood have been shown to exhibit issues such as length bias and degenerate repetition. We study the related issue of receiving infinite-length sequences from a recurrent language model when using common decoding algorithms. To analyze this issue, we first define inconsistency of a decoding algorithm, meaning that the algorithm can yield an infinite-length sequence that has zero probability under the model. We prove that commonly used incomplete decoding algorithms - greedy search, beam search, top-k sampling, and nucleus sampling - are inconsistent, despite the fact that recurrent language models are trained to produce sequences of finite length. Based on these insights, we propose two remedies which address inconsistency: consistent variants of top-k and nucleus sampling, and a self-terminating recurrent language model. Empirical results show that inconsistency occurs in practice, and that the proposed methods prevent inconsistency.
Motivation & Objective
- To formalize the inconsistency between a recurrent language model's probability distribution and the distribution induced by incomplete decoding algorithms.
- To identify why commonly used decoding methods—greedy search, beam search, top-k sampling, and nucleus sampling—can produce infinite-length sequences with zero probability under the model.
- To develop practical remedies that ensure decoding produces only finite, valid sequences.
- To empirically validate that inconsistency occurs in practice with standard models like GPT-2.
- To explore whether sequence-level learning could mitigate inconsistency at training time.
Proposed method
- Define a recurrent language model as an autoregressive neural network that computes conditional probabilities over a finite vocabulary, including a special <eos> token for sequence termination.
- Formalize decoding algorithms as functions that induce a distribution over sequences based on the model and context, and define 'inconsistency' as the generation of infinite-length sequences with zero probability under the model.
- Prove that incomplete decoding algorithms—those that exclude certain tokens at each step—induce inconsistent distributions, even when the model itself is consistent.
- Propose consistent variants of top-k and nucleus sampling by ensuring the <eos> token is never excluded from the candidate set during decoding.
- Introduce a self-terminating recurrent language model that reparameterizes the output layer so that the <eos> token is always ranked highly, guaranteeing termination under any incomplete decoding strategy.
- Evaluate the methods on the Wikitext-103 dataset using greedy decoding, measuring non-termination ratio and perplexity to assess consistency and generation quality.
Experimental results
Research questions
- RQ1Can decoding algorithms like beam search or nucleus sampling produce infinite-length sequences that have zero probability under a recurrent language model?
- RQ2Why do commonly used decoding methods lead to inconsistency despite the model being trained to generate finite sequences?
- RQ3Can consistent sampling variants be designed to ensure the <eos> token is never excluded during decoding?
- RQ4Can a self-terminating model architecture be constructed to guarantee finite outputs under any incomplete decoding algorithm?
- RQ5Does inconsistency manifest in practice with real-world models like fine-tuned GPT-2?
Key findings
- The non-termination ratio for standard GPT-2-117M on Wikitext-103 was 37.91% under greedy decoding with a 500-token limit, indicating significant inconsistency in practice.
- The self-terminating GPT-2 variant achieved a non-termination ratio of 0.00%, completely eliminating infinite generations while maintaining reasonable generation quality.
- The perplexity of the self-terminating model increased from 20.92 to 27.25, indicating a small trade-off in language modeling quality for improved consistency.
- Consistent sampling variants prevent the generation of infinite sequences by ensuring the <eos> token is always included in the candidate set during decoding.
- The length distribution of continuations from the self-terminating model shifted toward shorter, more realistic sequence lengths, aligning better with the ground-truth data distribution.
- Empirical results confirm that inconsistency is not just a theoretical concern but a practical issue in deployed decoding pipelines.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.