LIME: Learning Inductive Bias for Primitives of Mathematical Reasoning

Yuhuai Wu, Markus N. Rabe, Wenda Li, Jimmy Ba, Roger B. Grosse, Christian Szegedy

Introduction

Neural networks, particularly Transformers, have revolutionized natural language processing, but they often struggle with the abstract, structural logic required for mathematical reasoning. Traditionally, researchers have attempted to solve this by "hard-coding" inductive biases into the model's architecture (e.g., using Graph Neural Networks or Tree-based RNNs). However, these specialized architectures are difficult to design and often fail to outperform generic Transformers.

While large-scale pretraining (like GPT-3) helps, it primarily works by having the model memorize "world knowledge" from massive text corpora. This paper asks a different question: Can we teach a model the process of reasoning itself, independent of specific knowledge, through data rather than architecture?

LIME (Learning Inductive bias for Mathematical rEasoning) demonstrates that Transformers can indeed learn fundamental reasoning skills through lightweight pretraining on purely synthetic, symbol-agnostic datasets. This approach significantly boosts performance on complex mathematical theorem-proving benchmarks while requiring only a tiny fraction (often <2.5%) of the computational cost of standard pretraining.

The LIME Methodology

The authors introduce LIME as a pretraining methodology based on three reasoning primitives inspired by the logician Charles Peirce:

  1. Deduction: Deriving a result from a rule and a specific case ($Rule, Case \rightarrow Result$).
  2. Abduction: Finding the underlying case that explains a result given a rule ($Rule, Result \rightarrow Case$).
  3. Induction: Generalizing a rule from a case and its result ($Case, Result \rightarrow Rule$).
The three reasoning primitives and their inference maps.

To implement these, the researchers created synthetic tasks using "math symbols" (operators) and "rule symbols" (placeholders). For example, a Rule might be $A * A + B = C$. A Case defines substitutions like $\{A: a, B: b, C: d+e\}$, and the Result is the applied substitution: $a * a + b = d+e$.

Crucially, the tasks are symbol-agnostic. For every training example, the symbols are randomly sampled. The model is told at the start of the input which symbols are "rules" and which are "math." This forces the Transformer to learn the logic of transformation and substitution rather than memorizing specific variable names or mathematical facts.

Datasets and Evaluation

The authors evaluated LIME across four diverse mathematical reasoning benchmarks:

  • IsarStep: Predicting intermediate propositions in declarative Isabelle proofs.
  • HOList (Skip-tree): Tasks like type inference and equation completion in HOL-Light.
  • MetaMathStep: Predicting granular, low-level proof steps in MetaMath.
  • LeanStep: Conjecturing novel, unseen lemmas in the sophisticated Lean theorem prover.

Performance and Insights

LIME-pretrained models consistently outperformed vanilla Transformers and even specialized architectures across all benchmarks.

  • Significant Accuracy Gains: On IsarStep, LIME Mix (a combination of all three primitives) improved top-1 accuracy from 20.4% to 26.9%. On LeanStep, the gains were even more dramatic, nearly doubling top-1 accuracy from 15.8% to 29.8%.
  • Faster Convergence: LIME-pretrained models reach higher performance levels much earlier in the training process than models trained from scratch.
Validation BLEU scores on the IsarStep task.

Beyond raw performance, the study yielded several key insights:

  • Reasoning as a Learned Bias: Inductive bias doesn't have to be built into the layers of a model. A generic Transformer is flexible enough to "absorb" these biases if given a curriculum of simple, abstract tasks.
  • Disentangling Logic from Knowledge: By using synthetic data devoid of "world knowledge," the authors proved that the performance gains come from improved reasoning capabilities, not just better pattern matching of mathematical constants or theorems.
  • Compute Efficiency: Unlike standard language model pretraining which can take days on hundreds of GPUs, LIME pretraining takes only two hours on a single GPU.
  • Vocabulary Independence: LIME is so effective at teaching abstract logic that the authors didn't even need to transfer the embedding layer to the downstream tasks. The "reasoning" is stored in the Transformer's attention weights, not its vocabulary.

Limitations and Future Work

While highly effective for Transformers, the authors found that LIME provides much smaller benefits to LSTMs, hypothesizing that self-attention is uniquely suited to learning the "dynamic graphs" required for these reasoning tasks. Additionally, while inspired by Peirce, the specific synthetic tasks used are just one way to represent deduction, induction, and abduction; other formulations might be even more effective.

A major open question for future work is generalization to natural language processing. Since this study focused on mathematics, it remains to be seen whether these same synthetic reasoning primitives could improve logical consistency in natural language tasks, such as multi-step word problems or legal reasoning.

Summary updated

BibTeX
@inproceedings{wu2021lime,
  author = {Yuhuai Wu and Markus N. Rabe and Wenda Li and Jimmy Ba and Roger B. Grosse and Christian Szegedy},
  title = {{LIME: Learning Inductive Bias for Primitives of Mathematical Reasoning}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=nVTvhWZ0F3},
}
Figure