Rethinking Supervision Granularity: Segment-Level Learning for LLM-Based Theorem Proving

Shuo Xu, Jiakun Zhang, Junyu Lai, Chun Cao, Jingwei XuarXiv 2026

TL;DR

This paper introduces segment-level supervision, a novel data construction and inference strategy for Large Language Model (LLM)-based theorem proving in Lean 4. By chunking proof trajectories based on changes in the number of open goals, the authors bridge the gap between single-tactic steps and whole-proof generation, significantly boosting proof success rates while reducing search and token costs.

What Problem Does This Paper Address?

Automated theorem proving (ATP) using LLMs typically relies on two extreme paradigms for training data construction:

  1. Step-level supervision: The model predicts the very next atomic action (tactic), and a tree search algorithm explores the possibilities. This provides dense local feedback but fragments coherent mathematical thoughts and leads to massive search spaces.
  2. Whole-proof supervision: The model attempts to generate the entire proof script in one shot. This preserves global structure but suffers from long-horizon generation challenges and high failure rates during inference.

The authors address this "Goldilocks problem" of supervision granularity. They argue that proofs are naturally hierarchical, composed of locally coherent segments where several tactics work together to resolve a specific subgoal. The paper tackles how to automatically identify and leverage these intermediate structural units to improve both model learning and proof search.

Methods

The authors formalize supervision granularity as a boundary-selection problem over verified proof trajectories. To find these boundaries without complex architectures, they introduce a lightweight structural signal: changes in the number of open goals.

Whenever a tactic changes the number of open goals (either expanding a goal into more subgoals or closing one), a boundary is marked. The tactics executed between these boundaries form a locally coherent "segment."

The authors instantiate this via two techniques:

  • Segment-Level Training: Instead of training on single tactics or full proofs, an LLM (Qwen2.5-Math-7B) is fine-tuned to predict these multi-step tactic segments given a boundary proof state.
  • Goal-Aware Rollout (GAR): This is a plug-and-play inference strategy for existing step-level models. When a model generates a tactic that alters the open-goal count, the system triggers a linear rollout for up to $H$ steps rather than immediately branching into a full tree search. This effectively compresses the search space.
Figure 1: Illustration of supervision granularity on the problem algebra_9052 from NuminaMath- LEAN. For simplicity, proof states show only tactic transitions and open-goal counts, omitting premises. The same verified proof trajectory is organized into step-level, whole-proof, and segment- level supervision targets, together with their corresponding inference patterns.

Datasets

The approach was evaluated by training on three distinct Lean 4 datasets:

  • STP: A dataset built via self-play with iterative conjecturing and proving.
  • LeanWorkbook: A large-scale problem set formalized from natural language math problems.
  • NuminaMath-LEAN: A diverse dataset containing competition-level math problems.

For evaluation, the authors used the respective in-domain test sets alongside miniF2F, a standard, widely recognized benchmark for formal olympiad-level mathematics.

Key Insights and Ideas

  • Open Goals as Natural Boundaries: The number of open goals is an elegant proxy for proof structure. A change in the goal count naturally signals the completion of a sub-task or a shift in strategy, making it a highly effective boundary marker.
  • Optimization Friendliness: One might expect longer target sequences (segments vs. single tactics) to be harder to learn. However, training loss curves revealed that segment-level supervision optimizes steadily and often achieves lower final loss than whole-proof models, proving to be highly compatible with autoregressive LLM training.
  • Collapsing the Search Tree: Treating segments as macro-actions makes the search tree shallower. By avoiding explicit branching at every single atomic tactic, the prover concentrates its search budget on structurally meaningful transitions.

Key Results

  • Superior Success Rates: When trained on NuminaMath-LEAN, the segment-level model achieved a 66.31% success rate on miniF2F, consistently outperforming both step-level (63.11%) and whole-proof (55.90%) baselines. Similar gains were observed across STP and LeanWorkbook.
  • Plug-and-Play Inference Gains: Without any retraining, applying Goal-Aware Rollout (GAR) to existing state-of-the-art provers improved their performance on miniF2F:
  • BFS-Prover-V2-7B jumped from 68.77% to 70.74%.
  • InternLM2.5-StepProver improved from 59.59% to 60.33%.
  • Reduced Inference Costs: GAR significantly cut down on generation costs. For InternLM2.5-StepProver, the average token cost on common-solved problems dropped from 966.05 to 590.77 tokens, nearly halving the time cost.

Limitations and Future Work

  • Heuristic Imperfections: The open-goal count is an approximate proxy. Some complex tactics substantially alter the semantic context of a proof without changing the total number of goals, meaning the model might miss ideal segment boundaries.
  • Trajectory Dependency: This method relies entirely on the availability of pre-existing, verified proof trajectories. It optimizes how data is organized but does not generate entirely new proof data.
  • Diminishing Returns on Short Proofs: On datasets dominated by very short proofs (1-2 steps), the overhead of generating longer macro-actions can occasionally negate the search compression benefits.

For future work, the authors suggest exploring more sophisticated semantic boundary signals, such as tracking text embedding similarities or state changes, to further refine segment boundaries.

Summary updated

BibTeX
@misc{xu2026rethinking,
  author = {Shuo Xu and Jiakun Zhang and Junyu Lai and Chun Cao and Jingwei Xu},
  title = {{Rethinking Supervision Granularity: Segment-Level Learning for LLM-Based Theorem Proving}},
  year = {2026},
  eprint = {2605.11905},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.11905},
}
Figure