Uncertainty-Aware Decoding with Minimum Bayes Risk

Nico Daheim, Clara Meister, Thomas Möllenhoff, Iryna Gurevych

Introduction

Even the most advanced Large Language Models (LLMs) suffer from hallucinations—generating text that is fluent but factually incorrect. Research suggests this often happens when models encounter out-of-distribution inputs where their "epistemic uncertainty" (uncertainty about their own internal parameters) is high.

Standard decoding strategies, like beam search or standard Minimum Bayes Risk (MBR), typically rely on a single set of model weights. This assumes the model's parameters are a perfect representation of the truth. When the model is "guessing" in a low-data regime, this overconfidence leads to errors. To bridge the gap between Bayesian uncertainty estimation and the actual text generation process, researchers have introduced a principled way to bake "weight uncertainty" into the decoding process. By generalizing MBR decoding to account for a posterior distribution over model weights, this approach leads to fewer hallucinations and provides a reliable way for models to "abstain" when they are unsure.

Methodology: Uncertainty-Aware MBR (UA-MBR)

In standard MBR, a system selects a hypothesis that maximizes the expected utility (or minimizes risk) relative to the model's distribution. The authors propose Uncertainty-Aware MBR (UA-MBR), which generalizes this process by incorporating a predictive posterior—essentially an average over many possible versions of the model.

The framework relies on several key approaches:

  1. Learning the Posterior: Instead of standard optimizers like AdamW, the authors use IVON, a variational optimizer that treats model weights as a Gaussian distribution. This allows them to sample different "versions" of the model weights with negligible training overhead.
  2. Sequence-Level Estimators: The system samples multiple models from the posterior and generates full candidate strings from each. These are then aggregated using specific estimators. This is particularly useful for "black-box" LLMs where users only have access to the text output, not the internal probabilities.
  3. Token-Level Estimators: Alternatively, the probabilities of multiple models can be averaged at every single step of the generation process.
  4. Selective Prediction: The "expected risk" calculated during decoding acts as a signal. If the risk is too high, the system can choose to abstain from answering, offering a more robust way to handle potential hallucinations than simple probability thresholds.

Key Insights

Diversity is Key: The success of UA-MBR is highly correlated with prediction diversity. If the different sampled models all agree, the method behaves like standard MBR. If they disagree, UA-MBR acts as a "consensus builder" that down-weights "weird" or hallucinated outliers.

BLEU and COMET scores plotted against prediction diversity.

The "Free Lunch" of Unimodal Posteriors: Using a simple Gaussian posterior (via IVON) provides performance gains during fine-tuning without increasing training time. While "Deep Ensembles" (training multiple independent models) perform better and exhibit higher diversity, they are significantly more expensive to train.

Better Abstention and Black-Box Compatibility: The expected utility calculated by UA-MBR is a much more reliable signal for deciding when a model should "stay silent" compared to the confidence scores of a single model. Furthermore, the sequence-level approach allows for ensembling outputs from different proprietary APIs (like combining Llama and Mistral) in a mathematically principled way.

Key Results

The authors benchmarked their approach across a diverse set of tasks and languages, including Machine Translation (WMT14, IWSLT14, afroMT), Summarization (XSUM, SAMSum), Data-to-Text (E2E-NLG), and Sentence Similarity (STS-B). They tested on fine-tuned Gemma-2B, Transformer models, and zero-shot prompted models like Llama-3 (8B) and Mistral (7B).

Performance of UA-MBR across various datasets compared to standard MBR.
  • Translation Gains: On the IWSLT17 (En-De) dataset, UA-MBR using a Deep Ensemble improved the BLEU score to 21.24, up from 19.73 with standard MBR.
  • Hallucination Reduction: Using the LaBSE metric (which correlates with human judgment of hallucinations), UA-MBR consistently outperformed standard MBR across multiple datasets.
  • Scaling: Performance scales positively with both the number of models sampled from the posterior and the size of the hypothesis set (the number of candidate sentences).

Limitations and Future Work

While training with IVON is cheap, sampling multiple models at inference time increases computational cost. However, sequence-level ensembling is generally easier to parallelize than token-level ensembling.

Additionally, MBR is fundamentally limited by the quality of the initial candidate pool; if the "correct" answer isn't sampled initially, MBR cannot select it. Finally, this study primarily focused on Gaussian and mixture-of-Gaussian posteriors. Exploring more complex, non-Gaussian posterior distributions remains an open and promising area for future research.

Summary updated

BibTeX
@inproceedings{daheim2025uncertainty,
  author = {Nico Daheim and Clara Meister and Thomas Möllenhoff and Iryna Gurevych},
  title = {{Uncertainty-Aware Decoding with Minimum Bayes Risk}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=hPpyUv1XyQ},
}
Figure