用状态转移框架让大模型推理更快更准,不增加计算负担。
A State-Transition Framework for Efficient LLM Reasoning
- 将推理过程建模为状态转移,用线性注意力高效获取历史信息。
- 在多个数据集上,推理速度提升显著,准确率也更高。
- 适合需要高效推理的复杂任务,如数学与逻辑题求解。
长链思维(Long Chain-of-Thought, CoT)推理虽能显著提升大语言模型(LLMs)在复杂推理任务上的表现,但生成长序列带来的巨大计算与内存开销限制了其效率和实用性。现有方法通常通过压缩CoT序列来提升效率,但这与测试时扩展(test-time scaling)相冲突,制约了模型推理能力。本文提出一种高效的推理框架,将LLM的推理过程建模为状态转移过程。首先,采用线性注意力机制估计推理状态,该状态记录前序推理步骤的历史信息。随后,基于查询提示与当前推理状态,模型可高效完成当前推理步骤并更新状态。借助线性注意力,当前步骤中的每个标记可直接从推理状态中检索相关历史信息,无需显式关注之前所有标记。这使注意力计算复杂度从二次方降至线性,显著提升推理效率。此外,提出基于状态的推理策略,缓解由噪声推理步骤引发的过度思考问题。在多个数据集及不同规模模型上的大量实验表明,该框架不仅提升了推理效率,还增强了推理性能。
原文摘要 · Abstract (English)
While Long Chain-of-Thought (CoT) reasoning significantly improves Large Language Models (LLMs) performance on complex reasoning tasks, the substantial computational and memory costs of generating long CoT sequences limit their efficiency and practicality. Existing studies usually enhance the reasoning efficiency of LLMs by compressing CoT sequences. However, this approach conflicts with test-time scaling, limiting the reasoning capacity of LLMs. In this paper, we propose an efficient reasoning framework that models the reasoning process of LLMs as a state-transition process. Specifically, we first apply a linear attention mechanism to estimate the LLM's reasoning state, which records the historical reasoning information from previous reasoning steps. Then, based on the query prompt and the reasoning state, the LLM can efficiently perform the current reasoning step and update the state. With the linear attention, each token in the current reasoning step can directly retrieve relevant historical reasoning information from the reasoning state, without explicitly attending to tokens in previous reasoning steps. In this way, the computational complexity of attention is reduced from quadratic to linear, significantly improving the reasoning efficiency of LLMs. In addition, we propose a state-based reasoning strategy to mitigate the over-thinking issue caused by noisy reasoning steps. Extensive experiments across multiple datasets and model sizes demonstrate that our framework not only improves the reasoning efficiency of LLMs but also enhances their reasoning performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。