SemCoT:通过语义对齐的隐式令牌加速链式推理
SemCoT: Accelerating Chain-of-Thought Reasoning through Semantically-Aligned Implicit Tokens
AI总结:
SemCoT通过语义对齐的隐式令牌优化,提升链式推理的效率与准确性。
摘要:
链式推理(CoT)的冗长性阻碍了其在效率关键应用中的大规模部署。最近,隐式Cot方法出现,将推理步骤编码在LLM的隐藏嵌入中(称为“隐式推理”),而不是显式令牌。这种方法通过减少推理长度和绕过某些LLM组件来加速CoT。然而,现有隐式CoT方法面临两个重大挑战:(1)它们无法保持隐式推理(转换为自然语言)与真实推理之间的语义对齐,导致CoT性能显著下降;(2)它们专注于减少隐式推理的长度,但忽略了LLM生成一个单独隐式推理令牌的大量时间成本。为解决这些挑战,我们提出了一种新的语义对齐的隐式CoT框架,称为SemCoT。特别是,为第一个挑战,我们设计了一个对比训练的句子变压器,评估隐式推理与显式推理之间的语义对齐,用于在隐式推理优化过程中强制保持语义一致性。为解决第二个挑战,我们引入了一个高效的隐式推理生成器,通过微调一个轻量级语言模型进行知识蒸馏。该生成器由我们的句子变压器引导,将真实推理蒸馏成语义对齐的隐式推理,同时优化准确性。SemCoT是首个通过联合优化令牌级生成速度和保持与真实推理的语义对齐来提升CoT效率的方法。广泛的实验表明,SemCoT在效率和有效性方面均优于最先进的方法。我们的代码可在https://github.com/YinhanHe123/SemCoT/上找到。
英文摘要:
The verbosity of Chain-of-Thought (CoT) reasoning hinders its mass deployment in efficiency-critical applications. Recently, implicit CoT approaches have emerged, which encode reasoning steps within LLM's hidden embeddings (termed ``implicit reasoning'') rather than explicit tokens. This approach accelerates CoT by reducing the reasoning length and bypassing some LLM components. However, existing implicit CoT methods face two significant challenges: (1) they fail to preserve the semantic alignment between the implicit reasoning (when transformed to natural language) and the ground-truth reasoning, resulting in a significant CoT performance degradation, and (2) they focus on reducing the length of the implicit reasoning; however, they neglect the considerable time cost for an LLM to generate one individual implicit reasoning token. To tackle these challenges, we propose a novel semantically-aligned implicit CoT framework termed SemCoT. In particular, for the first challenge, we design a contrastively trained sentence transformer that evaluates semantic alignment between implicit and explicit reasoning, which is used to enforce semantic preservation during implicit reasoning optimization. To address the second challenge, we introduce an efficient implicit reasoning generator by finetuning a lightweight language model using knowledge distillation. This generator is guided by our sentence transformer to distill ground-truth reasoning into semantically aligned implicit reasoning, while also optimizing for accuracy. SemCoT is the first approach that enhances CoT efficiency by jointly optimizing token-level generation speed and preserving semantic alignment with ground-truth reasoning. Extensive experiments demonstrate the superior performance of SemCoT compared to state-of-the-art methods in both efficiency and effectiveness. Our code can be found at https://github.com/YinhanHe123/SemCoT/.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。