ReProver
Retrieval-augmented theorem prover for Lean 4: a ByT5 premise retriever plus a ByT5 tactic generator.
Language · 2,237 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Language
- Parameters
- 516.7M
- Operations
- 2,237
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2023 Datasets and Benchmarks
- Cited by
- 75 (as of 29 October 2026)
- Authors
- Kaiyu Yang, Aidan M. Swope, Alex Gu and others
- Source
- GitHub: lean-dojo/ReProver
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m19765
- Graph hash
- 0150165e71b6593b3cb694f2bdd3f1db13b92f7e8afee0b93ef503b099c49f9a
- Skeleton hash
- 197669c6030b34f00871870678a17734d428a81653fba626e1ebef80a55ec380
- Architecture hash
- ed01e40b65d14039e6161037ac79f11d1dce075ee2f8d4ffb0e7b64533b476fa
- Diagram SHA-256
- fe387bd62d74b1619fb942bd710e47752268598549ea68138d87e74bfc97d055
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
ReProver (Retrieval-Augmented Prover) is a language-model theorem prover for the Lean proof assistant that selects premises from a math library before it writes each proof step. Given the current proof state, it retrieves a handful of potentially useful premises and generates a tactic conditioned on the state and the retrieved premises together. To prove a theorem, the tactic generator is combined with best-first search.
The model is two networks, both initialized from the google/byt5-small checkpoint, a T5-like encoder-decoder Transformer that operates directly on UTF-8 bytes without tokenization. The retriever uses the encoder only, whereas the generator uses both the encoder and the decoder. The retriever is based on Dense Passage Retriever: it embeds the proof state and each premise and returns the premises with the highest cosine similarity. The paper changes that scheme in two ways, restricting retrieval to premises accessible to the current theorem and training with negative premises sampled from the same Lean source file as the ground truth premise.
The paper's results refer to Lean 3 by default. On LeanDojo Benchmark the paper reports that ReProver proves 51.2% of theorems, against 47.6% for a baseline that generates tactics without retrieval and 29.0% for a zero-shot GPT-4 baseline. The released Lean 4 generator's input is the retrieved premises concatenated with the current proof state and truncated to 2300 UTF-8 bytes.
Key idea. ReProver augments a tactic-generating language model with a retriever that selects premises from Lean's math library, restricted to accessible premises and trained with in-file hard negatives.
- ReProver
- Retrieval-Augmented Prover
- LeanDojo
- theorem proving
- Lean
- Lean 4
- premise selection
- tactic generation
- retrieval-augmented language model
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{yang2023leandojotheoremprovingretrievalaugmented,
title={LeanDojo: Theorem Proving with Retrieval-Augmented Language Models},
author={Kaiyu Yang and Aidan M. Swope and Alex Gu and Rahul Chalamala and Peiyang Song and Shixing Yu and Saad Godil and Ryan Prenger and Anima Anandkumar},
year={2023},
eprint={2306.15626},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2306.15626},
}