Research map / Large language models / Agents, code and math
Physics of Language Models: Part 2.1, Grade-School Math and the Hidden Reasoning Process
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Builds a controlled synthetic grade-school math dataset (iGSM) and pretrains GPT2-style models from scratch to probe how language models solve math problems internally.
Problem
Whether language models truly learn reasoning skills on grade-school math or merely memorize solution templates, and what hidden mental reasoning process they use; existing internet-pretrained models and GSM8K-style data contamination make these questions hard to answer.
Approach
Generate an effectively unlimited, contamination-free synthetic grade-school math dataset from controlled dependency graphs, pretrain GPT2-style models from scratch on it, and use a V(ariable)-probing method (frozen model plus rank-8 embedding update and linear head) to reveal internal planning states such as necessity and dependency of parameters.
Key results
- GPT2 pretrained on iGSM reaches about 99% accuracy in-distribution and generalizes out-of-distribution to operation counts beyond training (up to op=32 on iGSM-hard), per the paper's Result 2.
- Pretrained models produce on average about 0.5 unnecessary parameters per solution even at op=32, and mostly generate shortest solutions.
- A 16-layer 576-dim GPT2 outperforms a 4-layer 1920-dim model on reasoning, indicating depth matters for math reasoning.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Pretrain GPT2-RoPE on synthetic iGSM data | GPT2-RoPE · iGSM same distribution | accuracy: 99% | Helped |
| Pretrain GPT2-RoPE on synthetic iGSM data | GPT2-RoPE · iGSM OOD longer reasoning lengths | accuracy | Helped |
| Use a deeper, narrower model rather than a shallower, wider model | GPT2 · iGSM math reasoning | reasoning length | Helped |
| Use a 4-layer, 1920-dimension model instead of a 20-layer, 576-dimension model | GPT2 · iGSM math reasoning | reasoning length | Hurt |
| Replace GPT2 architecture with Llama architecture | GPT2-RoPE · iGSM math reasoning | accuracy | No clear effect |
| Use CoT solutions that define the parameter before giving intermediate steps | GPT2-RoPE · iGSM | accuracy | Helped |
| Generate only necessary solution steps rather than computing unnecessary parameters | GPT2-RoPE · iGSM including OOD | unnecessary computations | Helped |
| Probe model states after pretraining on iGSM | GPT2-RoPE · iGSM parameter dependencies, including unnecessary parameters | dependency identification | Helped |
| Use V-probing to identify incorrect necessity predictions | GPT2-RoPE · iGSM reasoning errors | prediction of unnecessary parameters as necessary | Hurt |
| Use V-probing to identify readiness errors | GPT2-RoPE · iGSM reasoning errors | ready-to-compute predictions | Hurt |
Surprising findings
- The model learns all-pair parameter dependency and can_next skills that are not needed to fit its pretraining data, before any question is asked.
- Most model errors trace to incorrectly predicting that a parameter is ready to compute, visible in internal states even before the first wrong solution step.
Limitations
- Uses a simplified synthetic setting (arithmetic mod 23, templated English) that may not transfer to natural math or foundation models.
- GPT-2 with rotary embeddings is a small custom model; results on larger LLMs are not directly tested.
- Probing relies on a custom V-probing method whose interpretation depends on the chosen rank-8 update.
Experimental setup
Datasets: iGSM-med iGSM-hard GSM8K
Benchmarks: iGSM-med iGSM-hard
Metrics: accuracy probing accuracy unnecessary parameters per solution
Baselines: GPT-4 GPT-4o Llama randomly-initialized transformer probing
Builds on: GPT-2 RoPE GSM8K
Closest papers by meaning
- Physics of Language Models: Part 2.2, How to Learn From Mistakes on Grade-School Math Problems (ICLR 2025 · similarity 0.93)
- A Careful Examination of Large Language Model Performance on Grade School Arithmetic (NeurIPS 2024 · similarity 0.92)
- Advancing Mathematical Reasoning in Language Models: The Impact of Problem-Solving Data, Data Synthesis Methods, and Training Stages (ICLR 2025 · similarity 0.91)
- Do Language Models Exhibit the Same Cognitive Biases in Problem Solving as Human Learners? (ICML 2024 · similarity 0.90)
- CogMath: Assessing LLMs' Authentic Mathematical Ability from a Human Cognitive Perspective (ICML 2025 · similarity 0.90)
- GSM-Symbolic: Understanding the Limitations of Mathematical Reasoning in Large Language Models (ICLR 2025 · similarity 0.90)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
