# Shattered Compositionality: Counterintuitive Learning Dynamics of Transformers for Arithmetic

*Xingyu Zhao, Darsh Sharma, Rheeya Uppaal, Yiqiao Zhong*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/152105) · [OpenReview](https://openreview.net/forum?id=VUD0RWdAEz) · [alphaXiv](https://www.alphaxiv.org/abs/2601.22510) · [Open on the map](../papers.html#p152105)

Category: [Interpretability & Model Adaptation](../pcat/15.md) › [Compositional Generalization in Transformers](../pgroup/496.md) · Type: empirical study · Keywords: transformer learning dynamics, arithmetic reasoning, skill composition, distribution shift robustness, model scaling effects

Areas: [LLM Reasoning](../areas/reasoning.md) › Reasoning Mechanisms › Looped Reasoning; [Evaluation & Benchmarks](../areas/evaluation.md) › Language Model and Agent Benchmarks › Compositional Reasoning

## Summary
The paper identifies shattered compositionality, where transformers learn arithmetic skills in reverse or parallel order rather than sequentially, leading to mixing errors and reduced robustness under distribution shifts.

## Explained to a 5-year-old
The researchers gave a computer program special math problems to learn. They noticed the program sometimes learned the steps in the wrong order, like doing addition before subtraction. This made the program make mixed-up mistakes when solving new problems. Even when they made the program bigger or gave it extra hints, the problem stayed. The study shows that computers may not learn math the way people do, which can be risky.

## Explained to a 5-year-old, longer
The researchers wanted to see how a kind of computer brain learns to do math. They gave it lots of simple number puzzles to practice. They watched how the computer remembered the rules for solving those puzzles. Instead of learning the rules one after another like a child does, the computer sometimes learned them all at once or in the wrong order. This caused the computer to mix up steps when solving new puzzles. Even when they made the computer larger or added extra hints, the problem did not go away. The study shows that computers may not learn math the way people do, which can be risky. They also found that the computer’s learning was driven by patterns in the data rather than understanding the logic. This means the computer can be brittle when faced with new situations. The researchers hope these insights will help make AI more reliable and safer to use.

## For a technical reader
We trained transformer models on synthetic arithmetic tasks and used model-agnostic metrics to study skill composition. The models often learned arithmetic rules in reverse or parallel order, causing mixing errors and weaker robustness under distribution shifts. This behavior persisted in modern LLMs despite scaling or adding scratchpad supervision. The findings highlight a mismatch between training-time skill acquisition and human-like hierarchical reasoning, impacting reliability and out-of-distribution performance.

## Problem
Understanding how transformers acquire arithmetic skills and why they often acquire them in reverse or parallel order instead of following human-like sequential rules limits their robustness to distribution shifts.

## Method
The authors train transformer models on synthetic arithmetic tasks and employ black-box model-agnostic metrics to analyze skill composition. They examine learning dynamics across different data distributions and evaluate robustness under controlled shifts.

## Results
The approach finds that transformers often learn arithmetic skills in reverse or parallel order, leading to mixing errors and reduced robustness under distribution shifts, and this behavior persists in modern LLMs despite scaling or scratchpad supervision.

## Contributions
It identifies shattered compositionality as a phenomenon in transformer learning, shows that correlational matching-not causal composition-drives this behavior, and demonstrates that scaling or scratchpad supervision does not mitigate the issue.

## Practical relevance
These findings suggest that current transformer training may not reliably capture human-like reasoning, affecting the reliability of AI systems in safety-critical applications.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/152105)
