BEACON: Bayesian Optimal Stopping for Efficient LLM Sampling

Guangya Wan, Zixin Stephen Xu, Sasa Zorc, Manel Baucells, Mengxuan Hu, Hao Wang, Sheng Li · DOI

Abstract

Large Language Models (LLMs) often require multiple sampling passes (Best-of-N) to ensure high-quality outputs, leading to significant computational overhead. We present BEACON, a training-free framework that leverages Bayesian optimal stopping theory to dynamically determine the optimal number of samples. By modeling reward distributions in real-time and weighing potential gains against marginal costs, BEACON reduces inference compute by up to 80% without compromising performance.

Introduction

The inherent stochasticity of LLMs often necessitates generating multiple candidate responses to find a high-quality solution, a technique known as Best-of-N (BoN) sampling. However, BoN is computationally expensive, applying a fixed budget (e.g., $N=32$) regardless of prompt difficulty. Easy queries are over-sampled, wasting resources, while difficult ones may remain unsolved.

BEACON addresses this "economy of inference" by reformulating sampling as a sequential search problem. It provides a mathematically grounded framework to decide, after each sample, whether the expected improvement justifies the cost of further generation.

Conceptual comparison of fixed vs. adaptive sampling strategies.

Methodology

BEACON treats LLM sampling as a Sequential Search Problem. The system generates samples iteratively and evaluates the stopping condition: "Is the potential improvement of the next sample worth the cost $c$?"

Bayesian Learning and Decision Making

The framework employs a Normal-Inverse-Gamma (NIG) prior to model the distribution of rewards. As samples are collected, the posterior distribution is updated, refining the model's "belief" about the mean and variance of available rewards.

To ensure low-latency decision-making, BEACON utilizes a Universal Index Policy (UIP). Instead of solving complex Bellman equations online, it uses a pre-computed $h$-index table. Stopping decisions are made via a rapid table lookup based on the current best reward and estimated variance. Additionally, a robust filtering mechanism prevents extreme low-score outliers from skewing the posterior mean, focusing the search on the "right tail" of the distribution.

Experimental Evaluation

BEACON was evaluated across diverse benchmarks, including reasoning tasks (MATH500, AIME 2024, AMC 2023) and alignment tasks (AlpacaEval 2.0). It was also tested in the context of Iterative Direct Preference Optimization (DPO) for efficient model training.

Key Results

  • Efficiency: BEACON achieved accuracy comparable to a fixed Best-of-32 strategy while utilizing 50-80% fewer samples.
  • Value Optimization: On a "Value" metric (Reward minus Cost), BEACON consistently outperformed fixed BoN and heuristic adaptive samplers like RASC.
  • Adaptive Training: In DPO workflows, BEACON naturally reduced sample counts as the model improved, accelerating data collection without performance loss.
Performance comparison between Best-of-N and BEACON across accuracy and reward metrics.

Discussion and Conclusion

A core insight of BEACON is that variance is the primary signal for stopping. Low variance indicates consistent quality, prompting early termination, while high variance suggests a "hidden gem" may yet be found. As a zero-shot, training-free method, BEACON adapts to prompt difficulty on-the-fly.

Current limitations include a dependency on Reward Model (RM) calibration and the assumption of sample independence. Future work will explore exploiting correlations between reasoning paths and dynamic cost tuning ($c$) to further optimize the trade-off between latency and efficiency.

Summary updated

BibTeX
@misc{wan2025beacon,
  author = {Guangya Wan and Zixin Stephen Xu and Sasa Zorc and Manel Baucells and Mengxuan Hu and Hao Wang and Sheng Li},
  title = {{BEACON: Bayesian Optimal Stopping for Efficient LLM Sampling}},
  year = {2025},
  eprint = {2510.15945},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.15945},
}
Figure