Zing Forum

Reading

Reasoning Trajectory Geometry: A Journey to Track the Hidden State Space of Large Models' Chain-of-Thought

This project provides analysis code to track how reasoning models move in the hidden state space during Chain-of-Thought (CoT) generation, helping to understand the reasoning mechanisms of large language models.

推理模型思维链隐藏状态可解释性轨迹分析Chain-of-Thought神经网络可视化
Published 2026-06-04 10:28Recent activity 2026-06-04 10:56Estimated read 10 min
Reasoning Trajectory Geometry: A Journey to Track the Hidden State Space of Large Models' Chain-of-Thought
1

Section 01

Introduction: Reasoning Trajectory Geometry — Unveiling the Hidden State Space of Large Models' Chain-of-Thought

Introduction to the Reasoning Trajectory Geometry Project

This project is named reasoning-trajectory-geometry, developed and maintained by gjoelbye, open-sourced on GitHub (link), and released on June 4, 2026.

Its core goal is to help understand the internal mechanisms of reasoning models and improve AI interpretability by tracking the hidden state space trajectory of large language models during Chain-of-Thought (CoT) generation. The project provides analysis code, focusing on the geometric feature analysis of reasoning trajectories, and is a cutting-edge exploration in AI interpretability research.

Keywords: reasoning model, Chain-of-Thought, hidden state, interpretability, trajectory analysis, Chain-of-Thought, neural network visualization

2

Section 02

Background: The Black Box Dilemma of Reasoning Models — The Hidden State Puzzle Behind Chain-of-Thought

Background: The Black Box Problem of Reasoning Models

With the rise of reasoning models like DeepSeek-R1 and OpenAI o1/o3, large language models have made leaps in performance on complex tasks (mathematics, programming, logical reasoning), and their key feature is generating Chain-of-Thought (CoT) — showing the reasoning process before giving the final answer.

However, Chain-of-Thought is only a surface presentation; there are still many unsolved mysteries about the changes in internal hidden states:

  • How does the model transition from the problem statement to intermediate reasoning steps?
  • How are different reasoning paths distributed in the hidden state space?
  • Are the state space patterns of wrong and correct reasoning distinguishable?
  • Does the model backtrack or revise its thinking during reasoning?

The answers to these questions are hidden in internal representations and cannot be directly revealed by standard outputs.

3

Section 03

Core Concepts and Technical Methods: How to Track Reasoning Trajectories?

Core Concepts and Technical Methods

Core Concept: Reasoning Trajectory

Each step of the model's Chain-of-Thought generation is regarded as a point in the state space; connecting these points forms a trajectory that represents the dynamic evolution of the reasoning process. The internal structure is revealed by analyzing the geometric characteristics of the trajectory.

Technical Methods

  1. Hidden State Extraction: Capture the hidden layer activation values (high-dimensional vectors) when the model generates each token, focusing on the output of the middle or last layer of the Transformer.
  2. Dimensionality Reduction and Visualization: Use PCA (Principal Component Analysis), t-SNE/UMAP (non-linear dimensionality reduction), and trajectory smoothing to handle high-dimensional noise.
  3. Geometric Analysis: Analyze trajectory length, curvature changes, clustering (key stay points), and comparison between correct and wrong reasoning paths.
4

Section 04

Potential Findings and Insights: What Secrets Can Reasoning Trajectories Reveal?

Potential Findings and Insights

Based on existing research knowledge, the project may reveal the following insights:

  1. Structured Reasoning Stages: The trajectory shows obvious stages (understanding → planning → execution → verification), each corresponding to a different region in the state space.
  2. Epiphany Moment Detection: Sudden turns (high curvature points), jumps from wrong to correct regions, and significant speed changes in the trajectory may represent 'epiphanies'.
  3. Error Pattern Classification: Directional errors (wrong initial path), deviation errors (midway deviation), premature convergence (conclusion without sufficient reasoning).
  4. Inter-model Comparison: Supports trajectory comparison between reasoning models and base models, as well as models of different scales/training methods, revealing the state space performance of reasoning capabilities.
5

Section 05

Application Value and Usage Scenarios: Who Can Benefit from This?

Application Value and Usage Scenarios

Application Value

  • Model Understanding: Improve interpretability, objectively evaluate reasoning quality, and diagnose error causes.
  • Model Improvement: Optimize training strategies, design reasoning-friendly architectures, and develop trajectory error correction mechanisms.
  • Educational Applications: Visualize reasoning processes to assist teaching, compare human and AI reasoning patterns, and interactively explore model thinking.

Usage Scenarios

Target users include:

  • AI researchers: Understand mechanisms, verify hypotheses, and discover new directions.
  • Model developers: Diagnose task performance, compare training strategies, and optimize reasoning efficiency.
  • Educators: Create visual teaching materials, help students understand AI thinking, and explore similarities and differences between human and machine reasoning.
6

Section 06

Limitations and Challenges: Where Are the Boundaries of Trajectory Analysis?

Limitations and Challenges

Technical Challenges

  • Curse of Dimensionality: Hidden states have extremely high dimensions, and dimensionality reduction may lose key information.
  • Dynamic Nature: Trajectories from different inputs are difficult to compare directly.
  • Computational Cost: Extracting and analyzing hidden states requires a lot of computational resources.

Interpretation Challenges

  • Correlation vs. Causality: Do geometric patterns truly reflect reasoning mechanisms?
  • Over-interpretation: Avoid assigning unreasonable semantics to trajectory patterns.
  • Generalization: Are findings from specific models/tasks applicable to other scenarios?
7

Section 07

Future Outlook and Conclusion: Towards More Transparent AI Reasoning

Future Outlook and Conclusion

Future Outlook

  • Real-time Tracking: Real-time visualization of trajectories during reasoning.
  • Intervention Mechanisms: Dynamically adjust model behavior based on trajectory analysis.
  • Cross-modal Expansion: Apply to multi-modal reasoning scenarios.
  • Human-Machine Collaboration: Use trajectory analysis to guide human-machine collaboration.

Conclusion

The reasoning-trajectory-geometry project represents the cutting edge of AI interpretability research, transforming abstract reasoning into analyzable geometric trajectories and bringing us closer to understanding the 'thinking process' of LLMs. Although we cannot fully 'read' every thought of the model, such tools are important progress and deserve attention and contributions.