用梯度优化提升大模型推理,减少调用次数
$\nabla$-Reasoner: LLM Reasoning via Test-Time Gradient Descent in Latent Space
- 在解码时用梯度直接优化文本表示,替代传统搜索
- 数学推理准确率提升超20%,模型调用减少10%-40%
- 适合需要高效推理的部署场景,尤其关注成本与性能
扩展大语言模型(LLM)推理阶段的计算量已解锁前所未有的推理能力。然而,现有方法通常依赖低效且次优的离散搜索算法或试错式提示来改进在线策略。本文提出∇-Reasoner,一种将可微优化引入解码循环的迭代生成框架,以实时优化策略。核心组件不同可微文本优化(DTO)利用来自语言模型似然性和奖励模型的梯度信号,精炼文本表示。∇-Reasoner进一步结合拒绝采样和加速设计,增强解码鲁棒性与速度。理论上,我们在样本空间中进行推理时的梯度下降以最大化奖励,等价于通过KL正则化强化学习对齐LLM策略。实验表明,∇-Reasoner在一项具有挑战性的数学推理基准上实现超过20%的准确率提升,同时相比强基线减少约10%-40%的模型调用次数。总体而言,本工作实现了从零阶搜索到一阶优化的范式转变,为提升大模型推理提供了一条成本可控的路径。
原文摘要 · Abstract (English)
Scaling inference-time compute for Large Language Models (LLMs) has unlocked unprecedented reasoning capabilities. However, existing inference-time scaling methods typically rely on inefficient and suboptimal discrete search algorithms or trial-and-error prompting to improve the online policy. In this paper, we propose $\nabla$-Reasoner, an iterative generation framework that integrates differentiable optimization over token logits into the decoding loop to refine the policy on the fly. Our core component, Differentiable Textual Optimization (DTO), leverages gradient signals from both the LLM's likelihood and a reward model to refine textual representations. $\nabla$-Reasoner further incorporates rejection sampling and acceleration design to robustify and speed up decoding. Theoretically, we show that performing inference-time gradient descent in the sample space to maximize reward is dual to aligning an LLM policy via KL-regularized reinforcement learning. Empirically, $\nabla$-Reasoner achieves over 20% accuracy improvement on a challenging mathematical reasoning benchmark, while reducing number of model calls by approximately 10-40% compared to strong baselines. Overall, our work introduces a paradigm shift from zeroth-order search to first-order optimization at test time, offering a cost-effective path to amplify LLM reasoning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。