一种用于高效大语言模型推理的状态转换框架
A State-Transition Framework for Efficient LLM Reasoning
AI总结:
本文提出了一种基于状态转换的高效推理框架,通过线性注意力机制和状态策略提升大语言模型的推理效率和性能。
摘要:
尽管长链思考(CoT)推理显著提高了大语言模型(LLM)在复杂推理任务上的性能,但生成长CoT序列所带来的显著计算和内存成本限制了其效率和实用性。现有研究通常通过压缩CoT序列来提高LLM的推理效率。然而,这种做法与测试时扩展性相冲突,限制了LLM的推理能力。在本文中,我们提出了一种高效的推理框架,将LLM的推理过程建模为一个状态转换过程。具体来说,我们首先应用线性注意力机制来估计LLM的推理状态,该状态记录了先前推理步骤中的历史推理信息。然后,基于查询提示和推理状态,LLM可以高效地执行当前推理步骤并更新状态。通过线性注意力,当前推理步骤中的每个token可以直接从推理状态中检索相关的历史推理信息,而无需显式地关注先前推理步骤中的token。这样,注意力的计算复杂度从二次降到了线性,显著提高了LLM的推理效率。此外,我们提出了一种基于状态的推理策略,以缓解由噪声推理步骤引起的过度思考问题。在多个数据集和模型规模上的广泛实验表明,我们的框架不仅提高了LLM的推理效率,还增强了其推理性能。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。