Instructions to use kfdong/STP_model_Lean with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kfdong/STP_model_Lean with Transformers:
# 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)# 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use kfdong/STP_model_Lean with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kfdong/STP_model_Lean" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kfdong/STP_model_Lean", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kfdong/STP_model_Lean
- SGLang
How to use kfdong/STP_model_Lean with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "kfdong/STP_model_Lean" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kfdong/STP_model_Lean", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "kfdong/STP_model_Lean" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kfdong/STP_model_Lean", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kfdong/STP_model_Lean with Docker Model Runner:
docker model run hf.co/kfdong/STP_model_Lean
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- kfdong/STP_Lean_SFT
|
| 5 |
+
base_model:
|
| 6 |
+
- deepseek-ai/DeepSeek-Prover-V1.5-SFT
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
This is the final Self-play Theorem Prover model as described in the paper [https://arxiv.org/abs/2502.00212](https://arxiv.org/abs/2502.00212). The training and evalution code is avaliable [here](https://github.com/kfdong/STP/tree/main).
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
```tex
|
| 13 |
+
@article{dong2025beyond,
|
| 14 |
+
title={Beyond Limited Data: Self-play LLM Theorem Provers with Iterative Conjecturing and Proving},
|
| 15 |
+
author={Dong, Kefan and Ma, Tengyu},
|
| 16 |
+
journal={arXiv preprint arXiv:2502.00212},
|
| 17 |
+
year={2025}
|
| 18 |
+
}
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
## 1. Evaluation Results
|
| 22 |
+
|
| 23 |
+
The table below compares the pass@3200 performance of STP (our model) and DeepSeek-Prover-V1.5 on miniF2F-test and ProofNet-test.
|
| 24 |
+
|
| 25 |
+
<div align="center">
|
| 26 |
+
|
| 27 |
+
| | miniF2F-test | ProofNet-test |
|
| 28 |
+
|--------|------------------|------------------|
|
| 29 |
+
| **DeepSeek-Prover-V1.5-SFT** | 53.3% ± 0.5% | 21.0% ± 0.9% |
|
| 30 |
+
| **DeepSeek-Prover-V1.5-RL** | 54.9% ± 0.7% | 22.0% ± 0.5% |
|
| 31 |
+
| **STP** | **61.7% ± 0.6%** | **23.1% ± 0.5%** |
|
| 32 |
+
|
| 33 |
+
</div>
|
| 34 |
+
|
| 35 |
+
## 2. Dataset
|
| 36 |
+
|
| 37 |
+
We also release the dataset [here](https://huggingface.co/datasets/kfdong/STP_Lean), which contains:
|
| 38 |
+
- Extracted examples from mathlib4,
|
| 39 |
+
- Generated correct proofs of statements in LeanWorkbook,
|
| 40 |
+
- Generated correct proofs of conjectures proposed by our model during self-play training.
|
| 41 |
+
|
| 42 |
+
Our final model is finetuned from DeepSeek-Prover-V1.5-SFT with this dataset for 1 epoch.
|