Training Large Language Models to Reason in a Continuous Latent Space

Shibo Hao, Sainbayar Sukhbaatar, DiJia Su, Xian Li, Zhiting Hu, Jason E Weston, Yuandong Tian

TL;DR

This paper introduces COCONUT, a novel approach that allows Large Language Models (LLMs) to reason in a continuous latent space rather than being confined to natural language. By feeding the LLM's internal hidden states directly back as input, COCONUT enables a more flexible, breadth-first search-like reasoning process, leading to improved accuracy and efficiency on complex reasoning tasks.

What Problem Does This Paper Address?

Current LLMs primarily reason using "chain-of-thought" (CoT), which involves generating intermediate reasoning steps as natural language tokens. While effective, this approach has limitations:

  • Suboptimal for Reasoning: Natural language is optimized for communication, not necessarily for the complex, multi-step planning required for deep reasoning. Many tokens are primarily for fluency and don't contribute much to the actual reasoning.
  • Computational Inefficiency: LLMs allocate the same computational budget to every token, even those that are less critical for reasoning, leading to wasted resources.
  • Premature Commitment: CoT forces a deterministic, step-by-step reasoning path, which can be problematic for tasks requiring exploration and backtracking.

The authors argue that reasoning might be more effectively performed in an unrestricted "latent space" where the LLM's internal representations can be directly utilized, free from the constraints of language.

Methods

The core innovation is the COCONUT (Chain of Continuous Thought) paradigm. Instead of decoding the LLM's last hidden state (representing the "continuous thought" or reasoning state) into a word token, COCONUT feeds this hidden state directly back as the input embedding for the next step. This creates a continuous loop of latent reasoning.

Key aspects of the method:

  • Latent Space Reasoning: The LLM operates in its internal continuous representation space for reasoning, only translating to language when necessary.
  • Multi-Stage Training: COCONUT is trained using a curriculum that gradually replaces language reasoning steps with continuous thoughts, inspired by prior work on "internalizing" CoT.
  • Breadth-First Search (BFS) Emergence: This latent reasoning approach naturally allows the model to explore multiple potential reasoning paths simultaneously, mimicking a BFS strategy. This contrasts with the deterministic, depth-first nature of CoT.
  • Switching Modes: The model can switch between "language mode" (standard token generation) and "latent mode" (continuous thought processing).

Datasets

The paper evaluates COCONUT on several datasets:

  • GSM8k: A dataset of grade-school math word problems.
  • ProntoQA: A logical reasoning dataset.
  • ProsQA: A newly introduced logical reasoning dataset designed to be more challenging, featuring a directed acyclic graph (DAG) structure that requires sophisticated planning and search.

Key Insights and Ideas

  • Latent Space is Better for Planning: By delaying deterministic decisions and allowing exploration of multiple paths, latent reasoning significantly improves the model's ability to differentiate correct from incorrect reasoning paths, especially in complex planning tasks.
  • Emergent BFS Behavior: COCONUT's continuous thoughts can encode multiple alternative next steps, leading to an emergent breadth-first search-like reasoning process. This allows the model to explore and prune possibilities more effectively than CoT's linear approach.
  • Efficiency Gains: COCONUT can achieve higher accuracy with fewer generated tokens compared to CoT, indicating better reasoning efficiency.
  • Continuous Thoughts as Efficient Representations: The paper suggests that continuous thoughts are more efficient representations of reasoning steps than language tokens, potentially capturing intermediate variables or multiple reasoning traces.

Key Results

  • Improved Accuracy: COCONUT consistently outperforms CoT and other baselines on logical reasoning tasks like ProsQA, especially as the number of continuous thoughts increases. For example, on ProsQA, COCONUT with 6 continuous thoughts achieved higher accuracy than CoT.
  • Better Efficiency: COCONUT generates fewer tokens while achieving comparable or better accuracy. For instance, on ProntoQA, COCONUT achieved 99.8% accuracy with 9 tokens, while CoT achieved 92.5% with 49.4 tokens.
  • GSM8k Performance: While CoT has an advantage on GSM8k due to its alignment with language pre-training, COCONUT still offers a superior trade-off between accuracy and efficiency.
  • Latent Tree Search: Analysis of latent reasoning reveals a tree search pattern where the model explores multiple paths in parallel, with this parallelism being more pronounced in the early stages of reasoning.

Limitations and Future Work

  • Training Complexity: The multi-stage training curriculum is crucial for COCONUT's success. Research is needed to develop better and more general strategies for learning latent reasoning, potentially without relying on language supervision.
  • Scalability with More Thoughts: Increasing the number of continuous thoughts (c) beyond a certain point can lead to performance drops and instability, suggesting a need for finer-grained schedules.
  • Integration with Larger Models: While COCONUT shows promise with larger Llama models, the gains are less pronounced, possibly because these models have already undergone extensive language pre-training.
  • Latent Space Pre-training: The authors emphasize that further research into latent space pre-training, optimized specifically for reasoning, is needed to universally surpass language-based CoT. Integrating recent advancements in latent representation learning with COCONUT is a promising future direction.

Summary updated

BibTeX
@inproceedings{hao2025training,
  author = {Shibo Hao and Sainbayar Sukhbaatar and DiJia Su and Xian Li and Zhiting Hu and Jason E Weston and Yuandong Tian},
  title = {{Training Large Language Models to Reason in a Continuous Latent Space}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=Itxz7S4Ip3},
}
Figure