Topology of Reasoning: Understanding Large Reasoning Models through Reasoning Graph Properties

Gouki Minegishi, Hiroki Furuta, Takeshi Kojima, Yusuke Iwasawa, Yutaka Matsuo · DOI

Abstract

The emergence of large reasoning models, such as OpenAI’s o1 and DeepSeek-R1, marks a significant shift in artificial intelligence from simple next-token prediction to extended internal deliberation. However, the internal mechanics of this "thinking" process remain largely opaque. This paper introduces "reasoning graphs"—a framework for visualizing and quantifying an LLM's internal state transitions by clustering hidden representations. Our analysis reveals that high-performing reasoning models exhibit distinct topological properties: significantly higher cyclicity (representing self-correction or "aha moments"), larger exploration diameters, and a "small-world" organizational structure. These findings provide a formal topological basis for understanding how test-time scaling and specialized fine-tuning enhance machine intelligence.

Introduction

The transition from standard Large Language Models (LLMs) to specialized reasoning models has fundamentally changed how we evaluate AI performance. While standard models often follow a linear path to an answer, reasoning models engage in complex internal behaviors like backtracking, verification, and self-correction. Despite their success on benchmarks like GSM8K and AIME, the structural differences in their internal computations have remained a "black box."

Minegishi et al. address this by proposing a graph-theoretic approach to map the "topology of reasoning." By treating sequences of hidden states as trajectories through a high-dimensional space, they extract discrete reasoning graphs that characterize the model's internal logic.

Conceptual comparison of reasoning graphs in base vs. reasoning models, highlighting the emergence of cycles and broader exploration.

Methodology: Constructing the Reasoning Graph

To move from continuous hidden states to a discrete graph, the researchers developed a multi-step pipeline to extract and analyze internal representations:

  1. State Extraction: Hidden state representations are captured from a specific Transformer layer (typically at 90% depth) at each reasoning step, often delimited by newlines in the Chain-of-Thought (CoT) output.
  2. Node Definition: High-dimensional states are grouped into discrete "nodes" using K-means clustering. These nodes represent specific computational modes, such as "Multiplicative," "Additive," or "Wait/Re-evaluation."
  3. Edge Construction: Directed edges are drawn between nodes based on the temporal sequence in which the model visits these states during problem-solving.
  4. Topological Metrics: The resulting graphs are analyzed using three primary metrics: Cyclicity (frequency of recurrent paths), Diameter (breadth of state-space exploration), and the Small-World Index (efficiency of network organization).
The pipeline for extracting reasoning graphs from LLM hidden layers and examples of representative nodes identified through clustering.

Key Insights: The "Aha Moment" and Small-World Thought

The topological analysis yielded several groundbreaking insights into the nature of machine reasoning.

The "Aha Moment" as a Cycle

One of the most striking findings is the prevalence of cycles in reasoning models. While base models are almost entirely acyclic—moving linearly from question to answer—reasoning models like DeepSeek-R1-Distill-Qwen-32B exhibit an average of five cycles per sample. These cycles correspond to moments where the model identifies an error or a more promising path, effectively "looping back" to a previous state of understanding to find a new trajectory.

Reasoning as a Small World

Reasoning graphs demonstrate a small-world index approximately six times higher than that of base models. This suggests that the model's internal logic is organized into dense clusters of specialized thought (e.g., handling a specific sub-calculation) connected by efficient long-range jumps to other parts of the problem-solving process. This structure allows for both deep local processing and flexible global navigation.

Exploration and Accuracy

As the difficulty of tasks increases—from grade-school math (GSM8K) to competition-level problems (AIME)—the graph diameter and cycle count of reasoning models grow. Larger models (e.g., 32B vs. 1.5B) tend to explore a much wider variety of internal states, which correlates strongly with their higher success rates. However, the researchers noted that not all cyclicity is productive; for instance, "language mixing" loops can increase cycle counts without improving accuracy.

Impact of Fine-Tuning and Data

The study also examined the impact of Supervised Fine-Tuning (SFT) using the s1 dataset. They found that high-quality reasoning data systematically expands the reasoning graph diameter. This implies that effective training doesn't just provide the model with more facts, but actually teaches it to navigate a broader and more complex internal state space, enabling the exploration necessary for difficult multi-step problems.

Conclusion

By bridging graph theory with mechanistic interpretability, this work provides a new "thermometer" for measuring machine intelligence. It suggests that the hallmark of a true reasoning model is not just the correctness of its final output, but the topological complexity and efficiency of the journey it takes to get there. Future work may look deeper into the "circuit-level" features of these nodes and how these complex topologies emerge during the training process.

Summary updated

BibTeX
@inproceedings{minegishi2025topology,
  author = {Gouki Minegishi and Hiroki Furuta and Takeshi Kojima and Yusuke Iwasawa and Yutaka Matsuo},
  title = {{Topology of Reasoning: Understanding Large Reasoning Models through Reasoning Graph Properties}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=o1g8NWkxqf},
}
Figure