Reliable Use of Lemmas via Eligibility Reasoning and Section$-$Aware Reinforcement Learning

Zhikun Xu, Xiaodong Yu, Ben Zhou, Jiang Liu, Jialian Wu, Ze Wang, Ximeng Sun, Hao Chen, Zicheng LiuarXiv 2026

TL;DR

Large language models often hallucinate the applicability of mathematical lemmas, blindly importing their conclusions without verifying if the necessary preconditions hold. To fix this, the authors introduce RULES, a framework that forces LLMs to explicitly separate precondition validation from utility checking, using a novel section-aware reinforcement learning method to penalize only the specific reasoning steps that fail. This significantly boosts model robustness against tricky mathematical perturbations while maintaining strong end-to-end problem-solving performance.

What Problem Does This Paper Address?

While modern Large Language Models (LLMs) score highly on standard math benchmarks, they frequently rely on superficial pattern imitation rather than rigorous, principled reasoning. A major manifestation of this flaw is the misapplication of mathematical lemmas (established intermediate propositions). When trying to solve a proof, an LLM will often blindly import a lemma's conclusion because it looks superficially relevant, completely failing to verify whether the problem statement actually satisfies the lemma's strict hypotheses or preconditions.

Standard reinforcement learning (RL) methods like Group Relative Policy Optimization (GRPO) don't solve this because they typically use a single binary reward based on the final answer. This coarse-grained feedback obscures where the model's reasoning broke down, causing the model to overfit to label-level shortcuts and making it incredibly brittle when mathematical statements are slightly perturbed.

Methods

The authors propose RULES (Reliable Use of Lemmas via Eligibility Reasoning and Section-Aware Reinforcement Learning), which tackles the problem through two main components:

  1. Structured Lemma-Judging Task: Instead of asking the model for a simple "yes/no" utility judgment, the prompt forces a sequential, two-stage output:
  2. Step 1: Precondition Check: The model reasons about and outputs whether the lemma's hypotheses are satisfied (True or False).
  3. Step 2: Conclusion Check: The model reasons about and outputs whether the lemma's conclusion actually helps solve the problem (True or False).
  4. Section-Aware Reinforcement Learning: Built on top of GRPO, this training mechanism introduces a token-masking function during gradient updates. If the model correctly passes the precondition check but fails the final utility judgment, the loss mask zeroes out the gradients for the correct precondition section. This ensures the model is penalized only for the faulty conclusion section, preserving valid intermediate reasoning and enforcing a strict "check-before-use" discipline.

Datasets

The framework was trained and evaluated using a diverse mix of natural language and formal proof corpora:

  • In-Domain Data: Sourced from NaturalProofs (4,744 samples), NLPS (Natural Language Premise Selection, 2,858 samples), Premise Selection in Isabelle (4,484 samples), and IMO-lemma (986 samples).
  • Out-of-Domain Perturbation Suite: To test robustness against superficial pattern matching, the authors used DeepTheorem data to curate 839 out-of-domain samples where mathematical statements were minimally edited to intentionally violate a lemma's preconditions.
  • End-to-End (E2E) Benchmarks: Evaluated on downstream performance using Putnam-Axiom, CounterMATH, IneqMath, MATH-Perturb, and TheoremQA.

Key Insights and Ideas

  • The Rigorousness Tradeoff: The authors highlight an interesting phenomenon where standard models sometimes "get lucky" on downstream tasks by hallucinating lemma applicability to force a solution path. RULES prioritizes precision and safety against invalid reasoning, which can occasionally lower recall on looser tasks but guarantees mathematically sound steps.
  • Granular Credit Assignment Prevents Shortcuts: Treating an entire multi-step reasoning chain as a single rollout forces the model to overfit to surface correlations. Isolating the optimization penalty to the exact section responsible for the failure is computationally negligible but fundamentally changes what the model learns.
  • Staged Structure is Mandatory: Ablation studies showed that simply asking for both checks simultaneously at the end of the generation ("two-section-onetime") severely degrades robustness compared to the sequential protocol.

Key Results

The authors evaluated RULES across four prominent base models: DeepMath-1.5B, OLMo-2-7B, Qwen2.5-Math-7B, and Llama-3.1-8B.

  • Massive Robustness Gains: On the out-of-domain perturbation test (DT), RULES dramatically outperformed both vanilla inference and standard single-label GRPO. For instance, OLMo2's accuracy jumped from 46.8% (GRPO) to 60.5% (RULES), and Qwen2.5 climbed from 81.2% to 87.8%.
  • Maintained E2E Performance: On downstream end-to-end benchmarks, RULES performed broadly on par with or slightly better than the single-label RL baseline, proving that enforcing strict gating doesn't break general problem-solving capabilities.
Table 1: Main Results. For in-domain test, NP, NLPS, IS, and IL stands for NaturalProofs, NLPS, Premise Selection in Isabelle, IMO-Lemma derived test sets. DT stands for DeepTheorem-sampled perturbation test set. PA, CM, IM, MP, and TQ stand for Putnam-Axiom, CounterMATH, IneqMath, MATH-Perturb, and TheoremQA. MP-hard and MP-simple stand for hard and simple perturbations based on the paper. TQ-Math is the math subset of the TQ benchmark. The CounterMATH is using F1 due to imbalanced data distribution mentioned in Li et al. (2025b) and the rest of data is using exact-match based accuracy.

Limitations and Future Work

  • Task Scope: The study focuses exclusively on the task of lemma-judging (premise selection and validation) rather than full, open-ended mathematical proof generation.
  • Asymmetric Supervision: For the perturbation training data, only the gold precondition label was available (the conclusion-utility label was omitted to avoid strategy dependence), which introduces a slight supervision asymmetry.
  • Scale and Language Coverage: The experiments were restricted to mid-sized models (up to 8B parameters) and primarily English-centric datasets. Extending RULES to larger model scales and other formal proof assistants like Lean or Coq remains an open avenue for future research.

Summary updated

BibTeX
@misc{xu2026reliable,
  author = {Zhikun Xu and Xiaodong Yu and Ben Zhou and Jiang Liu and Jialian Wu and Ze Wang and Ximeng Sun and Hao Chen and Zicheng Liu},
  title = {{Reliable Use of Lemmas via Eligibility Reasoning and Section$-$Aware Reinforcement Learning}},
  year = {2026},
  eprint = {2602.00998},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.00998},
}
Figure