Structural Chain-of-Thought: Reasoning with Executable Computational Graphs

Petr Senatorov, Karim Vafin, Elena Tutubalina, Oleg SomovarXiv 2026

TL;DR

This paper introduces Structural Chain-of-Thought (SCoT), a framework where Large Language Models (LLMs) generate executable computational graphs instead of free-form text reasoning. By training models with graph-specific reinforcement learning, the authors achieve up to a 6x reduction in generation length and significantly higher reasoning faithfulness compared to standard chain-of-thought methods.

What Problem Does This Paper Address?

While Chain-of-Thought (CoT) prompting has revolutionized LLM reasoning, it suffers from three major flaws:

  1. Verifiability: Free-form text is hard to check automatically. Did the model actually follow the logic it wrote down?
  2. Efficiency: CoT traces are often extremely verbose, leading to high latency and compute costs.
  3. Faithfulness: Models often engage in "post-hoc rationalization," where the generated reasoning trace doesn't actually reflect the internal process used to reach the answer.

The authors propose moving away from "yapping" in natural language and toward generating structured, directed acyclic graphs (DAGs) where each node is a discrete computational step.

Figure 1: Comparison between free-form reasoning and computational graph representations for solving a natural-language arithmetic problem.

Methods

The researchers developed a two-stage training pipeline:

  • Stage 1: Supervised Fine-Tuning (SFT): Models are first trained on (problem, graph, answer) triples to learn the required JSON-like graph format.
  • Stage 2: Graph-Based GRPO: They extend Group Relative Policy Optimization (GRPO) with a composite reward function. This function doesn't just look at the final answer; it rewards:
  • Style: Is the output a valid, executable JSON graph?
  • Correctness: Does executing the graph yield the right answer?
  • Overlap: Do the intermediate nodes match the values in a reference "gold" graph? (This prevents the model from taking "shortcuts").
  • Faithfulness: Does the model's explicitly stated answer match the result of its own generated graph?

Datasets

The framework was evaluated across five benchmarks using four model families (Gemma 2, Falcon 3, Llama 3.2, and Qwen 3):

  • GSM8k+: A modified version of the classic grade-school math dataset where operators (+, -, *, /) are redefined as linear combinations to prevent the model from simply memorizing answers.
  • iGSM: Procedurally generated modular arithmetic problems designed to resist memorization.
  • MATH: High-school competition-level math problems.
  • Entailment & ProofWriter: Logic-based tasks where the graph represents an entailment structure rather than a numerical calculation.

Key Insights and Ideas

  • Graphs as an Inductive Bias: For tasks like multi-step arithmetic or logic, a graph is a more natural representation than a sentence. It forces the model to define explicit dependencies.
  • The "Memorization" Trap: The authors found that on the standard MATH dataset, free-form CoT often outperformed their graph method. Their "Contamination Audit" revealed why: models have memorized the text solutions for MATH. When forced to use a graph (which they haven't seen in pre-training), they can't rely on recall and must actually reason.
  • Compactness is a Feature: RL training naturally pushes the model toward more concise graphs. Because every node in a graph must be "used" to reach the final answer, there is no room for the "hallucinated verbosity" often seen in small models using CoT.

Key Results

  • Efficiency: SCoT reduced generation length by 5-6x compared to standard GRPO and CoT SFT.
  • Accuracy: Graph-Based GRPO consistently outperformed supervised graph training (Graph SFT) across all datasets. On the iGSM benchmark, accuracy jumped from 0.47 to 0.59.
  • Faithfulness: In intervention experiments (where researchers manually edited the model's generated graph), the model's final answer changed to match the new graph output much more reliably than in text-based CoT. This suggests the model is truly "looking" at its graph to find the answer.
Figure 2: Accuracy/Overall AllCorrect (top) and gen- eration length (bottom, log scale), averaged over the four models; error bars give the spread across models. Graph-Based GRPO leads on four of five datasets at among the lowest token cost; MATH is the exception. Tree-of-Thoughts and Answer-only SFT are omitted for scale and because the latter emits no reasoning. Full results: Tables 2 and 8.

The robustness of the method is further highlighted by its performance on longer, more complex problems. While all models struggle as the "gold" graph length increases, Graph-Based GRPO remains significantly more robust than SFT-only approaches.

Accuracy stratified by gold graph length.

Limitations and Future Work

  • Domain Specificity: This approach is currently limited to tasks that can be represented as computational graphs (math, logic, structured QA). It is less applicable to open-ended creative writing or qualitative linguistic reasoning.
  • The "MATH" Gap: The underperformance on the MATH dataset suggests that when high-quality natural language solutions are available in the training data, models still prefer them. Improving reward functions to bridge this gap is a key area for future research.
  • Graph Design: The authors note that the specific design of the reward functions and the graph schema itself still have "substantial room for improvement."

Summary updated

BibTeX
@misc{senatorov2026structural,
  author = {Petr Senatorov and Karim Vafin and Elena Tutubalina and Oleg Somov},
  title = {{Structural Chain-of-Thought: Reasoning with Executable Computational Graphs}},
  year = {2026},
  eprint = {2610.15107},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.15107},
}
Figure