NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Analysing Mathematical Reasoning Abilities of Neural Models

David Saxton, Edward Grefenstette, Felix Hill, Pushmeet Kohli

Deep learning has conquered Go, mastered translation, and revolutionized image recognition. But can it solve a middle-school algebra problem? In their ICLR 2019 paper, Analysing Mathematical Reasoning Abilities of Neural Models, researchers from DeepMind explore whether our most powerful neural architectures are actually "reasoning" or just acting as very sophisticated pattern matchers.

TL;DR

DeepMind researchers introduced a massive, procedurally generated dataset of school-level mathematics to benchmark the reasoning limits of neural models. They found that while Transformers significantly outperform LSTMs, even the best models struggle to generalize to harder problems and remain surprisingly brittle to minor changes in question phrasing.

What Problem Does This Paper Address?

While deep learning excels at pattern matching, it often fails at algebraic generalization—the human ability to learn a rule (like $1 + 1 = 2$) and apply it to infinitely large numbers or complex nested structures.

Mathematics is the ultimate "stress test" for this capability. Unlike natural language, which relies heavily on context and experience, math is governed by strict axioms and symbol manipulation rules. To solve a problem like $g(h(f(x)))$, a model cannot simply guess based on surrounding words; it must parse entities, plan a sequence of operations, use working memory for intermediate values, and apply learned sub-algorithms. The authors argue that if a model cannot handle these "subroutines" of reasoning, it has not truly captured the essence of intelligence.

Methods

The researchers treated mathematics as a sequence-to-sequence (seq2seq) task, similar to machine translation. The input is a string of characters (the question), and the output is another string (the answer).

Attentional LSTM vs. Transformer architectures

They compared two broad classes of architectures:

  1. Recurrent Neural Networks (RNNs): Specifically LSTMs and "Attentional LSTMs." They even experimented with "thinking steps"—allowing the model to process for several cycles before being forced to output an answer.
  2. The Transformer: The architecture that relies entirely on self-attention mechanisms to process sequences in parallel.

Crucially, they used procedural generation to create the data. Instead of scraping existing problems, they wrote code to generate infinite variations of problems, allowing them to precisely control difficulty and test for specific failure modes.

Datasets

The authors introduced a new, open-source benchmark consisting of millions of questions across eight modules:

  • Algebra: Linear equations, sequences, and roots.
  • Arithmetic: Basic operations, including nested expressions.
  • Calculus: Differentiation of polynomials.
  • Comparison: Sorting lists and finding the closest number.
  • Measurement: Unit conversions (time, mass, volume).
  • Numbers: Primality, rounding, and place values.
  • Polynomials: Expansion and simplification.
  • Probability: Sampling without replacement.

The dataset includes Interpolation tests (questions similar to training) and Extrapolation tests (questions involving larger numbers or more complex compositions than seen during training).

Key Insights and Ideas

  • Magnitude is easy, logic is hard: Models are nearly perfect at perceptual tasks like rounding or identifying place values. However, they struggle with "compositionality"—chaining multiple rules together (like the chain rule in calculus).
  • The "Thinking" Advantage: For LSTMs, adding "thinking steps" (empty processing cycles) improved performance, suggesting that these models need extra "mental" space to integrate information.
  • Brittleness: The models are shockingly sensitive to phrasing. In one instance, adding a period to the end of a multiplication question changed the model's answer from the correct "68" to "69."
  • The "Camouflage" Problem: Models failed at simple tasks if the input was repetitive. For example, they could add random large numbers but failed to add $1 + 1 + 1...$ if the sequence was too long, likely because they couldn't "align" the sub-sums correctly.

Key Results

Model performance on interpolation and extrapolation
  • Transformer vs. LSTM: The Transformer was the clear winner, achieving 76% accuracy on interpolation and 50% on extrapolation. The best LSTM managed only 58% and 42%, respectively.
  • The "E" Grade: To provide a real-world baseline, the researchers tested their best Transformer on a 40-question sample from British "GCSE" exams (for 16-year-olds). The model got 14/40 correct, roughly equivalent to a failing "E" grade.
  • Generalization Gap: There is a significant drop-off between interpolation and extrapolation. Models learn the "tricks" to solve problems of a certain size but fail when asked to apply those same rules to slightly larger numbers or more steps.

Limitations and Future Work

The authors acknowledge that their dataset lacks linguistic diversity. The questions are templated and don't reflect the messy, varied way humans ask math word problems. Furthermore, the current benchmark doesn't cover geometry (which requires visual reasoning) or formal proofs.

Future work points toward "unit testing" models on specific reasoning axes and exploring architectures that can more robustly handle the "subroutines" of logic without falling back on shallow pattern matching.

Summary updated

BibTeX
@inproceedings{saxton2019analysing,
  author = {David Saxton and Edward Grefenstette and Felix Hill and Pushmeet Kohli},
  title = {{Analysing Mathematical Reasoning Abilities of Neural Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=ZeU-6Acv8uz},
}
Figure