In structured prediction and natural language generation, we often need to know how "sure" a model is of its output. Whether we are deciding which sentences to send to a human annotator in active learning or determining if an LLM is hallucinating, we rely on uncertainty metrics like entropy or log-likelihood.
However, these metrics suffer from a fundamental flaw: length bias. Because autoregressive models calculate the probability of a sequence as a product of individual token probabilities, longer sequences naturally accumulate lower total probabilities and higher total entropy. This creates a spurious correlation where a model appears "confused" simply because it was more verbose.
The Accumulation Problem
To understand why length bias occurs, consider how a model like a Transformer generates text. The probability of a sequence $Y$ is the product of the probability of each token $y_t$ given the previous tokens:
$$P(Y) = \prod_{t=1}^{L} P(y_t | y_{<t})$$
As the length $L$ increases, the joint probability $P(Y)$ almost inevitably decreases. Andrey Malinin and Mark J. F. Gales note that this inherent bias makes raw uncertainty scores incomparable between short and long outputs. In tasks like speech recognition or translation, a perfectly correct 20-word sentence will often have a much lower raw probability than a mediocre 5-word sentence.
This isn't just a mathematical quirk; it has real-world consequences for model behavior. Rebecca Hwa observed that in structural learning, the space of possible configurations grows exponentially with input length. Without normalization, an active learning system will simply default to picking the longest available inputs, assuming they are the most "uncertain," even if they are linguistically straightforward.
The Cost of Bias in Active Learning
In the context of Active Learning (AL), length bias is an economic problem. Vincent Claveau and Burr Settles highlight that standard uncertainty-based selection disproportionately favors long sequences. For a human annotator, labeling a 50-word sentence takes significantly more time than a 5-word sentence. If the 50-word sentence is only "uncertain" because of its length—and not because it contains new, informative patterns—the labeling budget is effectively wasted.
Hyokun Yun and colleagues found that for Named Entity Recognition (NER), raw probability scores are so biased against length that they lead models to select long sentences regardless of their actual informational value. This "length-trap" prevents the model from focusing on truly difficult, concise examples that could more efficiently improve its performance.
Hallucinations and Model Cascades
In modern Large Language Models (LLMs), length bias complicates our ability to detect errors. Neha Gupta and the team at Google Research point out that when using a "cascade" (where a small model defers difficult queries to a larger one), summing probabilities unfairly penalizes long outputs. This can cause a system to unnecessarily trigger a more expensive model for a long, correct response while missing a short, confident hallucination.
Furthermore, Roman Vashurin and Maxim Panov demonstrate that even metrics like perplexity, which are supposedly normalized, still exhibit a residual correlation with length. This bias prevents effective "selective prediction"—the ability of a model to abstain from answering when it is likely to be wrong.
Strategies for Mitigation
Researchers have proposed several ways to "detrend" uncertainty from length:
- Length Normalization: The most common heuristic is to divide the log-probability or entropy by the sequence length $L$. Rebecca Hwa used this to identify sentences with the highest "density" of information.
- Token-Level Analysis: Instead of looking at the whole sequence, some researchers focus on specific tokens. Tuo Wang introduced GENUINE, which identifies "pivotal" tokens in a grammatical dependency graph to avoid the noise that accumulates in long-form generation. Similarly, Neha Gupta suggests using quantile-based features of token uncertainties to mask local failures that averaging might hide.
- Statistical Detrending: UNCERTAINTY-LINE uses linear regression to find the expected uncertainty for a given length and then uses the residual (the difference between the actual and expected score) as the true measure of model confusion.
- The Summation Argument: Interestingly, Lukas Aichberger and Sepp Hochreiter argue that in some cases, normalization can actually harm predictive power. They suggest that by averaging probabilities, we might dilute the signal of a single, highly uncertain token that indicates a critical error. Their method, G-NLL, suggests that the raw log-likelihood of a single greedy sequence can sometimes outperform complex normalized metrics.
Ultimately, the goal of this research direction is to move toward "length-invariant" uncertainty—a measure that tells us how much the model is struggling with the content of the task, rather than how much it is struggling with the volume of the output.