Test-time scaling enhances large language model performance by allocating additional compute resources during inference. Best-of-N (BoN) sampling serves as a common sampling-based scaling technique, broadening the search space in parallel to find better solutions from the model distribution. However, its cost-performance trade-off is still underexplored. Two main challenges limit the efficiency of BoN sampling: (1) Generating N full samples consumes substantial GPU memory, reducing inference capacity under limited resources. (2) Reward models add extra memory and latency overhead, and training strong reward models introduces potential training data costs. Although some studies have explored efficiency improvements, none have addressed both challenges at once. To address this gap, we propose Self-Truncation Best-of-N (ST-BoN), a decoding method that avoids fully generating all N samples and eliminates the need for reward models. It leverages early sampling consistency in the model's internal states to identify the most promising path and truncate suboptimal ones. In terms of cost, ST-BoN reduces dynamic GPU memory usage by over 80% and inference latency by 50%. In terms of cost-performance trade-off, ST-BoN achieves the same performance as Full-BoN while saving computational cost by 70%-80%, and under the same cost, it can improve accuracy by 3-4 points.


翻译:测试时扩展通过分配额外的计算资源在推理过程中提升大语言模型的性能。最佳N(BoN)采样作为一种常见的基于采样的扩展技术,通过并行扩展搜索空间以从模型分布中寻找更优解。然而,其成本-性能权衡仍未得到充分探索。两个主要挑战限制了BoN采样的效率:(1)生成N个完整样本消耗大量GPU内存,在有限资源下降低推理容量。(2)奖励模型增加额外的内存和延迟开销,且训练强奖励模型会引入潜在的训练数据成本。尽管已有研究探索效率改进,但尚未同时解决这两个挑战。为填补这一空白,我们提出自截断最佳N(ST-BoN)解码方法,该方法避免完全生成所有N个样本,且无需奖励模型。它利用模型内部状态在早期采样中的一致性来识别最有希望的路径并截断次优路径。在成本方面,ST-BoN将动态GPU内存使用降低超过80%,推理延迟减少50%。在成本-性能权衡方面,ST-BoN在节省70%-80%计算成本的同时达到与完整BoN相同的性能,且在相同成本下可将准确率提升3-4个百分点。

0
下载
关闭预览

相关内容

【CVPR2024】ViewDiff: 3D一致的图像生成与文本到图像模型
专知会员服务
30+阅读 · 2024年3月10日
【NeurIPS2019】图变换网络:Graph Transformer Network
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2016年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2016年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员