arXivDaily arXiv每日学术速递 周一至周五更新
​通知:联邦节假日调休:哥伦布日 / 原住民日(Columbus Day / Indigenous Peoples' Day),今日(13日)无更新。
arXiv 2502.21074cs.CL

CODI:通过自蒸馏将思维链压缩至连续空间

CODI: Compressing Chain-of-Thought into Continuous Space via Self-Distillation

King’s College London(伦敦国王学院);The Alan Turing Institute(艾伦·图灵研究所)

Zhenyi Shen, Hanqi Yan, Linhai Zhang, Zhanghao Hu, Yali Du, Yulan He

AI总结:

本文提出CODI框架,通过自蒸馏将显式思维链的推理能力压缩到连续隐空间,首次在GPT-2规模上使隐式CoT达到与显式CoT相当的GSM8k性能,并实现3.1倍压缩率。

摘要:

思维链(CoT)推理通过鼓励大语言模型(LLMs)以自然语言进行逐步推理来增强其能力。然而,利用潜在连续空间进行推理可能在效率和鲁棒性两方面都带来益处。先前的隐式CoT方法试图完全绕过语言,在连续空间中进行推理,但与标准的显式CoT方法相比,其表现始终较差。我们提出了CODI(Continuous Chain-of-Thought via Self-Distillation,通过自蒸馏实现的连续思维链),这是一种新颖的训练框架,能够有效地将自然语言CoT压缩到连续空间中。CODI联合训练一个教师任务(显式CoT)和一个学生任务(隐式CoT),通过对齐指定token的隐藏状态,将推理能力从语言蒸馏到连续空间中。我们的实验表明,CODI是首个在GPT-2规模上、在GSM8k数据集上达到与显式CoT相当性能的隐式CoT方法,实现了3.1倍的压缩率,并在准确率上比此前最先进的方法高出28.2%。CODI还展现出鲁棒性、对复杂数据集的泛化能力以及可解释性。这些结果验证了LLMs不仅能在自然语言中有效推理,也能在潜在连续空间中进行有效推理。代码可在 https://github.com/zhenyi4/codi 获取。

英文摘要:

Chain-of-Thought (CoT) reasoning enhances Large Language Models (LLMs) by encouraging step-by-step reasoning in natural language. However, leveraging a latent continuous space for reasoning may offer benefits in terms of both efficiency and robustness. Prior implicit CoT methods attempt to bypass language completely by reasoning in continuous space but have consistently underperformed compared to the standard explicit CoT approach. We introduce CODI (Continuous Chain-of-Thought via Self-Distillation), a novel training framework that effectively compresses natural language CoT into continuous space. CODI jointly trains a teacher task (Explicit CoT) and a student task (Implicit CoT), distilling the reasoning ability from language into continuous space by aligning the hidden states of a designated token. Our experiments show that CODI is the first implicit CoT approach to match the performance of explicit CoT on GSM8k at the GPT-2 scale, achieving a 3.1x compression rate and outperforming the previous state-of-the-art by 28.2% in accuracy. CODI also demonstrates robustness, generalizable to complex datasets, and interpretability. These results validate that LLMs can reason effectively not only in natural language, but also in a latent continuous space. Code is available at https://github.com/zhenyi4/codi.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑