METAL LAB

SHAPE of Chain-of-Thought in Math Reasoning

arXiv:2608.286002026-09-01

给AI解数学题时的每一步思考打上标签,看它用了什么策略、卡在哪种理解方式里,由此揭示答案对错的原因以及强化学习训练带来的副作用

SHAPE用数学教育研究中的两个概念来分析大模型的思维链(CoT):语义空间(模型当前对题目的数学理解方式,比如代数式还是几何式)和启发式(具体的解题动作,比如逆向推理或化简问题)。通过自动化标注流程测量后发现,基于启发式的特征比CoT长度等表面特征更能预测答案是否正确,而强化学习后训练出的模型反而把策略收缩到基础模型已有的窄范围内,把启发式信息直接加入训练(HA-Plan-GRPO)则能提升准确率。

METAL LAB 解读图

SHAPE如何把思维链转化为可测量的结构

证据状态实测结果与计划中的工作并存

  1. 原始思维链模型解数学题时逐步写出的解题文字过程
  2. 切分为内容单元把文本切成能代表一个解题动作的最小片段
  3. 标注启发式给每个单元打上逆向推理、引入表示法等具体数学动作标签
  4. 追踪语义空间判断每个单元相对模型不断演变的题目理解方式是开启新空间(New)、回到旧空间(Return)还是维持当前空间(Maintain)
  5. 计算指标并应用于训练提取能预测答案正确性的特征,测量后训练带来的Density与Coverage收窄现象,并把启发式重新注入GRPO的rollout提示中
这是 METAL LAB 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. SHAPE用两个源自数学教育研究的概念分析思维链文本:语义空间指模型当前对题目采用的数学理解方式(如代数式或几何式),启发式指逆向推理、引入符号、验证特例等具体解题动作。
  2. 一套用Grok-4.1-Fast、Qwen3.5-27B等模型搭建的自动化流程把思维链切成小的内容单元,给每个单元标注启发式标签,并判断每个单元是开启新的语义空间、回到旧的语义空间,还是维持当前语义空间;该流程在48条人工标注的黄金样本上得到验证。
  3. 用SHAPE的启发式频率特征训练的逻辑回归在预测答案正确性上达到AUROC 0.664,超过CoT长度(0.504)、长度加推理token特征(0.503)、诸如wait/aha等自我修正词标记(0.618)以及现有的情节标签方法ThinkARM(0.618)。
  4. 用Density和Coverage指标比较基础模型与经强化学习后训练(Think-RLVR)模型的启发式使用模式,发现所有被测试的后训练模型对中Density均超过1.0、Coverage均低于1.0,说明后训练并未产生新策略,而是把成功的解题路径收缩进基础模型已有策略中较密集的一小块区域;作为对照,两个互不相关模型之间的Density(0.520)和Coverage(0.437)都很低,证实这一现象只出现在基础模型与其后训练版本之间。
  5. 在用GRPO对Qwen3-1.7B-Base做MATH题训练的实验中,在rollout提示中显式加入启发式信息的HA-Plan-GRPO,在MATH-Perturb测试集上的Avg@64和Pass@64均高于只加规划步骤但不含启发式信息的Plan-GRPO(该结果被作者标注为初步结果)。
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

研究结果

  • SHAPE的启发式频率特征在预测答案正确性上达到AUROC 0.664±0.02,高于CoT长度(0.504±0.03)、长度加推理token特征(0.503±0.03)、自我修正词标记(0.618±0.03)以及ThinkARM情节标签方法(0.618±0.02)。
  • 具备扩展思考能力的推理模型在语义空间覆盖度(Nspaceeff 1.81至2.53)和转移比率(rho 0.40至0.51)上均高于不做扩展推理的指令微调模型(Nspaceeff 1.37至1.71,rho 0.19至0.32);在大多数模型中,答错的解题过程比答对的表现出更高的rho值。
  • 在要求换用不同解题思路的高难度扰动题上,模型的启发式频率分布、语义空间数量和转移比率变化都比只保留原解法结构的简单扰动题更大,且这种差异在思维链最初的5到10个内容单元内就已出现。
  • 被测试的所有基础模型与后训练模型对(Olmo-3-7B的Think-RLVR和Think-RL-Zero版本、Qwen3-1.7B-Base搭配GRPO)Density均超过1.0、Coverage均低于1.0;作为对照的两个互不相关模型之间Density仅为0.520、Coverage仅为0.437。
  • 在MATH-Perturb测试集上,Plan-GRPO和HA-Plan-GRPO都比未训练的基础模型表现更好,而在rollout提示中加入启发式信息的HA-Plan-GRPO在Avg@64和Pass@64上都高于Plan-GRPO(该结果为初步结果)。

可应用场景

  • 不只看最终答案,而是通过检查模型用了哪些启发式、如何在语义空间之间切换,来诊断模型在某类题目上失败的原因。
  • 用来检查一次强化学习后训练究竟是让模型的解题策略更加多样,还是只是把它收窄到已经会的那几种解法里。
  • 参考HA-Plan-GRPO的做法,尝试在强化学习训练的rollout提示中显式加入启发式词汇,以期提升数学基准上的表现。
  • 把内容分割、启发式标注、语义空间追踪这套流程的设计思路搬到其他结构化推理任务上,不过目前这一具体实现仅在数学题上得到验证。

局限与待验证事项

  • 这套框架及其启发式分类体系目前只在数学推理基准(MATH-Perturb、Omni-MATH子集)上开发和验证过,扩展到其他领域仅被作者列为未来工作,尚未实际验证。
  • 启发式标注的黄金标准仅来自四个模型产生的48条解题过程,而语义空间追踪本身没有客观的黄金标准,只能通过反复人工审查来校准提示词。
  • HA-Plan-GRPO的结果被作者明确标注为初步结果,且只在一个基础模型(Qwen3-1.7B-Base)和一种训练方案上测试过,尚未在更大模型、不同模型家族或其他强化学习算法上验证。
  • 像H7、H10这类黄金样本数量很少的稀有启发式类别,标注模型的表现较弱,这可能让某些细粒度结论不够稳定。
  • 自动标注依赖Grok-4.1-Fast、Qwen3.5-27B这类大型或专有模型作为标注器,可能给后续所有分析带来标注噪声或模型特有的偏差。

为什么重要

只看最终答案对不对,很难知道模型到底是怎么想的,也很难判断强化学习是真的提升了数学能力,还是只是让模型反复用已经会的那几招。SHAPE提供了一套有理论依据的方法来观察这个过程,并且用具体实验给出了一个把启发式信息加入训练后确实能提升表现的例子。

本文术语

  • 思维链(Chain-of-Thought, CoT) · 模型在给出最终答案前,一步一步写出来的解题过程文字
  • 语义空间 · 模型当前对题目采取的数学理解方式,比如把题目当作代数问题还是几何问题来处理
  • 启发式 · 逆向推理、化简问题、验证特例等有明确目的的具体解题动作
  • GRPO · 用于对模型做强化学习微调的方法,全称Group Relative Policy Optimization
  • Density与Coverage · Density衡量目标分布在参考分布密集区域的聚集程度,Coverage衡量目标分布覆盖了参考分布中多大比例的范围

论文原文摘要(英文)

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

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

在 arXiv 阅读

最新论文

全部论文 →

METAL LAB 最新报道

图片来源: Jonghyun Song et al., arXiv:2608.28600, CC BY 4.0