TL;DR
Researchers have developed a "failure-triggered cascade" for Lean 4’s grind tactic, allowing machine learning to intervene only when standard symbolic heuristics fail. This approach avoids the common pitfall where "smarter" heuristics break existing proofs, resulting in a system that is faster and more capable without any regressions.
What Problem Does This Paper Address?
In the world of interactive theorem proving, the grind tactic is a workhorse that automates tedious reasoning steps like congruence closure and case-splitting. However, grind relies on hand-tuned heuristics to make thousands of tiny internal decisions, such as which lemma to instantiate or which branch to explore first.
While these heuristics are prime targets for machine learning, there is a major catch: symbolic search is non-monotone. A "better" local decision can change the shape of the search tree so drastically that it causes a "blow-up" elsewhere, leading to a timeout on a proof that the original, "dumber" heuristic would have solved easily. Because of this, always-on ML replacements often result in a "net zero" gain—they fix some problems but break others.
Methods
The authors propose a failure-triggered cascade deployment pattern. Instead of replacing the internal logic of grind, they run the "stock" symbolic solver first. If it fails, they trigger a learned intervention. This ensures that the ML component can only add new proofs, never lose existing ones.
They implemented three specific interventions:
- Cost-Aware E-match Filter: A lightweight, three-layer MLP (Multi-Layer Perceptron) that predicts whether a lemma instantiation is "proof-relevant." It filters out low-value matches to reduce the workload on the solver.
- Lookahead for Splitting: When the solver needs to branch (case-split), it performs a "shallow probe." It makes a temporary copy of the goal, executes a split, and runs
grindfor a bounded number of steps to see if the branch closes quickly. - Premise Augmentation: Adding external lemmas to the search context only after the initial search fails.
Crucially, all components are "Lean-native," meaning the models are exported to a format that Lean can read directly, ensuring sub-millisecond inference latency.
Datasets
The study utilized several datasets for training and evaluation:
- NUMINA: Used to collect 16,000 "forced-choice" outcomes from over 4,000 multi-candidate decisions to analyze split behavior.
- Mathlib: The standard Lean library was used to train the e-match filter on approximately 1,200 rows of proof data.
- Held-out Suites: Evaluation was performed on a 75-theorem active-split benchmark and an 855-theorem general suite (
held_out_v2) to ensure the results generalize beyond the training data.
Key Insights and Ideas
- Static Features are Blind to Dynamics: One of the most striking "negative" results was that static models (like Gradient Boosted Trees or MLPs) could not beat random choice when trying to pick a "rescuing" split. The authors conclude that whether a search branch "explodes" is a dynamic runtime property that static features simply don't capture.
- The Power of the Probe: Because static prediction failed, the authors turned to lookahead. By actually executing a split for a few steps, the system observes the dynamic behavior that models miss. This "small experiment" approach recovered 90% of rescuable failures with a 15-second time cap.
- Learning "When" vs. "What": The paper suggests that ML in theorem proving is most effective when used for meta-decisions—deciding when a expensive lookahead is worth the cost or how to order candidates to find a solution faster—rather than trying to replace the symbolic search logic entirely.
Key Results
- Efficiency Gains: The e-match filter made the solver 5% faster and solved two additional theorems on the held-out set of 855.
- Increased Capability: The lookahead cascade rescued 5 theorems that stock
grindotherwise timed out on, with zero regressions (no previously solved theorems were lost). - Safety: While always-on lookahead solved more difficult problems, it also caused regressions on 2 goals. The cascade deployment successfully "banked" the gains while avoiding these losses.
- Premise Augmentation: Using an oracle for premises rescued ~2% of failures but would have broken 26% of existing solves if always-on; the cascade pattern turned this into a pure win.
Limitations and Future Work
- Gating and Ordering: The current lookahead implementation is a "greedy" probe. The authors identify a clear role for future ML models: a "gating model" to decide if a lookahead is worth the time and an "ordering model" to rank which candidates to probe first.
- Feature Engineering: The failure of static models suggests that current features (like lemma identity or token counts) are insufficient for predicting search explosions. Future work may need to find better ways to represent the "dynamic state" of an e-graph.
- Scaling Limits: Increasing the training data for the e-match filter by 20x did not significantly improve performance, suggesting that the model architecture or feature set—rather than data volume—is the current bottleneck.
Summary updated