Bayesian Evidence Fusion for Uncertainty Quantification of AI Agents

Artem Vazhentsev, Viktor Mazanov, Aleksandr Kutsakov, Denis Son, Daniil Maslov, Vladislav Smirnov, Timothy Baldwin, Theodore Papamarkou, Artem ShelmanovarXiv 2026

TL;DR

How do you know if an autonomous AI agent actually succeeded at a multi-step task, or just confidently hallucinated its way to the finish line? This paper introduces a lightweight, post-hoc Bayesian framework that fuses an LLM’s internal confidence signals with external feedback from its tools—like compiler errors or empty search results—to reliably flag agent failures. Best of all, it requires zero changes to the agent, adds virtually no latency, and learns from just a handful of examples.

What Problem Does This Paper Address?

Measuring uncertainty in a single LLM response is relatively straightforward: we check token probabilities, ask the model how confident it feels, or sample multiple answers to see if they agree.

AI agents break this paradigm. An agent operates in a loop—thinking, calling tools, observing the environment, and revising its plan. A coding agent might confidently write buggy code at step two, catch the error via a failed unit test at step three, and fix it by step five. Conversely, an agent might pass an incomplete test suite and still deliver a broken final patch, or declare victory with high confidence after its search queries silently return nothing useful. Simply checking the LLM's confidence on its final message—or averaging uncertainty across steps—misses the rich, sequential story told by the environment. We need a principled, computationally cheap way to combine internal model uncertainty with external tool feedback across an entire trajectory.

Methods

The authors treat final task success ($Y=1$) and failure ($Y=0$) as competing hypotheses and track belief across an agent’s rollout using Bayes’ rule in log-odds form.

Here is how they turn messy trajectories into clean failure scores:

  • Log-Likelihood Ratios as Universal Currency: Tool checks are often binary (did the command execute? did it return new documents?), while LLM uncertainty scores (like perplexity or verbalized confidence) are continuous. By fitting simple probability distributions to past successful and failed runs offline, the framework converts every observation into a log-likelihood ratio. Positive values nudge belief toward success; negative values push toward failure.
  • Bayes Fused: Starts with a prior belief of success, adds evidence from lightweight boolean tool checks ("Tool-only"), and adds the LLM's generation uncertainty.
  • Structured Bayesian Fusion (SBF): A more expressive variant built for complex, multi-turn environments. SBF separately models trajectory length (since flailing agents often take abnormally long or short paths), intermediate history, and final-step evidence. Crucially, SBF learns an affine normalization to scale down accumulated history scores, preventing correlated steps from being "double-counted."

Everything runs post hoc on recorded agent logs—no extra rollouts, policy tweaks, or LLM fine-tuning required.

Datasets

No new benchmarks were introduced, but the evaluation scale is massive—covering 80 configurations across five LLMs, eight harnesses, and 15 existing agentic environments spanning three families:

  • Retrieval: HotpotQA, MuSiQue, CRAG, BrowseComp-Plus.
  • Coding: LiveCodeBench-Hard, BigCodeBench-Hard, SWE-bench, CodeContests, DeepSWE.
  • Interactive: $\tau^3$-bench (retail, airline, telecom), WebArena-Verified, OSWorld-Verified, ALFWorld.

Key Insights and Ideas

  • Correlated steps inflate confidence unless normalized: The authors prove mathematically (Proposition 1) that if uncertainty signals across steps are correlated, naively summing their log-likelihood ratios inflates historical evidence by a factor proportional to trajectory length. SBF’s history normalization directly tames this runaway accumulation.
  • Tool feedback catches "confident blindness": In retrieval tasks, an agent looping through empty or duplicate search queries can still output a fluent, high-confidence final answer. Incorporating simple boolean checks (e.g., did this search yield unseen documents?) penalizes unsupported answers and dramatically boosts failure detection.
  • Generative priors beat discriminative overfitting: Standard supervised classifiers like logistic regression memorize model- and harness-specific quirks, collapsing when you swap the underlying LLM. Because Bayesian fusion learns simple, independent likelihood ratios, it transfers cleanly across setups and thrives in low-data regimes.
Training sample efficiency comparing Bayes Fused, SBF, and logistic regression across episode counts.

Key Results

The authors evaluate failure detection using Prediction Rejection Ratio up to a 50% rejection budget ([email protected]), where 1.0 is oracle ranking and 0.0 is random guessing.

In-domain [email protected] results across retrieval, coding, and interactive benchmarks.
  • Strong In-Domain Ranking: Across all 15 benchmarks, SBF achieves an average [email protected] of 0.450, beating the strongest supervised baseline (logistic regression at 0.424). Basic Bayes Fused leads on retrieval (0.555 with verbalized confidence) and coding (0.338), while SBF leads on interactive tasks (0.526).
  • Extreme Sample Efficiency: Bayes Fused reaches strong performance with just 30–50 labeled episodes (and nears peak performance around 100), whereas logistic regression hovers near random guessing below 50 episodes and needs ~200 to catch up.
  • Zero-Shot Robustness & Fast Adaptation: Under within-domain shifts (swapping LLMs, harnesses, or datasets), Bayes Fused (Verb.) suffers zero average degradation, while logistic regression drops by 0.191 PRR. For cross-environment shifts (WebArena $\leftrightarrow$ OSWorld), unlabeled target trajectories suffice to align signal scales; for cross-domain jumps (ALFWorld $\leftrightarrow$ DeepSWE), just 10–15 labeled episodes lift Bayes Fused past raw UQ baselines.
  • Negligible Overhead: Post-hoc scoring adds < 0.001% to per-step inference time (excluding variants that explicitly prompt an LLM for verbalized confidence).

Limitations and Future Work

  • Uninformative Critics Hurt: The method is only as good as the environment signals it observes. On CRAG, where tool checks didn't track whether new documents were retrieved, the tool-only score was near random (-0.020 PRR) and slightly dragged down raw verbalized confidence when fused.
  • Tiny Datasets & Extreme Class Imbalance: On small benchmarks with very few failures (like CodeContests, with an 88% pass rate), SBF's extra parameters become harder to estimate reliably.
  • Imperfect Length Normalization: Proposition 1 shows that SBF's shared affine rescaling cannot perfectly neutralize step-to-step correlation across varying trajectory lengths, nor does it guarantee calibrated probabilities out of the box (though post-hoc Platt scaling largely fixes calibration).
  • No Single Silver Bullet: No lone UQ variant dominates every environment, and the paper leaves active, mid-rollout intervention—using these sequential belief scores to steer or halt agents on the fly—as a natural next step beyond post-hoc analysis.

Summary updated

BibTeX
@misc{vazhentsev2026bayesian,
  author = {Artem Vazhentsev and Viktor Mazanov and Aleksandr Kutsakov and Denis Son and Daniil Maslov and Vladislav Smirnov and Timothy Baldwin and Theodore Papamarkou and Artem Shelmanov},
  title = {{Bayesian Evidence Fusion for Uncertainty Quantification of AI Agents}},
  year = {2026},
  eprint = {2611.35777},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.35777},
}
Figure