Abstract
Neural language models are a critical component of state-of-the-art systems for machine translation, summarization, audio transcription, and other tasks. These language models are almost universally autoregressive in nature, generating sentences one token at a time from left to right. This paper studies the influence of token generation order on model quality via a novel two-pass language model that produces partially-filled sentence "templates" and then fills in missing tokens. We compare various strategies for structuring these two passes and observe a surprisingly large variation in model quality. We find the most effective strategy generates function words in the first pass followed by content words in the second. We believe these experimental results justify a more extensive investigation of generation order for neural language models.
Introduction
Modern language modeling is dominated by the left-to-right autoregressive paradigm. While this approach is computationally efficient and aligns with how humans read, it may not be the most optimal way for a model to construct a sentence. Humans often conceptualize a sentence's structure or core meaning before finalizing specific word choices. This research investigates whether moving away from rigid left-to-right generation toward alternative orderings can improve model performance.
Methodology
The researchers developed a two-pass Transformer framework to isolate generation order as a variable. The process involves partitioning the vocabulary into two sets and generating the sentence in two distinct stages:
- Pass 1 (The Template): The model generates a sequence containing only tokens from the first set in their correct positions, using placeholders for all other tokens.
- Pass 2 (The Fill-in): An encoder-decoder model takes the template and predicts the missing tokens.
This deterministic decomposition allows for exact log-probability calculations, enabling direct comparisons with standard models. Five strategies were tested: Common First, Rare First, Function First, Content First, and a control strategy called Odd First (based on vocabulary index parity).
Experimental Setup
Models were evaluated on the One Billion Word Language Modeling benchmark (LM1B). The researchers used a vocabulary of 65,536 whole words to avoid the complexities of sub-word units while focusing on the impact of linguistic roles and word frequency on generation order.
Results
The experimental results demonstrate that generation order is a critical factor in model quality. Performance varied significantly across strategies, as shown in the quantitative analysis below.
The "Function First" strategy emerged as the most effective two-pass approach, achieving a test perplexity of 40.085. This significantly outperformed the "Odd First" control (45.196) and the standard baseline (41.721). While it did not surpass the "Enhanced Baseline"—a standard model with a larger parameter count to match the two-pass architecture—it proved that a linguistically informed order is vastly superior to arbitrary or content-heavy splits.
Discussion
The success of the "Function First" model supports the "Syntactic Scaffold" hypothesis. By generating structural elements (prepositions, articles, auxiliary verbs) first, the model establishes a global context that simplifies the task of filling in specific content words. This "delaying of commitment" prevents the model from being forced into low-probability sequences by early, high-information word choices. Conversely, the poor performance of the "Odd First" strategy highlights that simply increasing parameters or using two passes is insufficient; the logic of the generation order is the primary driver of quality.
Conclusion
This study provides strong evidence that the order of token generation significantly impacts language model performance. While current two-pass models face challenges in parameter efficiency compared to scaled-up standard Transformers, the qualitative gains from strategies like "Function First" suggest that future research should explore more dynamic and flexible generation orders, perhaps leveraging dependency parsing or iterative refinement techniques.
Summary updated