TL;DR
While Chain-of-Thought (CoT) prompting frames large language model (LLM) reasoning as a sequential line of text, real-world logic behaves more like a network. This paper introduces Reasoning DAG Probing, a framework demonstrating that LLMs internally encode multi-step reasoning as non-linear Directed Acyclic Graphs (DAGs). The authors show that these graph structures are linearly accessible within intermediate layers and that the clarity of this internal structure directly anticipates whether a model will generate a correct answer.
What Problem Does This Paper Address?
The dominant paradigm for LLM reasoning is Chain-of-Thought (CoT)—prompting models to generate intermediate steps sequentially. However, real reasoning is rarely a simple linear chain; it involves branching logic, parallel premises that merge to form a conclusion, and the reuse of intermediate results. These relationships are naturally captured by Directed Acyclic Graphs (DAGs).
Because an LLM's generated text can be incomplete, post-hoc, or unfaithful to its actual computation, we cannot rely on text alone to understand how models reason. This paper investigates a fundamental question: Do the internal hidden states of LLMs actually encode the non-linear graph structure of a reasoning problem, or are they purely sequential token processors?
Methods
The authors propose Reasoning DAG Probing, a framework designed to test whether LLM hidden states linearly encode the structural properties of an underlying reasoning graph.
The pipeline consists of four main steps:
- DAG Formalization: Premises, intermediate conclusions, and final answers are mapped as nodes in a DAG, where directed edges represent dependency relations.
- Representation Extraction: The text of the reasoning problem is fed into a frozen LLM, and mean-pooled hidden states are extracted for the token spans corresponding to each node.
- Structural Probing: Low-capacity, rank-1 linear probes are trained on these hidden states to predict three graph-theoretic properties:
- Node Depth: The node's relative position in the reasoning hierarchy.
- Pairwise Distance: How far apart two states lie in the dependency structure.
- Pairwise Adjacency: Whether two nodes are directly connected by an edge.
- Graph Reconstruction: The predicted properties are used to build an approximate reasoning graph, which is then compared against the ground truth.
To ensure the probes capture genuine structural geometry rather than superficial text correlations, the main method is compared against three strict baselines: a node-only setting (no context), a bag-of-words baseline, and a label-shuffled control.
Datasets
The framework was evaluated across three distinct reasoning domains:
- ProofWriter: A logical deduction benchmark with explicit, rule-based natural language inference steps. This serves as the primary, highly controlled testbed.
- GSM8K: Grade-school math word problems, representing out-of-domain arithmetic reasoning. DAGs were automatically extracted from solutions using an LLM prompt.
- TACO: An algorithmic code-generation dataset used to evaluate program-dependence DAGs (data and control dependencies) during code synthesis.
Key Insights and Ideas
- Reasoning is Geometrically Embedded: LLMs don't just process text sequentially; they construct a coherent internal geometric map of logical dependencies that can be extracted via simple linear transformations.
- The "Goldilocks" Layers: Graph structure is not uniformly distributed across an LLM. Representational accuracy improves rapidly in early layers, peaks concurrently in a broad band of intermediate layers (around layer 25 in a 40-layer model), and mildly declines in the final layers as the model shifts toward token-generation objectives.
- Progressive Reallocation of Capacity: Probing across layers reveals a clear hierarchical progression. Earlier layers resolve shallow, local node positions, whereas later layers preferentially organize deeper nodes and long-range global dependencies.
- Internal Structure Predicts Success: During autoregressive token generation, models that ultimately produce correct answers show a steadily strengthening internal DAG structure. Conversely, incorrect generations exhibit flat or stagnant graph recoverability, providing a structural view of answer failure before the final token is even produced.
Key Results
- Baseline Outperformance: On ProofWriter, the main probing method drastically outperformed all baselines. Label shuffling caused performance to collapse entirely, confirming that probe success depends on systematic alignment between hidden states and DAG geometry rather than probe capacity.
- Model Scale and Training Matter: Larger models consistently show stronger DAG recoverability. When analyzing generation-time dynamics across a Qwen3 size sweep (0.6B to 14B) and other model families (K2-Think, Phi-4-reasoning, DeepSeek-R1-Distill), larger and reasoning-optimized models demonstrated both higher baseline graph F1 scores and more sustained structural gains during generation.
Limitations and Future Work
- Structured vs. Naturalistic Reasoning: The study relies on datasets where reasoning chains can be explicitly formalized into clean DAGs (logic, math, code). Extending this framework to open-ended, ambiguous, or naturalistic discourse remains an open challenge.
- Simple Graph Metrics: The probes currently target basic properties like depth, distance, and adjacency. Future work could explore richer semantic properties, such as probing for specific logical rule types or edge semantics.
- Moving from Probing to Intervention: Because internal DAG structures are not directly visible at test time, a promising future direction is leveraging these findings for representation-level interventions or decoding strategies that force the model to better align its text generation with its internal structural representations.
Summary updated