Understanding Reasoning in Thinking Language Models via Steering Vectors

Constantin Venhoff, Iván Arcuschin, Philip Torr, Arthur Conmy, Neel Nanda

TL;DR

This paper investigates the "thinking" mechanisms of Large Language Models (LLMs) that generate step-by-step reasoning chains. By analyzing DeepSeek-R1 models and comparing them to non-thinking models like GPT-4o, the authors identify unique reasoning behaviors such as expressing uncertainty and backtracking. They then demonstrate that these behaviors can be precisely controlled by manipulating specific directions (steering vectors) in the model's internal activations, offering a new way to understand and steer LLM reasoning.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly capable of complex reasoning, often by generating explicit chains of thought before providing an answer. These "thinking LLMs" show improved performance, but how they achieve this remains a black box. Understanding the internal mechanisms that enable this reasoning is crucial for developing more reliable, controllable, and interpretable AI systems. The paper aims to bridge this gap by dissecting the reasoning processes of a specific thinking LLM (DeepSeek-R1) and comparing it to a non-thinking LLM (GPT-4o), then exploring methods to control these reasoning behaviors.

Methods

The core of the paper's methodology involves:

  • Behavioral Analysis: The researchers manually and automatically analyzed reasoning chains from DeepSeek-R1 and GPT-4o across 300 tasks. They identified and categorized distinct reasoning patterns, such as "Initialization," "Deduction," "Knowledge Augmentation," "Example Testing," "Uncertainty Estimation," and "Backtracking."
  • Steering Vector Extraction: They employed the "Difference of Means" method to extract "steering vectors." These vectors represent linear directions in the model's activation space that correspond to specific reasoning behaviors. The idea is that by adding or subtracting these vectors to the model's activations, one can influence the manifestation of that behavior.
  • Attribution Patching: To pinpoint which parts of the model (specific layers and token positions) are causally responsible for these behaviors, they used attribution patching. This technique involves intervening in the model's activations and observing the effect on the output.
  • Steering Vector Application: The extracted steering vectors were then applied during inference to modulate the model's reasoning. This involved adding or subtracting the vectors to the residual stream activations at selected layers.

Datasets

  • Task Generation: The authors generated a dataset of 300 tasks across 10 diverse categories (Mathematical Logic, Spatial Reasoning, Verbal Logic, Pattern Recognition, Lateral Thinking, Causal Reasoning, Probabilistic Thinking, Systems Thinking, Creative Problem Solving, Scientific Reasoning) using Claude 3.5 Sonnet.
  • Model Training/Evaluation: The study primarily used two distilled models of DeepSeek-R1: DeepSeek-R1-Distill-Qwen-14B and DeepSeek-R1-Distill-Llama-8B. For comparison, GPT-4o was also used.

Key Insights and Ideas

  • Distinct Reasoning Patterns: Thinking LLMs like DeepSeek-R1 exhibit unique reasoning behaviors not commonly found in non-thinking models like GPT-4o. These include explicitly stating uncertainty and backtracking to revise their approach.
  • Linearity of Reasoning: The paper strongly suggests that these distinct reasoning behaviors are encoded as linear directions within the model's activation space. This is a significant finding because linear directions are much easier to interpret and manipulate than complex, non-linear relationships.
  • Steering Vectors as Control Knobs: Steering vectors provide a powerful and interpretable way to control these reasoning behaviors. By applying these vectors, researchers can reliably increase or decrease specific patterns like backtracking or uncertainty estimation.
  • Causal Attribution: Attribution patching successfully identified the specific layers and token positions where these reasoning behaviors are most active, providing a fine-grained understanding of their neural correlates.

Key Results

  • Behavioral Differences: Figure 2 clearly shows that "Uncertainty Estimation" and "Backtracking" are behaviors almost exclusive to the thinking model (DeepSeek-R1-Distill), while GPT-4o relies more on "Adding Knowledge." "Example Testing" is also more prevalent in DeepSeek-R1.
  • Effective Steering: Figure 4 demonstrates that applying positive steering vectors significantly increases behaviors like backtracking and uncertainty estimation, while negative steering suppresses them. This effect is consistent across both DeepSeek-R1 distilled models. For instance, positive steering on the "Backtracking" vector increased its occurrence, while negative steering reduced it.
  • Layer-wise Impact: Figure 3 shows that the causal impact of steering vectors is often concentrated in specific layers of the model, with peaks in the middle layers for most reasoning mechanisms.

Limitations and Future Work

  • Annotation Accuracy: The automated annotation process using GPT-4o, while efficient, occasionally produced false positives and negatives. Future work could explore more robust annotation methods, potentially involving multiple models or human validation.
  • Generalization: The study focused on DeepSeek-R1 and its distilled variants. Investigating whether these findings generalize to other thinking models (e.g., OpenAI's 01, Qwen's QwQ) is an important next step.
  • Broader Applications: The authors suggest that the ability to precisely control reasoning aspects opens possibilities for adapting models to specific tasks and requirements, hinting at future applications in fine-tuning and customizing LLM behavior.

Summary updated

BibTeX
@inproceedings{venhoff2025understanding,
  author = {Constantin Venhoff and Iván Arcuschin and Philip Torr and Arthur Conmy and Neel Nanda},
  title = {{Understanding Reasoning in Thinking Language Models via Steering Vectors}},
  booktitle = {LLM Reason and Plan @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=OwhVWNOBcz},
}
Figure