Abstract
Large language models (LLMs) often exhibit unexpected errors or unintended behavior, even at scale. While recent work reveals the discrepancy between LLMs and humans in skill compositions, the learning dynamics of skill compositions and the underlying cause of non-human behavior remain elusive. In this study, we investigate the mechanism of learning dynamics by training transformers on synthetic arithmetic tasks. We discover that transformers do not reliably build skill compositions according to human-like sequential rules. Instead, they often acquire skills in reverse order or in parallel, leading to "shattered compositionality." Our results reveal a fundamental mismatch between a model's learning behavior and desired skill compositions, with implications for reasoning reliability and out-of-distribution robustness.
Introduction
Despite their success on mathematical benchmarks, LLMs remain notoriously brittle. Minor phrasing changes can trigger "hallucinations" or catastrophic failures. While static evaluations highlight these flaws, they do not explain the developmental process of how these models acquire compositional skills. This research explores the "learning dynamics" of Transformers to uncover why their internal strategies diverge so sharply from human procedural logic, a phenomenon the authors term shattered compositionality.
Methodology
The authors trained Transformer models (NanoGPT architecture, 10M–100M parameters) on synthetic tasks including multi-operand addition, multiplication, comparison, and sorting. By using digit-wise tokenization, they tracked the error rates of individual digit positions throughout the training process. They further employed ablation studies and Mutual Information (MI) probes to determine if models were following causal rules or merely matching statistical correlations present in the training data.
The Reverse Learning Order
A primary finding is that Transformers learn arithmetic "backwards" compared to humans. While humans are taught to process addition from the units-place upward to handle carries, Transformers prioritize the most significant digit (MSD) first.
As shown in the figure above, the error rate for the thousands-place (the MSD in this 4-digit task) drops to near zero significantly earlier than the units-place. This suggests that the model "grabs" the strongest statistical signals first—the MSD typically has higher mutual information with the input operands early in training, leading the model to prioritize it over the logically prior units-place.
Numerical Approximation and Correlational Matching
Early in the training process, the model does not exhibit discrete logical reasoning. Instead, it behaves like a numerical approximation algorithm. It learns to narrow down the general range of the answer before mastering the specific logic required for exact digit calculation.
The error distribution (actual minus predicted) early in training follows a normal distribution centered near zero. This indicates that the model is approximating the magnitude of the result based on correlations in the training data rather than executing a procedural algorithm. As training progresses, this distribution narrows until the model achieves exactness.
Key Results and Persistence
The study found that this shattered compositionality is not a byproduct of small model size. Scaling to 100M parameters or fine-tuning 1B+ parameter models (like Pythia) did not correct the reverse learning order. Furthermore, while "scratchpads" (Chain-of-Thought) can improve performance and accelerate convergence, they do not necessarily force the model to adopt human-like procedural trajectories; the model still exhibits non-human learning patterns depending on the scratchpad format.
On real-world benchmarks like GSM8K, even state-of-the-art models (Llama-3, GPT-4) showed declining accuracy as the number of operands increased. These models frequently made "mixing errors"—such as swapping or repeating digits—which are characteristic of the parallel skill acquisition and correlational interference observed in the synthetic tasks.
Conclusion
The research highlights a fundamental mismatch between the desired procedural reasoning in LLMs and their actual learning behavior. Transformers prioritize correlational matching over causal composition, leading to internal strategies that are efficient for training data but fragile under distribution shifts. Addressing shattered compositionality may require moving beyond standard autoregressive training toward paradigms that incentivize true procedural logic and verifiable reasoning steps.
Summary updated