Sampling-Efficient Test-Time Scaling: Self-Estimating the Best-of-N Sampling in Early Decoding

Yiming Wang, Pei Zhang, Siyuan Huang, Baosong Yang, Zhuosheng Zhang, Fei Huang, Rui Wang

Abstract

Best-of-N (BoN) sampling is a powerful technique for enhancing Large Language Model (LLM) performance during inference by generating multiple candidate responses and selecting the optimal one. However, the computational and memory overhead of generating $N$ full sequences is often prohibitive. This paper introduces Self-Truncation Best-of-N (ST-BoN), a novel framework that predicts the best response early in the decoding process using internal hidden states. By truncating suboptimal paths before completion, ST-BoN reduces GPU memory usage by over 80% and latency by 50% while maintaining or improving accuracy compared to standard BoN.

Introduction

Test-time scaling has emerged as a critical strategy for improving LLM reasoning capabilities. By allocating more compute at inference time—typically through Best-of-N (BoN) sampling—models can explore a broader solution space. Despite its effectiveness, BoN faces two primary challenges: the massive KV cache memory footprint required for parallel generation and the reliance on external Reward Models (RMs), which are often domain-specific and computationally expensive.

ST-BoN addresses these bottlenecks by identifying the most promising reasoning path early in the generation process, allowing the model to "self-truncate" the remaining $N-1$ samples without requiring an external verifier.

Methodology: Self-Truncation Best-of-N

The ST-BoN process is divided into three distinct phases designed to maximize efficiency while preserving reasoning quality:

  1. Early Parallel Generation: The model generates $N$ samples until they become pairwise inconsistent at time $c$.
  2. Buffer Window: A short additional sequence of length $\tau$ is generated to provide sufficient signal for evaluation.
  3. Self-Estimation and Truncation: Instead of semantic evaluation, ST-BoN utilizes Chain-of-Embedding (CoE). This method analyzes the "latent thinking path" across transformer layers to calculate a consistency score for each sample. The sample with the highest score is retained, while others are truncated, reverting the batch size to 1 for the remainder of the generation.
Overview of the ST-BoN framework, illustrating early estimation, the buffer window, and self-truncation.

Experimental Results

The efficacy of ST-BoN was evaluated using Qwen2.5, Llama3, and Mistral models across diverse benchmarks, including MATH, TheoremQA, GPQA, and MMLU for reasoning, alongside CNNDM and AlpacaFarm for subjective tasks.

Efficiency Gains

The results demonstrate significant efficiency gains across all tested domains:

  • Memory and Latency: ST-BoN reduces dynamic GPU memory usage by over 80% for $N \ge 5$ and cuts wall-clock latency by approximately 50%.
  • Token Reduction: The token reduction rate ($R_D$) scales with the number of samples, reaching over 90% for the MATH dataset as $N$ increases. This indicates that the model successfully identifies the correct path very early in the decoding process.
Token Reduction Rate ($R_D$) across different datasets as a function of sampling size $N$, showing significant computational savings.

Performance Ceiling

By drastically reducing the per-sample cost, ST-BoN allows for scaling to much larger $N$ within the same compute budget. For instance, scaling from $N=10$ to $N=80$ yields a 3-4 point accuracy improvement across datasets, effectively raising the performance ceiling of smaller models.

Conclusion

ST-BoN proves that internal model states provide a "crystal ball" into the quality of reasoning paths long before the final text is produced. By leveraging this unsupervised signal, ST-BoN eliminates the need for external reward models in many scenarios and significantly lowers the barrier for test-time scaling. Future work may explore dynamic buffer windows to further optimize the trade-off between early truncation and prediction accuracy.

Summary updated

BibTeX
@inproceedings{wang2025sampling,
  author = {Yiming Wang and Pei Zhang and Siyuan Huang and Baosong Yang and Zhuosheng Zhang and Fei Huang and Rui Wang},
  title = {{Sampling-Efficient Test-Time Scaling: Self-Estimating the Best-of-N Sampling in Early Decoding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=BcKYVmh3yH},
}
Figure