LIME: Learning Inductive Bias for Primitives of Mathematical Reasoning

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

TL;DR

Instead of manually engineering complex neural network architectures to instill inductive biases, this paper introduces LIME, a method that encodes reasoning biases directly into synthetic, knowledge-free datasets. By pre-training standard Transformers on lightweight tasks inspired by classical logic primitives, the authors achieve massive performance gains on formal mathematical reasoning benchmarks at a mere fraction of the computational cost of traditional pre-training.

What Problem Does This Paper Address?

To succeed at abstract tasks like mathematics, neural networks need the right inductive bias—the set of assumptions a model uses to predict outputs for unseen inputs. Historically, researchers built these biases directly into model architectures (e.g., locality in CNNs, sequential structure in LSTMs). However, designing custom architectures for abstract mathematical reasoning is notoriously difficult, and generic Transformers often outperform hand-engineered reasoning models.

An alternative is large-scale self-supervised pre-training (like GPT). While highly effective, standard pre-training primarily helps models memorize "world knowledge" from massive text corpora. This process is computationally exorbitant and doesn't explicitly teach the structural, procedural rules of logic. The authors ask: Can we instead teach a generic Transformer network the fundamental mechanics of reasoning using small, purely synthetic datasets?

Methods

The authors introduce LIME (Learning Inductive bias for Mathematical rEasoning). Inspired by the logician Charles Peirce, they break reasoning down into three primitives: Deduction, Abduction, and Induction.

To operationalize these primitives without introducing actual mathematical knowledge (like arithmetic rules), they define three abstract components:

  • Rule: A structural template (e.g., $A * A + B = C$).
  • Case: A dictionary of random symbol substitutions (e.g., $\{A : a, B : b, C : d + e\}$).
  • Result: The outcome of applying the Case to the Rule (e.g., $a * a + b = d + e$).

From these components, they generate three distinct pre-training tasks, alongside a Mix task that samples uniformly from all three:

The three reasoning primitives and their corresponding inference maps.

Symbol-Agnostic Representation

To ensure the model learns abstract structural relationships rather than memorizing specific characters, the authors randomize the symbol vocabulary for every single training example. They prepend a mapping split (using <Rule> and <Math> tokens) to explicitly signal to the model which tokens represent variables versus operators.

Discarding Embeddings

Crucially, when transitioning from LIME pre-training to a downstream task, the vocabulary embeddings and output layer weights are completely discarded. Only the internal Transformer weights are transferred. This forces the downstream model to rely entirely on the abstract, procedural habits learned during pre-training, rather than any semantic content.

Datasets

The pre-training datasets are entirely synthetic, generated procedurally using random symbol strings.

To evaluate the transferred inductive bias, the authors test the models on four diverse, large-scale formal mathematical reasoning benchmarks:

  1. IsarStep: Predicting missing intermediate propositions in declarative proofs from the Isabelle proof assistant.
  2. HOList Skip-Tree: Mathematical objective completions (type inference, assumption prediction, equality completion) in HOL-Light.
  3. MetaMathStep: Granular, low-level next-proof-step predictions within the MetaMath library.
  4. LeanStep: Conjecturing completely unseen lemma strings within the sophisticated Lean 3 theorem prover environment.

Key Insights and Ideas

  • Data-Driven Inductive Bias: The paper proves that inductive bias doesn't have to be hard-coded into hardware or model layers; it can be elegantly distilled through data.
  • Procedural vs. Semantic Transfer: Because the embeddings are thrown away before fine-tuning, the observed performance boosts stem entirely from how the model processes structural syntax, not what words it recognizes.
  • Incredible Compute Efficiency: Traditional language model pre-training takes days or weeks across hundreds of GPUs. LIME pre-training takes only 2 hours on a single Nvidia Tesla T4 GPU, accounting for less than 1% to 2.5% of the downstream training budget.
  • The Power of Abduction: Among the individual primitives, pre-training on Abduction (predicting the hidden substitutions given the rule and result) often yielded the strongest downstream boosts, highlighting the value of inverse-problem solving for neural logic.

Key Results

LIME pre-trained models consistently and substantially outperformed vanilla Transformers trained from scratch across all benchmarks:

  • IsarStep: LIME Mix improved Top-1 accuracy from 20.4% to 26.9%, outperforming HAT, a custom hierarchical transformer architecture designed specifically for this task.
Figure 1. Validation BLEU along with training on the IsarStep task.
Table 1. Test top-1, top-10 (%) accuracy on the IsarStep task.
  • LeanStep: On the highly challenging task of predicting entirely unseen lemmas, LIME Mix nearly doubled the baseline Top-1 accuracy, jumping from 15.8% to 29.8%.
Table 4. Test top-1, top-10 (%) accuracy on the LeanStep unseen lemma prediction task.
  • HOList & MetaMathStep: LIME variants showed solid improvements, such as boosting HOList equation completion from 46.3% to 51.7% (LIME Mix) and MetaMathStep Top-1 accuracy from 67.7% to 69.9% (LIME Induct).

Limitations and Future Work

While LIME delivers impressive empirical results, the authors note a few open questions:

  • Philosophical Alignment: It remains unproven whether the Transformer is truly learning the exact philosophical concepts of deduction, induction, and abduction, or if it is simply mastering the specific string manipulation mechanics of the synthetic tasks.
  • Vocabulary Size Sensitivity: Ablation studies showed that the vocabulary size ($S$) chosen for the synthetic tasks has a non-trivial, poorly understood impact on downstream performance.
  • Generalization to NLP: The current work focuses strictly on formal mathematical symbols. A natural next step is exploring whether similar primitive-based synthetic tasks can improve natural language reasoning or general NLP benchmarks.

Summary updated

BibTeX
@inproceedings{wu2021lime,
  author = {Yuhuai Wu and Markus Rabe and Wenda Li and Jimmy Ba and Roger 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