arXiv:2410.02725cs.CLcs.AI2024-10被引 67

让大模型自己判断何时该多算、何时能省下计算量,提升效率。

Adaptive Inference-Time Compute: LLMs Can Predict if They Can Do Better, Even Mid-Generation

  • 大模型自评:生成中预测重启能否得更好结果,无需外部奖励模型
  • 用1.2个样本平均达成16样本的34%胜率提升,数学题正确率从84%到91%
  • 可提前砍掉50%-75%无用样本,适合追求高效推理的开发者

推理时计算是提升大语言模型性能的重要方式,但如Best-of-N采样等方法成本高,需外部奖励模型和多次生成。本文提出一种生成式自评估机制,让模型在生成中途自主判断是否重启生成能获得更优结果,从而动态减少采样数。该方法基于生成式奖励模型,仅需生成一个预定义标记,即可实现预测。在真实用户提问数据集上训练后,Llama 3.1 8B在AlpacaEval上对GPT-4的胜率从21%提升至34%(16样本),GSM8K数学题正确率从84%升至91%。通过仅在必要时采样并自适应调整温度退火,平均仅需1.2样本即可达到16样本74%的性能增益;同时,50%-75%的样本可在生成早期被有效剪枝,性能下降极小。整体实现了推理阶段更高效、可扩展的算力利用。

原文摘要 · Abstract (English)

Inference-time computation is a powerful paradigm to enhance the performance of large language models (LLMs), with Best-of-N sampling being a widely used technique. However, this method is computationally expensive, requiring both (1) an external reward model and (2) the generation of multiple samples. In this work, we introduce a new generative self-evaluation scheme designed to adaptively reduce the number of generated samples while maintaining or even improving performance. We use a generative reward model formulation, allowing the LLM to predict mid-generation the probability that restarting the generation will yield a better response. These predictions are obtained without an external reward model and can be used to decide whether or not to generate more samples, prune unpromising samples early on, or to pick the best sample. This capability is very inexpensive as it involves generating a single predefined token. Trained using a dataset constructed with real unfiltered LMSYS user prompts, Llama 3.1 8B's win rate against GPT-4 on AlpacaEval increases from 21% to 34% with 16 samples and math performance on GSM8K improves from 84% to 91%. By sampling only when the LLM determines that it is beneficial to do so and adaptively adjusting temperature annealing, we demonstrate that 74% of the improvement from using 16 samples can be achieved with only 1.2 samples on average. We further demonstrate that 50-75% of samples can be pruned early in generation with minimal degradation in performance. Overall, our methods enable more efficient and scalable compute utilization during inference for LLMs.

推理优化自评估采样策略大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。