Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

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

About

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.

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

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningGSM8K
Accuracy2.55
1424
Mathematical ReasoningMATH500 (test)
Accuracy37.8
922
Mathematical ReasoningGSM8K (test)
Accuracy61
816
Multimodal UnderstandingMMStar--
511
Diagram Question AnsweringAI2D
AI2D Accuracy79
509
Mathematical ReasoningGSM8K
Accuracy79.39
499
Mathematical ReasoningSVAMP
Accuracy21.7
403
Science Question AnsweringScienceQA (SQA)
Accuracy88.4
338
Mathematical ReasoningMATH
Accuracy4.3
338
Mathematical ReasoningSVAMP (test)
Accuracy70.1
298
Showing 10 of 76 rows
...

Other info

Follow for update