Memorize Theorems, Not Instances: Probing SFT Generalization through Mathematical Reasoning

Ruiying Peng, Mengyu Yang, Jing Lei, Xiao-Hui Li, Xueyu Wu, Xinlei ChenNeurIPS 2026

TL;DR

Supervised Fine-Tuning (SFT) often gets a bad rap for turning capable language models into brittle memorization machines that crumble on unseen reasoning problems. This paper argues that memorization isn't the villain—we’re just making models memorize the wrong things. By shifting training from specific problem-solution pairs to the explicit rules and preconditions of mathematical theorems (Theorem-SFT), models learn generalizable logic that transfers across benchmarks and even from pure text into visual geometry.

What Problem Does This Paper Address?

Imagine trying to learn geometry solely by reading thousands of completed homework solutions, without anyone ever stating the Pythagorean theorem. You might notice that whenever the phrase "right triangle" appears, numbers get squared and added. You’d pass tests that look just like the homework, but fail the moment a problem swaps a variable name or introduces a trick condition.

This is the exact trap of standard ("vanilla") SFT. When we fine-tune LLMs on end-to-end problem-solution trajectories, we force them to reverse-engineer general rules from scattered examples. Instead of learning principled deduction, models latch onto surface-level shortcuts and keyword correlations.

Through diagnostic testing, the authors pinpoint two specific ways vanilla SFT breaks down:

  • Premise Oversight: Firing off a rule because of a trigger word without checking if the preconditions actually hold (e.g., assuming a triangle with one $60^\circ$ angle is automatically equilateral).
  • Conclusion Misassignment: Knowing the right rule, but binding it to the wrong objects—like knowing a tangent line creates a $90^\circ$ angle with a circle's radius, yet assigning that $90^\circ$ property to the wrong angle in the diagram.
Figure 2: Errors in single-step reasoning. We identify two main failure modes: premise oversight and entity misassignment in conclusions. The QA pairs are simplified abstractions from real examples to highlight these issues, with full instances provided in the appendix.

Methods

To fix this, the authors take a page from human classrooms: teach the rules explicitly before asking the student to solve problems. They propose Theorem-SFT, a two-stage training pipeline that strips away problem-specific noise ("de-instantiation") without exposing the model to standard problem-solution instances during theorem training:

  1. Theorem Learning (Atomic Rules): Individual theorems are reformulated into structured, functional blocks: <Cond, Map, Exec>.
  2. Cond (Conditions): Acts as a logical gate, complete with counterexamples so the model learns when not to use a rule.
  3. Map (Entity Mapping): Explicitly aligns abstract roles (like [base] or [radius]) to concrete variables.
  4. Exec (Execution Intuition): Describes the core deductive logic independent of any single problem's numbers.
  5. Chain-of-Theorems (Compositional Logic): Complex reasoning requires stringing rules together. This stage trains the model to identify which source theorems are needed and explicitly verify Condition Propagation—ensuring the output of Step 1 genuinely satisfies the strict preconditions required to unlock Step 2.

Using LoRA (Low-Rank Adaptation), the authors also probe where this rule knowledge lives inside the transformer by comparing full-layer tuning (T-All) against tuning only the feed-forward MLP layers (T-MLP).

Figure 1: Left: Comparison between Vanilla SFT and Theorem-SFT (ours), illustrating the goal of Theorem-SFT: learning theorems to improve reasoning generalization. Right: Changes in accuracy (∆accuracy) relative to the baseline for models trained with Vanilla SFT and Theorem-SFT. The significant accuracy gains and corrected reasoning processes demonstrate that Theorem-SFT enables both LLMs and VLMs to apply theorems based on their premises, leading to more accurate and reliable solutions with strong generalization ability. The QA pairs shown in the figure are simplified abstractions derived from real examples to highlight the core issues; the original QA instances can be found in the appendix.

Datasets

To guarantee a fair fight, the authors extract their training theorems strictly from the existing training sets of MATH and GeoQA—meaning Vanilla SFT and Theorem-SFT share the exact same underlying knowledge source, just organized differently.

  • Newly Constructed Training Corpus: ~3.8K geometric rules (from GeoQA), ~6.4K algebraic and probabilistic principles (from MATH), and over 8K synthesized multi-step deductive chains (2 to 5 steps deep).
  • Evaluation Benchmarks: Held-out test sets spanning general and competition math (MATH-500, AGIEval-Math, AGIEval-SAT, Omni-Math, LiveBench-Math), basic arithmetic (GSM1K), and multimodal visual-spatial reasoning (GeoQA).

Key Insights and Ideas

  • Memorize Rules, Not Trajectories: The SFT generalization gap isn't caused by the mechanism of memorization itself, but by inductive bias mismatch. Memorizing invariant structural rules (Cond -> Map -> Exec) turns memorization into a superpower for deduction.
  • Pure Text Teaches Visual Reasoning: Models trained exclusively on text-based theorem structures showed massive leaps in accuracy when tested on GeoQA, which requires reading geometric diagrams. Abstract logical rules appear to be modality-agnostic inside the model.
  • MLP Layers Are the "Rule Library": Restricting weight updates solely to the MLP layers matches—and on visual tasks, slightly beats—tuning the entire network. While attention layers handle context, feed-forward MLP layers act as the parametric storage vault for formal reasoning rules.

Key Results

Across LLaMA, Mistral, Qwen-VL, and Gemma model families, Vanilla SFT frequently degraded performance below the untuned base models, whereas Theorem-SFT delivered consistent gains:

  • Textual Math: On MATH-500, Theorem-SFT boosted LLaMA-3.2-3B-Instruct by +8.8% (from 30.6% base to 39.4%, while Vanilla SFT dropped to 23.4%) and Mistral-7B-Instruct by +14.4% (40.6% to 55.0%). These models also generalized zero-shot to unseen competition benchmarks like AGIEval-Math (+8.6% on LLaMA-3B).
  • Cross-Modal Transfer: On the visual GeoQA benchmark, text-only Theorem-SFT yielded +20.27% on Qwen2.5-VL-7B (jumping from 49.46% base to 69.73% with T-MLP, whereas Vanilla SFT fell to 38.78%) and +13.48% on Gemma-3-4B-IT.
  • Boundary Check: On GSM1K (simple grade-school arithmetic), gains were modest (~1–2%), confirming Theorem-SFT specifically targets structured, theorem-heavy deduction rather than basic calculation.

Limitations and Future Work

The authors note that their experiments focus strictly on mathematics, where rules and preconditions are crisp and enumerable; how Theorem-SFT translates to fuzzier, open-ended reasoning domains remains an open question. Additionally, they highlight investigating how theorem-level supervision interacts with Reinforcement Learning (RL) and how it scales with much larger theorem corpora as key next steps. Finally, their internal mechanistic probes analyzed a single checkpoint on a fixed prompt set, meaning they point to correlation rather than a definitive causal proof of how knowledge is retained.

Summary updated

Abstract

Supervised Fine-Tuning (SFT) is widely used for task-specific adaptation, yet recent work shows it systematically undermines reasoning generalization. We argue the root cause is not memorization itself, but its target: vanilla SFT drives models to exploit and memorize spurious surface correlations in problem-solution pairs, leaving them brittle to superficial input variations. To address this, we propose Theorem-SFT, which reorients supervision toward explicit theorem application by teaching models how rules are invoked rather than what answers look like. Theorem-SFT yields consistent gains across benchmarks and model families: +8.8\% on MATH (LLaMA3.2-3B-Instruct) and +20.27\% on GeoQA (Qwen2.5-VL-7B-Instruct) without modality-specific re-training. Fine-tuning MLP layers alone matches full-layers performance, implicating feed-forward components as the primary locus of reasoning rules. Our findings reframe the debate: Generalization failures stem not from memorization as a mechanism, but from memorizing the wrong inductive targets.
BibTeX
@inproceedings{peng2026memorize,
  author = {Ruiying Peng and Mengyu Yang and Jing Lei and Xiao-Hui Li and Xueyu Wu and Xinlei Chen},
  title = {{Memorize Theorems, Not Instances: Probing SFT Generalization through Mathematical Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=qG2690UFsJ},
}
Figure