Don't Throw Away Your Beams: Improving Consistency-based Uncertainties in LLMs via Beam Search

Ekaterina Fadeeva, Maiya Goloburda, Aleksandr Rubashevskii, Roman Vashurin, Artem Shelmanov, Preslav Nakov, Mrinmaya Sachan, Maxim Panov

TL;DR

Researchers have discovered that using beam search—rather than standard random sampling—to generate alternative answers significantly improves how we measure a Large Language Model's (LLM) uncertainty. By weighting these "beams" by their probabilities, they achieved state-of-the-art performance in uncertainty quantification while reducing the noise and computational waste common in existing methods.

The Problem with Random Sampling

As LLMs enter safety-critical fields like medicine and law, knowing when a model is "hallucinating" or unsure is vital. This is known as Uncertainty Quantification (UQ).

One popular approach is "consistency-based UQ": you ask the model the same question multiple times and see if the answers agree. If the model gives ten different answers, it’s likely confused; if it gives the same answer ten times, it’s confident.

Traditionally, these alternative answers are generated via multinomial sampling (randomly picking tokens based on their probability). However, in short-form Q&A, the model's probability distribution is often very "peaked"—meaning one or two answers are much more likely than others. In these cases, random sampling often produces the exact same answer over and over. This "redundancy trap" wastes computation and leads to noisy, high-variance confidence estimates that change every time you run the test.

Comparison of Multinomial Sampling vs. Beam Search Decoding for Uncertainty Quantification.

A New Approach: Beam Search for UQ

The authors propose a new family of UQ methods that replace random sampling with Beam Search. Instead of picking randomly, beam search systematically tracks the top-$M$ most likely sequences.

This shift offers three major advantages:

  1. Guaranteed Diversity: It forces the model to find distinct top candidates, avoiding the redundancy trap entirely.
  2. Importance Weighting: Unlike random samples, which are treated equally, the authors weight each beam by its actual sequence probability. This prevents low-probability "junk" answers from skewing the confidence score.
  3. Efficiency: If a system already uses beam search for decoding, these uncertainty estimates are essentially "free," requiring no extra model passes.

The researchers adapted several existing UQ metrics—including Dissimilarity, Eccentricity, and CoCoA—to work with this beam-weighted approach. They also provided a mathematical proof showing that if your beam search captures a certain threshold of the total probability mass (about 84% for 10 samples), it is theoretically guaranteed to be more accurate than random sampling.

Key Insights and Ideas

The Redundancy Trap is Real

The authors found that for short answers, a massive portion of multinomial samples are typically duplicates. Beam search eliminates this waste, ensuring every generated sequence adds value to the uncertainty estimate.

Sample redundancy percentage by the length of output tokens.

The "Aha" Moment on Sample Count

Beam search reaches high accuracy with very few samples (as few as 3–5) and plateaus quickly. In contrast, multinomial sampling improves slowly and requires many more samples to reach even lower levels of performance.

Targeted vs. Global Uncertainty

The study highlights that measuring the uncertainty of a specific generated answer (targeted) is more effective for ranking correctness than measuring the model's general uncertainty about the input question (global).

Experimental Results

The approach was evaluated across six diverse QA benchmarks (including TriviaQA, CoQA, and ARC-Challenge) using both "Base" and "Instruct" versions of Gemma, Llama 3.1, and Qwen models.

  • State-of-the-Art Performance: Beam-search-based variants consistently outperformed their multinomial counterparts across all six datasets and all three model families.
  • Superior Rejection Ranking: Using the Prediction-Rejection Ratio (PRR)—a metric that measures how well a UQ method can "reject" wrong answers—the beam search methods achieved the highest scores, particularly in the "high-rejection" regime where precision is most critical.
  • Robustness: Beam search estimates showed much lower variance across runs compared to the stochastic nature of multinomial sampling.

Limitations and Future Work

While highly effective, the method has a few limitations. First, it is a "white-box" technique, meaning it requires access to the model’s internal token probabilities. This isn't always possible with proprietary APIs, though empirical probability estimates could potentially bridge this gap. Second, the experiments focused heavily on short-form QA. Whether these benefits translate to long-form creative writing or complex reasoning chains remains an open question for future research. Finally, the results rely on neural similarity metrics to determine if two answers are semantically "the same"; biases in these underlying metrics could influence the UQ scores.

Summary updated

BibTeX
@inproceedings{fadeeva2026don,
  author = {Ekaterina Fadeeva and Maiya Goloburda and Aleksandr Rubashevskii and Roman Vashurin and Artem Shelmanov and Preslav Nakov and Mrinmaya Sachan and Maxim Panov},
  title = {{Don't Throw Away Your Beams: Improving Consistency-based Uncertainties in LLMs via Beam Search}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=igcQRiVlgu},
}
Figure