Introduction | Technical Overview | Performance | Use in Lean | Proof Search | Citation
We introduce BFS-Prover-V2, the state-of-the-art open-source step-level theorem proving system for Lean4, designed to address the dual challenges of scaling both training and inference in neural theorem proving. BFS-Prover-V2 introduces novel solutions to overcome these limitations through:
BFS-Prover-V2 achieves 95.08% and 41.4% on the miniF2F and ProofNet test sets respectively, setting a new state-of-the-art for step-level provers.
Figure: Overview of the multi-stage expert iteration framework
At the start of each training round, the system evaluates the model's performance to determine whether it has plateaued. If the model continues to improve, it entersan inner expert iteration loop involving rollout, tactic filtering, and refinement. Once improvement stalls, the system transitions to the outer retraining loop, which performs data re-synthesis, data curation, and full retraining from the base checkpoint.
Figure: Overview of the planner-enhanced multi-agent tree search architecture.
The planner agent (a general-purpose reasoning model) decomposes the main theorem into a sequence of simpler subgoals, which are managed in a shared subgoal cache and solved in parallel by multiple prover agents using best-first tree search. Successfully proven subgoals augment the main proof's context, while failures can trigger a dynamic replanning loop.
| Model | miniF2F-test | miniF2F-valid | ProofNet-test |
|---|---|---|---|
| BFS-Prover-V2-7B | 82.4% | - | - |
| BFS-Prover-V2-32B | 86.1% | 85.5% | 41.4% |
| BFS-Prover-V2-32B w/ Planner | 95.08% | 95.5% | - |
Table: Benchmark performance of BFS-Prover-V2 series.
https://github.com/user-attachments/assets/5e4d00b8-6ea1-465c-92dd-bf85a8c48cb1
BFS-Prover-V2 is integrated with LLMLean, enabling interactive theorem proving in VS Code.
# e.g., for 7B model with 8-bit quantization
ollama pull zeyu-zheng/BFS-Prover-V2-7B:q8_0
# ~/.config/llmlean/config.toml
api = "ollama"
model = "zeyu-zheng/BFS-Prover-V2-7B:q8_0"
mode = "parallel"
prompt = "tacticstate"
responseFormat = "tactic"
numSamples = "5"
-- lakefile.lean
require llmlean from git "https://github.com/cmu-l3/llmlean.git"
or
# lakefile.toml
[[require]]
name = "llmlean"
git = "https://github.com/cmu-l3/llmlean.git"
import Mathlib
import LLMlean
example : ... := by
llmstep "" -- Get suggestion for next tactic
-- or
llmstep "rw" -- Get suggestion for using tactic `rw` next
# Clone the repository
git clone https://github.com/ByteDance-Seed/BFS-Prover-V2.git
cd BFS-Prover-V2
# Install dependencies
pip install .
from lean_dojo import *
url = URL
commit = COMMIT_HASH
repo = LeanGitRepo(url, commit)
trace(repo)
The repository includes sample data for planning and proof search in src/data.
src/plan/config.yamlImportant: Ensure that the statement_file and dojo_data_file contain matching theorems. Each theorem ID in the statement file must have a corresponding entry in the dojo data file. Mismatched data will cause verification errors.
For a quick start, you can use the provided demo data:
dojo_data_file: "src/data/demo_dojo.jsonl"statement_file: "src/data/demo_statements.jsonl"These demo files contain 7 matching theorems from the miniF2F test set.
vllm serve --model /PATH/TO/YOUR/PLANNER_MODEL --port 8000 --reasoning_parser YOUR_REASONING_PARSER
bash src/plan/run_local_plan.sh
bash src/plan/run_local_replan.sh
src/search/run_local_search.shFor a quick start with demo data, you can use:
--file_path to src/data/demo_dojo.jsonl--plan_file to src/data/demo_plan.jsonThe demo_plan.json contains pre-generated plans for the 7 demo theorems that can be used directly for proof search.
bash src/search/run_local_search.sh
@article{xin2025scaling,
title={Scaling up Multi-Turn Off-Policy RL and Multi-Agent Tree Search for LLM Step-Provers},
author={Xin, Ran and Zheng, Zeyu and Nie, Yanchen and Yuan, Kun and Xiao, Xia},
journal={arXiv preprint arXiv:2509.06493},
year={2025}
}
This project is licensed under the Apache License 2.0.
3 commits
1 commits
Python
96.9%
Shell
3.1%
Introduction | Technical Overview | Performance | Use in Lean | Proof Search | Citation
We introduce BFS-Prover-V2, the state-of-the-art open-source step-level theorem proving system for Lean4, designed to address the dual challenges of scaling both training and inference in neural theorem proving. BFS-Prover-V2 introduces novel solutions to overcome these limitations through:
BFS-Prover-V2 achieves 95.08% and 41.4% on the miniF2F and ProofNet test sets respectively, setting a new state-of-the-art for step-level provers.
Figure: Overview of the multi-stage expert iteration framework
At the start of each training round, the system evaluates the model's performance to determine whether it has plateaued. If the model continues to improve, it entersan inner expert iteration loop involving rollout, tactic filtering, and refinement. Once improvement stalls, the system transitions to the outer retraining loop, which performs data re-synthesis, data curation, and full retraining from the base checkpoint.
Figure: Overview of the planner-enhanced multi-agent tree search architecture.
The planner agent (a general-purpose reasoning model) decomposes the main theorem into a sequence of simpler subgoals, which are managed in a shared subgoal cache and solved in parallel by multiple prover agents using best-first tree search. Successfully proven subgoals augment the main proof's context, while failures can trigger a dynamic replanning loop.
| Model | miniF2F-test | miniF2F-valid | ProofNet-test |
|---|---|---|---|
| BFS-Prover-V2-7B | 82.4% | - | - |
| BFS-Prover-V2-32B | 86.1% | 85.5% | 41.4% |
| BFS-Prover-V2-32B w/ Planner | 95.08% | 95.5% | - |
Table: Benchmark performance of BFS-Prover-V2 series.
https://github.com/user-attachments/assets/5e4d00b8-6ea1-465c-92dd-bf85a8c48cb1
BFS-Prover-V2 is integrated with LLMLean, enabling interactive theorem proving in VS Code.
# e.g., for 7B model with 8-bit quantization
ollama pull zeyu-zheng/BFS-Prover-V2-7B:q8_0
# ~/.config/llmlean/config.toml
api = "ollama"
model = "zeyu-zheng/BFS-Prover-V2-7B:q8_0"
mode = "parallel"
prompt = "tacticstate"
responseFormat = "tactic"
numSamples = "5"
-- lakefile.lean
require llmlean from git "https://github.com/cmu-l3/llmlean.git"
or
# lakefile.toml
[[require]]
name = "llmlean"
git = "https://github.com/cmu-l3/llmlean.git"
import Mathlib
import LLMlean
example : ... := by
llmstep "" -- Get suggestion for next tactic
-- or
llmstep "rw" -- Get suggestion for using tactic `rw` next
# Clone the repository
git clone https://github.com/ByteDance-Seed/BFS-Prover-V2.git
cd BFS-Prover-V2
# Install dependencies
pip install .
from lean_dojo import *
url = URL
commit = COMMIT_HASH
repo = LeanGitRepo(url, commit)
trace(repo)
The repository includes sample data for planning and proof search in src/data.
src/plan/config.yamlImportant: Ensure that the statement_file and dojo_data_file contain matching theorems. Each theorem ID in the statement file must have a corresponding entry in the dojo data file. Mismatched data will cause verification errors.
For a quick start, you can use the provided demo data:
dojo_data_file: "src/data/demo_dojo.jsonl"statement_file: "src/data/demo_statements.jsonl"These demo files contain 7 matching theorems from the miniF2F test set.
vllm serve --model /PATH/TO/YOUR/PLANNER_MODEL --port 8000 --reasoning_parser YOUR_REASONING_PARSER
bash src/plan/run_local_plan.sh
bash src/plan/run_local_replan.sh
src/search/run_local_search.shFor a quick start with demo data, you can use:
--file_path to src/data/demo_dojo.jsonl--plan_file to src/data/demo_plan.jsonThe demo_plan.json contains pre-generated plans for the 7 demo theorems that can be used directly for proof search.
bash src/search/run_local_search.sh
@article{xin2025scaling,
title={Scaling up Multi-Turn Off-Policy RL and Multi-Agent Tree Search for LLM Step-Provers},
author={Xin, Ran and Zheng, Zeyu and Nie, Yanchen and Yuan, Kun and Xiao, Xia},
journal={arXiv preprint arXiv:2509.06493},
year={2025}
}
This project is licensed under the Apache License 2.0.
3 commits
1 commits
Python
96.9%
Shell
3.1%