Bayesian Evaluation of Large Language Model Behavior

Rachel Longjohn, Shang Wu, Saatvik Kher, Catarina G. Belém, Padhraic SmytharXiv 2025 · DOI

Introduction

Large Language Models (LLMs) are fundamentally probabilistic, yet standard evaluation benchmarks often treat them as deterministic systems. By relying on "greedy" decoding or single-sample outputs, current methodologies ignore the inherent uncertainty in model behavior. This "sampling variability" gap can lead to misleading results; for instance, a model might pass a safety check once but fail it 20% of the time in a stochastic production environment. This paper proposes a Bayesian framework to quantify this uncertainty, treating LLM evaluation as a statistical inference problem to improve both accuracy and cost-effectiveness.

Methodology

The researchers formalize the evaluation process by modeling the probability of a specific behavior (e.g., a "refusal" or a "win" in a pairwise matchup) as a parameter $\theta_m$ for each prompt $m$ in a benchmark.

The Bayesian Model

The framework employs a Beta-Binomial model. It begins with a prior belief (Beta distribution) about the model's performance, which is then updated with observed results (Binomial likelihood) from multiple queries. This results in a posterior distribution that captures the model's behavior more comprehensively than a single point estimate.

Different configurations of LLM text generation methods evaluated within the Bayesian framework.

Aggregation and Sequential Sampling

Beyond simple averages, the framework calculates distributions for aggregate metrics. One such metric is $W_{> \nu}$, representing the number of prompts where the model's success probability exceeds a specific threshold $\nu$ (e.g., 75%).

To optimize the evaluation process, the authors frame it as a sequential decision problem using multi-armed bandit algorithms like Greedy and Thompson Sampling. These methods prioritize sampling prompts that are expected to most significantly reduce the overall uncertainty (variance) of the final benchmark score, rather than sampling all prompts equally.

Posterior distribution of the aggregate metric $W_{> \nu}$, showing the probability of the model exceeding a success threshold across a benchmark.

Case Studies and Results

The approach was validated using MT-Bench (pairwise preferences) and JailBreakBench (safety refusals).

  • Uncovering Hidden Risks: In JailBreakBench, while greedy decoding suggested a 98% success rate, Bayesian analysis revealed that several "successful" prompts had a high probability of failure under stochastic conditions.
  • Efficiency Gains: Sequential sampling algorithms, particularly the "Greedy" approach, reduced the variance of estimated scores significantly faster than standard round-robin sampling. This allows researchers to achieve high confidence in model rankings with fewer expensive API calls.
  • Focus on Borderline Cases: The algorithms naturally focus on "hard" or inconsistent prompts where the model's behavior is most uncertain, rather than wasting resources on prompts the model consistently passes or fails.

Conclusion and Future Directions

The Bayesian framework provides a more rigorous and efficient way to evaluate LLMs by accounting for their stochastic nature. While currently focused on binary outcomes, future work aims to extend this to continuous scales and incorporate hierarchical models to share information across semantically related prompts. This shift from deterministic to probabilistic evaluation is crucial for building more reliable and safer AI systems.

Summary updated

BibTeX
@misc{longjohn2025bayesian,
  author = {Rachel Longjohn and Shang Wu and Saatvik Kher and Catarina G. Belém and Padhraic Smyth},
  title = {{Bayesian Evaluation of Large Language Model Behavior}},
  year = {2025},
  eprint = {2511.10661},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.10661},
}
Figure