STP: Self-play LLM Theorem Provers with Iterative Conjecturing and Proving
Paper • 2502.00212 • Published • 3
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("kfdong/STP_model_Lean")
model = AutoModelForCausalLM.from_pretrained("kfdong/STP_model_Lean")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))This is the final Self-play Theorem Prover model as described in the paper https://arxiv.org/abs/2502.00212. The training and evalution code is avaliable here.
@article{dong2025beyond,
title={Beyond Limited Data: Self-play LLM Theorem Provers with Iterative Conjecturing and Proving},
author={Dong, Kefan and Ma, Tengyu},
journal={arXiv preprint arXiv:2502.00212},
year={2025}
}
The table below compares the pass@3200 performance of STP (our model) and DeepSeek-Prover-V1.5 on miniF2F-test and ProofNet-test.
| miniF2F-test | ProofNet-test | |
|---|---|---|
| DeepSeek-Prover-V1.5-SFT | 53.3% ± 0.5% | 21.0% ± 0.9% |
| DeepSeek-Prover-V1.5-RL | 54.9% ± 0.7% | 22.0% ± 0.5% |
| STP | 61.7% ± 0.6% | 23.1% ± 0.5% |
We also release the dataset here, which contains:
Our final model is finetuned from DeepSeek-Prover-V1.5-SFT with this dataset for 1 epoch.
Base model
deepseek-ai/DeepSeek-Prover-V1.5-Base
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kfdong/STP_model_Lean") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)