arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.01394cs.LGcs.CL
收藏

推理时间优化中的最优停止与Best-of-$N$对比

Optimal Stopping vs Best-of-$N$ for Inference Time Optimization

University of Southern California(南加州大学);University of Michigan(密歇根大学)

Yusuf Kalayci, Vinod Raman, Shaddin Dughmi

AI总结:

本研究基于潘多拉魔盒问题提出UCB风格的自适应推理时间优化算法,通过奖励归一化与动态阈值学习,在保持性能的同时比Best-of-N采样减少15-35%的生成次数,为LLM部署提供理论支撑与效率增益。

摘要:

大语言模型(LLM)的生成过程通常需要在输出质量与推理成本之间取得平衡,尤其是在使用多轮生成时。我们基于经典的潘多拉魔盒(Pandora's Box)问题,提出了一种全新的推理时间优化框架。我们将每一次生成视为打开一个具有随机奖励的高成本“盒子”,由此开发出无需知晓底层奖励分布即可决定何时停止生成的算法。我们的第一项贡献是提出一种UCB风格的潘多拉魔盒算法,该算法的性能经证明可接近Weitzman算法——即分布已知情况下的最优策略。我们进一步通过受Bradley-Terry模型启发的变换解决了不同提示词间的奖励缩放问题,将该方法适配到实际的LLM场景中。由此得到了一种自适应推理时间优化方法,该方法可对奖励进行归一化并动态学习停止阈值。我们在AlpacaFarm和HH-RLHF数据集上开展了实验,使用多组LLM-奖励模型配对进行测试,结果表明我们的自适应策略能够达到与非自适应Best-of-N采样相同的性能,同时平均减少15-35%的生成次数。我们的研究在最优停止理论与推理时间扩展之间建立了具有理论依据的桥梁,为LLM部署提供了理论性能边界与实际效率提升。

英文摘要:

Large language model (LLM) generation often requires balancing output quality against inference cost, especially when using multiple generations. We introduce a new framework for inference-time optimization based on the classical Pandora's Box problem. Viewing each generation as opening a costly "box" with random reward, we develop algorithms that decide when to stop generating without knowing the underlying reward distribution. Our first contribution is a UCB-style Pandora's Box algorithm, which achieves performance that is provably close to Weitzman's algorithm, the optimal strategy when the distribution is known. We further adapt this method to practical LLM settings by addressing reward scaling across prompts via a Bradley-Terry inspired transformation. This leads to an adaptive inference-time optimization method that normalizes rewards and learns stopping thresholds on the fly. Experiments on the AlpacaFarm and HH-RLHF datasets, using multiple LLM-reward model pairs, show that our adaptive strategy can obtain the same performance as non-adaptive Best-of-N sampling while requiring 15-35 percent fewer generations on average. Our results establish a principled bridge between optimal stopping theory and inference-time scaling, providing both theoretical performance bounds and practical efficiency gains for LLM deployment.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑