METAL LAB

SHAPE of Chain-of-Thought in Math Reasoning

arXiv:2608.286002026-09-01

A framework that tags each step of an AI's math 'thinking' with what mathematical move it's making and what interpretation it's stuck in, revealing why some reasoning succeeds and why RL training narrows a model's strategies

SHAPE breaks down an LLM's chain-of-thought into 'semantic spaces' (how it currently frames the problem, e.g. algebraically or geometrically) and 'heuristics' (concrete moves like working backward or simplifying) borrowed from math-education research. Using an automated labeling pipeline, the authors show these heuristic-based features predict whether an answer is correct better than surface features like reasoning length, and that correct answers tend to stay within a few semantic spaces rather than wandering. They also find that reinforcement learning post-training squeezes models into a narrower set of heuristics already present in the base model, and that explicitly feeding heuristics into training (HA-Plan-GRPO) improves accuracy over a plain planning baseline.

METAL LAB explanatory visual

How SHAPE turns a chain-of-thought into measurable structure

Evidence statusMeasured results and planned work

  1. Raw CoT trajectoryThe step-by-step text a model writes while solving a math problem
  2. Segment into content unitsBreak the text into the smallest spans that represent one problem-solving move
  3. Tag heuristicsLabel each unit with the mathematical actions it performs, such as working backward or introducing a representation
  4. Track semantic spacesClassify each unit as New, Return, or Maintain relative to the model's evolving interpretation of the problem
  5. Compute metrics & apply to trainingDerive correctness-predicting features, measure post-training's Density/Coverage narrowing, and feed heuristics back into GRPO rollout prompts
An explanatory diagram made by METAL LAB, not a figure supplied by the paper's authors.

What they did

  1. SHAPE analyzes chain-of-thought text using two math-education concepts: semantic spaces (the model's current mathematical interpretation of the problem, e.g. algebraic vs. geometric) and heuristics (specific actions like working backward, introducing symbols, or checking cases).
  2. An automated pipeline (built with models like Grok-4.1-Fast and Qwen3.5-27B) segments CoT text into content units, tags each with heuristic labels, and tracks whether each unit opens a new semantic space, returns to an old one, or maintains the current one; this was validated against a hand-annotated gold set of 48 trajectories.
  3. Logistic regression trained on SHAPE's heuristic-frequency features predicted correctness with AUROC 0.664, beating CoT length (0.504), length+reasoning-token features (0.503), self-revision markers like 'wait'/'aha' (0.618), and the episode-label baseline ThinkARM (0.618).
  4. Comparing base vs. RL-trained (Think-RLVR) model trajectories using Density/Coverage metrics on heuristic usage showed Density above 1.0 and Coverage below 1.0 in every post-trained pair tested, meaning RL training concentrates successful trajectories into a denser but narrower slice of the base model's existing strategies rather than creating new ones; an unrelated-model control pair showed low Density (0.520) and low Coverage (0.437), confirming this pattern is specific to base-to-post-trained pairs.
  5. Training Qwen3-1.7B-Base with GRPO on MATH problems, a version that injects explicit heuristic hints into the rollout prompt (HA-Plan-GRPO) beat a heuristic-free planning-only version (Plan-GRPO) on Avg@64 and Pass@64 on the MATH-Perturb test set, in preliminary results.
Figure 1: Illustrative example of SHAPE annotation applied to a synthetic CoT trace. The solver first sets up an algebraic formulation (Space 1), introducing a system of equations. It then abandons this approach and switches to a trial-based counting strategy (Space 2). Finally, it returns to the algebraic formulation (Space 1) and solves the system. We refer to each problem-solving interpretation as a semantic space—a distinct mathematical interpretation defined by the objects, goals, and constraints the model adopts. Within each space, individual steps are tagged as heuristics—purposeful mathematical actions such as introducing a representation (H3a) or exploring particular cases (H9a)—or as non-heuristic steps such as stating the answer (N4). The arrows mark transitions between these spaces. For the full heuristic taxonomy, see Appendix A.
Figure 1: Illustrative example of SHAPE annotation applied to a synthetic CoT trace. The solver first sets up an algebraic formulation (Space 1), introducing a system of equations. It then abandons this approach and switches to a trial-based counting strategy (Space 2). Finally, it returns to the algebraic formulation (Space 1) and solves the system. We refer to each problem-solving interpretation as a semantic space—a distinct mathematical interpretation defined by the objects, goals, and constraints the model adopts. Within each space, individual steps are tagged as heuristics—purposeful mathematical actions such as introducing a representation (H3a) or exploring particular cases (H9a)—or as non-heuristic steps such as stating the answer (N4). The arrows mark transitions between these spaces. For the full heuristic taxonomy, see Appendix A.
Table 1: Correctness prediction under 5-fold stratified cross-validation. “Length + reasoning” includes CoT length together with reasoning features (reasoning-token count and proportion), while “Self-revision” includes self-revision features derived from lexical self-revision markers. Within SHAPE, H denotes the 11 heuristic categories (H1–H11) and N the non-heuristic category.
Feature SetAUROC ↑# Features
Length0.504±0.031
Length + reasoning0.503±0.033
Self-revision0.618±0.033
ThinkARM0.618±0.028
SHAPE (H)0.653±0.0211
SHAPE (H+N)0.664±0.0212
Figure 2: Overview of the automated SHAPE analysis pipeline. Given a Chain-of-Thought (CoT) trajectory, the pipeline first segments the text into content units corresponding to heuristic-bearing spans. It then assigns one or more heuristic labels to each unit using a tagging model. Finally, a semantic-space state tracking model classify the model’s mathematical interpretation change into Maintain, New, or Return.
Figure 2: Overview of the automated SHAPE analysis pipeline. Given a Chain-of-Thought (CoT) trajectory, the pipeline first segments the text into content units corresponding to heuristic-bearing spans. It then assigns one or more heuristic labels to each unit using a tagging model. Finally, a semantic-space state tracking model classify the model’s mathematical interpretation change into Maintain, New, or Return.
Table 2: Descriptive statistics of SHAPE metrics by correctness. Nspaceeff: effective number of semantic spaces; Ntranseff: effective number of semantic-space transitions; transition ratio ρ: measuring the intensity of revisiting semantic space. (C), (I), and (O) denote correct, incorrect, and overall trajectories.
NspaceeffNtranseffρ
Model(C)(I)(O)(C)(I)(O)(C)(I)(O)Acc.
Open-source reasoning models with full traces
Qwen3-32B2.082.282.161.381.531.440.510.500.51.63
DeepSeek-R11.722.472.000.821.641.120.340.510.41.63
QwQ-32B1.742.742.110.862.201.350.320.600.42.63
DeepSeek-R1-Distill-Qwen-32B1.852.071.951.021.211.100.380.410.40.57
DeepSeek-R1-Distill-Qwen-7B1.512.181.850.601.401.010.270.490.41.49
Deepseek-R1-Distill-Qwen-1.5B1.412.041.810.531.271.000.270.490.41.36
Phi-4-Reasoning2.032.832.531.152.101.750.350.580.49.35
Instruction-tuned models without extended reasoning
Qwen3-32B-NR1.661.741.710.700.750.730.290.330.32.34
Gemini-2.0-Flash1.431.581.530.430.590.540.200.280.25.34
Phi-41.141.511.410.140.510.410.070.230.19.29
Qwen-2.5-32B1.331.391.370.370.420.400.160.200.19.28
GPT-4o1.681.401.460.720.400.460.290.190.21.19
Proprietary reasoning models with hidden traces
Gemini-2.5-Flash1.561.911.670.590.910.690.280.350.30.67
GPT-o3-mini1.511.651.590.560.700.630.270.320.30.47
GPT-o1-mini1.361.581.500.360.610.520.190.290.25.37
Figure 3: Projection of successful Olmo-3-{Base, Think-RLVR} trajectories onto the first principal component of heuristic frequency space. Olmo-3-Think-RLVR concentrates around the peak of the base distribution while leaving the left tail uncovered, suggesting that post-training narrows rather than reshapes the heuristic distribution.
Figure 3: Projection of successful Olmo-3-{Base, Think-RLVR} trajectories onto the first principal component of heuristic frequency space. Olmo-3-Think-RLVR concentrates around the peak of the base distribution while leaving the left tail uncovered, suggesting that post-training narrows rather than reshapes the heuristic distribution.
Table 4: Density and Coverage of post-trained model trajectories relative to base model trajectories in heuristic frequency space (k=3, successful trajectories only, aggregated across all perturbation conditions). Density > 1 indicates that post-trained trajectories concentrate in the dense core of the base distribution; among such cases, lower Coverage indicates stronger mode-seeking. The cross-model baseline confirms that unrelated base models show neither high Density nor high Coverage.
BasePost-trainedNbaseNPTDensityCoverage
Post-trained
Qwen3-1.7B-BaseQwen3-1.7B-GRPO8348861.2200.871
Olmo-3-7BOlmo-3-7B-Think-RL-Zero122913071.2500.707
Olmo-3-7BOlmo-3-7B-Think-RLVR150716001.0320.531
Cross-model baseline (unrelated distributions)
Olmo-3-7BQwen3-1.7B-Base71660.5200.437
Table 5: Preliminary results for Heuristic-Augmented GRPO on the MATH-Perturb test split. Plan-GRPO adds a planning step without heuristic information. HA-Plan-GRPO provides eleven mathematical heuristics during rollout and incorporates them into a planning-guided rollout. Bold indicates the best results.
ModelOriginalSimpleHard
Avg@64Pass@64Avg@64Pass@64Avg@64Pass@64
Qwen3-1.7B-Base23.5477.4023.1079.1311.8457.39
+ Plan-GRPO30.0080.0029.8678.2614.5261.74
+ HA-Plan-GRPO (ours)36.8080.0035.8079.1317.7262.61
Table 6: Taxonomy of Problem-Solving Strategies. This table summarizes the code, strategy name, detailed description, and theoretical sources associated with each heuristic. Here, P = Pólya (1945), K = Koichu et al. (2007), F = Favier (2022), and P&K = Posamentier and Krulik (2008).
Strategy NameDescription & Sources
H1. Changing the register of semiotic representationThis strategy involves translating the problem’s representation from one semiotic register to another. It includes converting between natural language, algebraic, geometric, and visual representations to facilitate understanding or solving. Sources: Creating a model (K); Change the semiotic representation register (Changer de registre de représentation sémiotique) (F)
H2. Cognitive ReinterpretationThis involves changing the way an object or property in the problem is interpreted. It redefines the identity or attributes of an element in a way different from the initial presentation, without necessarily changing the register. Sources: Consider another way of interpreting the problem’s objects (Envisager une autre façon d’interpréter les objets du problème) (F); Adopting a different point of view (P&K)
H3. Introduce Symbolic Representation, Formalization, and Structural Augmentation, including…
H3a. Introduce Symbolic Representation and FormalizationThe act of introducing new variables, labeling unknowns, or performing substitutions to make ambiguous targets operationally manageable. Sources: Notation; Setting up equations (P); Creating a model (K); Introduce names or notations (Introduire des noms ou des notations) (F)
H3b. Structural AugmentationConstructing auxiliary objects, lemmas, or entirely new mathematical frameworks that are not present in the original problem. This is a creative addition to the problem space, such as drawing auxiliary lines, defining new functions, or shifting the problem into a new structural representation Sources: Auxiliary elements, Lemma (P); Introducing an auxiliary element (K); Introduce auxiliary elements (Introduire des éléments auxiliaires) (F)
H4. Problem Classification / Rephrase the Problem and Goal, including…
H4a. Problem Categorization / Strategic Rephrasing of Goal / Breaking into Sub-goalsExplicitly stating the problem type, identifying applicable solution methods, or reformulating the main goal in clearer mathematical terms. Sources:What is the unknown? (P); Reformuler le problème (Reformulate the problem) (F)
H4b. Filtering ConstraintsStrategically identifying the most essential constraints or conditions that guide the upcoming solution approach. Sources:Separate the various parts of the condition (P); Exploring a particular datum (K)
H5. Wishful Thinking (Simplify / Reduce the Problem and Conditions)Temporarily modifying the problem to a simpler version to gain insight, verify formulas, or explore solution strategies. Sources: If you cannot solve the proposed problem (P); Reduce the problem to a simpler one (Réduire le problème à un problème plus simple) (F)
H6. Explicit Case Analysis, Decompose into SubproblemsLogically decomposing the problem into distinct cases, non-overlapping subsets, or sub-problems that, when combined, yield the full solution. The cases should ideally be exhaustive and mutually exclusive. Sources: Decomposing and recombining (P); Décomposer le domaine du problème et travailler cas par cas (Decompose the problem domain and work case by case) (F)
H7. Arguing by contradictionA proof strategy where the negation of the proposition is assumed to derive a contradiction, thereby proving the original statement. Sources: Reductio ad absurdum and indirect proof (P); Arguing by contradiction (K)
H8. Analogy and Presenting Related Theorems, including…
H8a. AnalogyRecalling previously solved problems, known methods, or applying a recently established logical procedure to a new target within the same problem. This involves recognizing structural similarities and transferring a strategy from one context (or one part of the equation) to another. Sources: Have you seen it before?; Do you know a related problem? (P); Activating a previous experience (K); Make a connection with a previously encountered problem (Faire le lien avec un problème déjà rencontré) (F); Solving a simpler analogous problem (P&K)
H8b. Presenting Related Theorems, Tools, or PropertiesIntroducing specific mathematical theorems, formulas, identities, or properties that are not provided in the problem statement but are necessary to advance the solution. Sources: Connect with a mathematical tool (theorem, property) (Faire le lien avec un outil mathématique (théorème, propriété)) (F)
H9. Experimental and Pattern Exploration, including…
H9a. Exploring particular cases or numbersPlugging in specific values, extreme/boundary values, or limits to discover patterns, build intuition, or verify feasibility. Sources: Specialization (P); Partial Induction (K); Explore a specific piece of data (Explorer une donnée particulière) (F); Finding a Pattern (P&K)
H9b. Exploration of symmetryIdentifying and exploiting mathematical or structural symmetry to reduce the solution space or simplify computation. Sources: Symmetry (P); Exploration of Symmetry (K); Exploit symmetry properties (Exploiter les propriétés de symétrie) (F)
H10. Thinking from the end to the beginning (Working backward)Starting from the desired conclusion (target goal) and working logical steps backward to reach the known premises or to determine what would be sufficient to prove. Sources: Working backwards (P); Thinking Backward (K); Working backward (Travailler à reculons) (F); Working Backwards (P&K)
H11. Verification and Looking Back, including…
H11a. Re-solving & Checking the ArgumentRe-performing the same logical steps or calculations without a strategic change, or conducting a direct manual check of elements to verify a previous claim. Sources: Can you check the result? (P); Local Self-evaluating (K)
H11b. Deriving the Result DifferentlySolving the same problem or sub-goal using a structurally different mathematical method to provide independent confirmation. Sources: Can you derive the result differently? (P); Local Self-evaluating (K)
H11c. Backtracking for self-verificationRealizing an error, finding a flaw in an assumption, or recognizing that the current approach is not working, and revising the direction. Sources: Backtracking (Retour arrière) (F)
H11d. Checking the Result / Sanity Check / Progress ReviewBroadly covers any reflection on whether the solution is on the right track or checking feasibility. Sources: Can you check the result?; Test by dimension (P); Local Self-evaluating (K)
H11e. Generalization & CorollaryExtending the result to broader cases. Identifying general principles from specific solutions. Sources: Wisdom of proverbs (P); Generalization (K)
H11f. Reflect on Rigor & WisdomEvaluating the efficiency of the solution strategy, questioning the rigor, or meta-reflecting on definitions/rules. Sources: Why proofs? (P)
Table 8: Heuristic-tagging performance of candidate annotator models on the gold set. Weighted F1 reflects overall label agreement, while macro F1 emphasizes performance on rare heuristic classes.
ModelWeighted F1Macro F1
Grok-4.1-Fast76.9865.04
GPT-572.2563.55
GPT-5-mini66.4455.89
Gemini-3-Flash62.8341.79
Gemini-3-Flash-Lite70.2154.14
Qwen3.5-27B70.4461.36
Table 9: Class-wise heuristic-tagging performance of Qwen3.5-27B on the gold set. We report precision (P), recall (R), F1, Cohen’s kappa, and the number of gold and predicted instances.
ClassF1Kappa
H10.52720.4893
H20.43180.4176
H30.48840.4383
H40.61140.5049
H50.62500.6134
H60.66670.6626
H70.66670.6664
H80.72010.6252
H90.59340.5692
H100.50000.4988
H110.81150.6383
N0.72160.6702
Table 11: Hyperparameters used for GRPO training.
ParameterValue
Base ModelQwen/Qwen3-1.7B-Base
Training Batch Size32
Rollouts per Prompt4
Number of GPUs2×B200
OptimizerAdamW
Temperature1.0
Top-p1.0
Top-k-1
Max Response Length2048
Learning Rate1×10−6
Warmup Steps10
Training Steps200

Findings

  • Heuristic-frequency features from SHAPE achieved AUROC 0.664±0.02 predicting answer correctness, versus 0.504±0.03 for CoT length, 0.503±0.03 for length+reasoning-token features, 0.618±0.03 for self-revision markers, and 0.618±0.02 for the ThinkARM episode-label baseline.
  • Reasoning models (with extended thinking) showed higher semantic-space coverage (Nspaceeff 1.81-2.53) and transition ratio (rho 0.40-0.51) than instruction-tuned models without extended reasoning (Nspaceeff 1.37-1.71; rho 0.19-0.32); incorrect trajectories generally showed higher rho than correct ones across most models.
  • Under hard perturbations that require a different solution approach, models showed larger changes in heuristic-frequency distribution, semantic-space count, and transition ratio than under simple perturbations that preserve the solution method; this divergence appeared even within the first 5-10 content units.
  • All post-trained model pairs tested (Olmo-3-7B Think-RLVR and Think-RL-Zero, Qwen3-1.7B-Base with GRPO) showed Density above 1.0 and Coverage below 1.0 relative to their base models, while an unrelated-model control pair showed low Density (0.520) and low Coverage (0.437).
  • In preliminary MATH-Perturb test results, both Plan-GRPO and HA-Plan-GRPO improved over the untrained base model, and HA-Plan-GRPO (which adds heuristic hints to the rollout prompt) achieved higher Avg@64 and Pass@64 than Plan-GRPO alone.

Where it can be used

  • Diagnosing why a math-reasoning model fails on certain problems by inspecting which heuristics and semantic-space transitions it used, rather than only checking the final answer.
  • Auditing whether an RL post-training run is genuinely diversifying a model's problem-solving strategies or just concentrating it around already-known solution patterns.
  • Designing RLVR training prompts that inject explicit heuristic vocabulary to potentially boost accuracy on math benchmarks, following the HA-Plan-GRPO recipe.
  • Building automated CoT-tagging pipelines for other structured-reasoning domains by adapting the segmentation-tagging-tracking pipeline design, though this specific instantiation is math-only.

Limits and open work

  • The framework and its heuristic taxonomy were developed and validated only on mathematical reasoning benchmarks (MATH-Perturb, Omni-MATH subset); applying it to other domains is stated as future work, not demonstrated.
  • The gold standard for heuristic tagging comes from just 48 annotated trajectories across four models, and semantic-space tracking has no objective gold standard at all, so it was calibrated by iterative manual review rather than measured against ground truth.
  • HA-Plan-GRPO results are explicitly labeled 'preliminary' and were tested on one base model (Qwen3-1.7B-Base) with one training recipe; broader model sizes, families, or RL algorithms were not tested.
  • Heuristic tagging performance is weaker on rare heuristic classes (e.g., H7, H10) due to small numbers of gold examples, which may make some fine-grained conclusions less stable.
  • Automated annotation relies on proprietary or large open-weight LLMs (Grok-4.1-Fast, Qwen3.5-27B) as taggers, introducing potential annotation noise or model-specific bias into all downstream analyses.

Why it matters

Accuracy scores alone don't reveal how a model reasons or why reinforcement learning sometimes plateaus or even narrows a model's problem-solving repertoire; SHAPE gives a concrete, theory-grounded way to see and measure that. For anyone building or evaluating math-reasoning models, it offers both a diagnostic lens on training side-effects and a concrete recipe (heuristic-augmented prompts during RL) that showed measurable gains in the paper's own tests.

Terms in this paper

  • Chain-of-Thought (CoT) · The step-by-step text a model produces while solving a problem, before giving the final answer
  • semantic space · The model's current mathematical framing of the problem, such as treating it algebraically vs. geometrically
  • heuristic · A specific purposeful math move, like working backward, simplifying, or checking a case
  • GRPO · Group Relative Policy Optimization, a reinforcement-learning training method used to fine-tune the models here
  • Density and Coverage · Metrics that measure how tightly a target distribution clusters inside a reference distribution (Density) and how much of the reference it reaches (Coverage)

Original abstract (English)

Large language models (LLMs) achieve strong performance on mathematical reasoning benchmarks, yet the mathematically meaningful skills underlying their reasoning remain underexplored. We introduce \texttt{SHAPE}, a framework that analyzes Chain-of-Thought (CoT) trajectories through two lenses developed in mathematics education: (1) semantic spaces: the model's evolving mathematical interpretations of a problem (e.g., algebraic, geometric), and (2) heuristics: the specific mathematical actions taken within those spaces (e.g., simplifying the problem, working backward). We first use \texttt{SHAPE} to analyze the reasoning patterns of various models. Our findings reveal that the mathematical heuristics employed by a model better explain final answer correctness than traditional CoT features. Furthermore, models are likely to reach correct solutions by concentrating their reasoning effort within a few semantic spaces rather than exploring many disparate ones -- a pattern consistent with human behavior. Next, we utilize the \texttt{SHAPE} lens to evaluate whether post-training truly enhances mathematical proficiency. We find that reinforcement learning induces mode-seeking in heuristic usage. Lastly, we post-train LLMs by promoting diverse heuristics and demonstrate its effectiveness in improving accuracy. Overall, \texttt{SHAPE} provides a theoretically-grounded diagnostic framework for decoding LLM reasoning and offers a new path toward post-training LLMs for math reasoning. The code for our model is available at https://github.com/holi-lab/SHAPE-of-CoT

Authors · Jonghyun Song, Sangjun Song, Minjae Oh, Haesung Pyun, Sungsik Lee, Yohan Jo

Read on arXiv

Latest papers

All papers →

Latest from METAL LAB

Figures: Jonghyun Song et al., arXiv:2608.28600, CC BY 4.0