Abstract
Recent advancements in Large Language Models (LLMs), such as OpenAI’s o1 and DeepSeek-R1, have demonstrated the power of "slow-thinking" through long Chain-of-Thought (CoT) reasoning. However, eliciting these capabilities typically requires extensive Supervised Fine-Tuning (SFT) on high-quality, domain-specific data. This paper introduces GLoRE (General Long CoT Reasoning via Representation Engineering), a training-free method that activates latent long CoT capabilities within existing LLMs. By injecting contrastive reasoning patterns and domain-specific context directly into the model's hidden states, GLoRE achieves state-of-the-art reasoning performance across diverse domains without the overhead of fine-tuning.
Introduction
The emergence of models capable of complex planning, validation, and backtracking has set a new standard for reasoning in artificial intelligence. While these "slow-thinking" behaviors are highly desirable, they are traditionally difficult to induce in open-source models. The standard approach involves Supervised Fine-Tuning (SFT) on thousands of long CoT examples, which is both computationally expensive and data-intensive, particularly for niche scientific domains like advanced biology or chemistry.
This research investigates whether long CoT reasoning is a general capability already encoded within the latent weights of LLMs. If so, can this capability be activated across any domain without domain-specific long CoT training data? The authors propose GLoRE as a solution to "switch on" these latent reasoning modes using Representation Engineering (RepE).
Methodology: The GLoRE Framework
GLoRE operates by analyzing and manipulating the internal hidden states (representations) of an LLM during the inference process. It is a training-free approach consisting of two primary components:
1. Contrastive Reasoning Pattern Representation
To isolate the "how" of slow-thinking, the authors compare the hidden states of vanilla (short) CoTs and long CoTs from a high-resource domain (Mathematics). By calculating the difference between these states, they identify a "long CoT direction" vector. During inference, this vector is injected into the representation of the first token at an intermediate layer. This serves as a global switch, steering the model into a deliberate reasoning mode.
2. Question-Aware Domain-Specific Representation
While the reasoning pattern is general, the model still requires domain-specific context to be effective. Since long CoT data is scarce in specialized sciences, GLoRE utilizes a memory bank of easily obtainable vanilla CoTs. At inference time, the system retrieves the top-$k$ similar vanilla CoTs for a given prompt and injects their average representation into the final token. This decouples the general reasoning structure from the specific subject matter.
Experimental Setup and Results
The authors evaluated GLoRE using Qwen2.5-7B-Instruct and Llama3.1-8B-Instruct across several challenging benchmarks:
- In-Domain (Math): MATHOAI, AIME2024, and AMC2023.
- Cross-Domain (Science): GPQA Diamond set (graduate-level Physics, Chemistry, and Biology).
Key Performance Metrics
GLoRE consistently outperformed Zero-shot CoT, Few-shot CoT, and even SFT baselines. Notably, it maintained the $O(p^2)$ time complexity of zero-shot prompting, avoiding the context window bloat associated with few-shot methods.
- Qwen2.5-7B-Instruct: Math accuracy improved from 44.54% (zero-shot) to 54.29% (GLoRE), surpassing the SFT baseline of 52.71%. On GPQA, accuracy rose from 30.81% to 36.36%.
- Llama3.1-8B-Instruct: Math accuracy increased from 27.18% to 34.42%, while GPQA performance jumped from 20.20% to 30.30%.
Beyond accuracy, GLoRE-steered models exhibited a clear behavioral shift, generating significantly more output tokens and mimicking the backtracking and self-correction behaviors seen in specialized reasoning models.
Latent Space Insights
The study provides several critical insights into how LLMs process reasoning:
- Distinct Latent Spaces: Long CoTs and vanilla CoTs occupy separable areas of the model's representation space, suggesting that LLMs treat deep reasoning as a distinct cognitive mode.
- Universal Reasoning Shift: The vector pointing from vanilla to long CoT is remarkably consistent across different domains, indicating that the "slow-thinking" pattern is highly transferable.
- The Role of Middle Layers: The separation between reasoning modes is most pronounced in the middle layers of the Transformer. These layers are responsible for integrating lexical features into high-level semantic concepts, making them the optimal site for representation injection.
- Domain Dispersion: While math representations are tightly clustered, science domains (physics/chemistry) are more dispersed, highlighting the necessity of the domain-specific context injection step in GLoRE.
Limitations and Future Work
As a white-box method, GLoRE requires access to the model's internal hidden states, meaning it cannot currently be applied to closed-source API models like GPT-4. Additionally, the current study focused on 7B and 8B parameter models. Future research may explore scaling GLoRE to larger open-weight models (e.g., Llama-3-70B) and extending the technique to non-STEM fields such as legal reasoning or formal logic.
Conclusion
GLoRE demonstrates that long Chain-of-Thought reasoning is a latent, generalizable capability within LLMs that can be unlocked without expensive fine-tuning. By leveraging Representation Engineering to steer the model's internal states, GLoRE provides a computationally efficient path toward more transparent and controllable "slow-thinking" in artificial intelligence.
Summary updated