Abstract
Chain-of-thought (CoT) supervision can substantially improve transformer performance, yet the mechanisms by which models learn to follow and benefit from CoT remain poorly understood. We investigate these learning dynamics through the lens of grokking by pretraining transformers on symbolic reasoning tasks with tunable algorithmic complexity and controllable data composition to study their generalization. Models were trained under two settings: (i) producing only final answers, and (ii) emitting explicit CoT traces before answering. Our results show that while CoT generally improves task performance, its benefits depend on task complexity. To quantify these effects, we model the accuracy of the logarithmic training steps with a three-parameter logistic curve, revealing how the learning speed and shape vary with task complexity, data distribution, and the presence of CoT supervision. We also uncover a transient trace unfaithfulness phase: early in training, models often produce correct answers while skipping or contradicting CoT steps, before later aligning their reasoning traces with answers. Empirically, we (1) demonstrate that CoT accelerates generalization but does not overcome tasks with higher algorithmic complexity, such as finding list intersections; (2) introduce a kinetic modeling framework for understanding transformer learning; (3) characterize trace faithfulness as a dynamic property that emerges over training; and (4) show CoT alters internal transformer computation mechanistically.
Introduction
While Chain-of-Thought (CoT) prompting—asking a model to "think step-by-step"—is known to dramatically improve performance, the underlying mechanics of how it alters the learning process remain opaque. Does CoT simply provide more training signal, or does it fundamentally change the internal "kinetics" of how a transformer learns to reason? This paper addresses these questions by treating the learning process as a physical reaction, specifically investigating the phenomenon of grokking: the sudden shift from rote memorization to true generalization.
Methodology: A Kinetic Modeling Framework
To analyze learning dynamics, we trained GPT-2 style transformers from scratch on symbolic reasoning tasks. We introduced a kinetic modeling framework where test accuracy over logarithmic training steps is modeled using a three-parameter logistic curve:
$$\text{Acc}(t) = \frac{L}{1 + e^{-\lambda(\log_{10} t - \log_{10} t_0)}}$$
This allows us to treat learning like a chemical reaction, calculating "take-off points" ($t_0$) and "growth rates" ($\lambda$). We compared two training regimes: Direct-Answering (outputting only the final answer) and CoT-Guided (emitting an explicit reasoning trace before the answer).
Task Design and Datasets
We utilized a controlled synthetic environment with two types of Knowledge Bases (KBs): Attributive KBs (entity-attribute pairs) and Relational KBs (entity-entity relations). From these, we generated four tasks with tunable algorithmic complexity ($k$):
- Comparison: Find the max/min value among $k$ entities.
- Sorting: Rank $k$ entities by value.
- Intersection: Find the entity satisfying $k$ attribute conditions.
- Composition: Follow a chain of $k$ relational hops.
Key Findings: CoT as a Catalyst
Our analysis reveals that CoT acts as a catalyst, lowering the "computational barrier" for generalization. By splitting a complex task into a sequence of simpler, linear steps, CoT allows the model to grok the solution significantly earlier in the training process.
We also identified a transient "trace unfaithfulness" phase. Early in training, models often achieve high accuracy on the final answer while their reasoning traces remain nonsensical or contradictory. As shown in the conceptual model above, the "Answer" accuracy (blue line) rises during the grokking phase, while the "Answer + Trace" accuracy (orange line) only catches up during a later "Alignment" phase. This suggests that faithfulness is an emergent property that develops as the model aligns its internal logic with its output.
Empirical Results and Efficiency
Quantitatively, CoT-guided models demonstrate massive efficiency gains. In the Sorting task, CoT models achieved high accuracy using $10^9$ FLOPs, whereas Direct-Answering models failed to generalize even with significantly more compute. For Composition tasks, Direct-Answering models failed to generalize to out-of-distribution (OOD) data entirely, while CoT-guided models reached near-perfect OOD accuracy within 3,000 steps.
Mechanistic analysis further showed that CoT enables computational offloading. In Direct-Answering models, reasoning is concentrated in early-to-middle layers. In CoT models, once the trace is in the context, the final answer becomes trivial to compute, simplifying the internal circuits required for the task.
Discussion and Limitations
Despite its benefits, CoT is not a universal solution. It failed to help models solve the Intersection task, suggesting that while CoT aids with sequential "depth," it does not necessarily help with tasks requiring the management of multiple candidate sets simultaneously ("breadth"). Future work is needed to determine if these kinetic laws hold for high-dimensional natural language and how scaling parameter counts affects the "activation energy" required for reasoning.
Summary updated