Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
specification-generation
code-generation
lean4
autoformalization
formal-verification
reinforcement-learning
conversational
Instructions to use eth-algopt/AuXSpec-9B-RL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eth-algopt/AuXSpec-9B-RL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="eth-algopt/AuXSpec-9B-RL") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("eth-algopt/AuXSpec-9B-RL") model = AutoModelForMultimodalLM.from_pretrained("eth-algopt/AuXSpec-9B-RL", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use eth-algopt/AuXSpec-9B-RL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "eth-algopt/AuXSpec-9B-RL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "eth-algopt/AuXSpec-9B-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/eth-algopt/AuXSpec-9B-RL
- SGLang
How to use eth-algopt/AuXSpec-9B-RL 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 "eth-algopt/AuXSpec-9B-RL" \ --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": "eth-algopt/AuXSpec-9B-RL", "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 "eth-algopt/AuXSpec-9B-RL" \ --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": "eth-algopt/AuXSpec-9B-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use eth-algopt/AuXSpec-9B-RL with Docker Model Runner:
docker model run hf.co/eth-algopt/AuXSpec-9B-RL
Update model card
Browse files
README.md
CHANGED
|
@@ -37,8 +37,8 @@ AuXSpec is a Lean framework that pairs declarative postconditions with executabl
|
|
| 37 |
|
| 38 |
**AuXSpec-9B-RL** is Qwen3.5-9B trained with supervised fine-tuning on these samples and then reinforcement learning with the execution-based reward. Given a natural-language programming problem, it writes a complete Lean 4 file (Lean 4.32, Mathlib) for one of four tasks:
|
| 39 |
|
| 40 |
-
- **SpecGen**: a validity predicate on inputs, a declarative specification of the correct output, an executable checker, and `#guard` test cases
|
| 41 |
-
- **CodeGen**: an implementation against a given specification
|
| 42 |
- **SpecGen-Repair** and **CodeGen-Repair**: a fixed file, given a failing one and the checker's feedback.
|
| 43 |
|
| 44 |
The model reasons inside `<think>...</think>` before the answer.
|
|
@@ -52,7 +52,7 @@ The model reasons inside `<think>...</think>` before the answer.
|
|
| 52 |
|
| 53 |
**Supervised fine-tuning**
|
| 54 |
|
| 55 |
-
- 19.5K training samples grown over 3 rounds of expert iteration on LeetCode, Codeforces and AtCoder problems
|
| 56 |
|
| 57 |
**Reinforcement learning**
|
| 58 |
|
|
@@ -67,15 +67,15 @@ The model reasons inside `<think>...</think>` before the answer.
|
|
| 67 |
| AuXSpec-9B-RL | Qwen3.5-9B | 9.4B | BF16 | 32K | [🤗 Hugging Face](https://huggingface.co/AI4TCS/AuXSpec-9B-RL) |
|
| 68 |
| AuXSpec-27B-RL | Qwen3.8-27B | 27.4B | BF16 | 32K | [🤗 Hugging Face](https://huggingface.co/AI4TCS/AuXSpec-27B-RL) |
|
| 69 |
|
| 70 |
-
Both models keep the architecture and tokenizer of their base models (`Qwen3_5ForConditionalGeneration`) and are stored as BF16 safetensors. All evaluations in Section 4 run in vLLM with `max_model_len=32768` and `max_tokens=16384`
|
| 71 |
|
| 72 |
## 4. Evaluation Results
|
| 73 |
|
| 74 |
-
In each column, bold marks the best value and underline the second best
|
| 75 |
|
| 76 |
### 4.1 AuXSpec-Test (in domain)
|
| 77 |
|
| 78 |
-
To
|
| 79 |
|
| 80 |
<div align="center">
|
| 81 |
<table style="font-size:0.92em;border-collapse:collapse;border-top:2px solid #9ca3af;border-bottom:2px solid #9ca3af">
|
|
@@ -106,7 +106,7 @@ To evaluate in-domain performance, we test the models after SFT and RL on AuXSpe
|
|
| 106 |
|
| 107 |
The repair tasks of the frontier models were run with an earlier version of the repair prompts.
|
| 108 |
|
| 109 |
-
**CodeGen efficiency.** To
|
| 110 |
|
| 111 |
<div align="center">
|
| 112 |
<table style="font-size:0.92em;border-collapse:collapse;border-top:2px solid #9ca3af;border-bottom:2px solid #9ca3af">
|
|
@@ -137,7 +137,7 @@ The repair tasks of the frontier models were run with an earlier version of the
|
|
| 137 |
|
| 138 |
### 4.2 Verina (out of domain)
|
| 139 |
|
| 140 |
-
To evaluate
|
| 141 |
|
| 142 |
<div align="center">
|
| 143 |
<table style="font-size:0.92em;border-collapse:collapse;border-top:2px solid #9ca3af;border-bottom:2px solid #9ca3af">
|
|
@@ -173,7 +173,7 @@ To evaluate out-of-domain generalization, we test the models after SFT and RL on
|
|
| 173 |
|
| 174 |
### 4.3 General capabilities
|
| 175 |
|
| 176 |
-
To
|
| 177 |
|
| 178 |
<div align="center">
|
| 179 |
<table style="font-size:0.92em;border-collapse:collapse;border-top:2px solid #9ca3af;border-bottom:2px solid #9ca3af">
|
|
@@ -193,7 +193,7 @@ To evaluate general capabilities outside Lean, we test the models after SFT and
|
|
| 193 |
</table>
|
| 194 |
</div>
|
| 195 |
|
| 196 |
-
|
| 197 |
|
| 198 |
## 5. How to Run Locally
|
| 199 |
|
|
@@ -220,11 +220,11 @@ resp = client.chat.completions.create(
|
|
| 220 |
print(resp.choices[0].message.content)
|
| 221 |
```
|
| 222 |
|
| 223 |
-
**Prompts.** The `prompts/` folder holds the system prompt of each task (`spec_gen`, `code_gen`, `spec_repair`, `code_repair`) and one example user turn. A user turn gives the problem statement, its constraints, the signature, the test cases and the Lean types of `Input` and `Output`
|
| 224 |
|
| 225 |
## 6. Limitations
|
| 226 |
|
| 227 |
-
- The model is specialized for Lean 4 specification and implementation of algorithmic problems
|
| 228 |
- A specification that passes the given test cases and the judge-based checks can still miss behavior the tests do not exercise.
|
| 229 |
|
| 230 |
## 7. License
|
|
|
|
| 37 |
|
| 38 |
**AuXSpec-9B-RL** is Qwen3.5-9B trained with supervised fine-tuning on these samples and then reinforcement learning with the execution-based reward. Given a natural-language programming problem, it writes a complete Lean 4 file (Lean 4.32, Mathlib) for one of four tasks:
|
| 39 |
|
| 40 |
+
- **SpecGen**: a validity predicate on inputs, a declarative specification of the correct output, an executable checker, and `#guard` test cases.
|
| 41 |
+
- **CodeGen**: an implementation against a given specification.
|
| 42 |
- **SpecGen-Repair** and **CodeGen-Repair**: a fixed file, given a failing one and the checker's feedback.
|
| 43 |
|
| 44 |
The model reasons inside `<think>...</think>` before the answer.
|
|
|
|
| 52 |
|
| 53 |
**Supervised fine-tuning**
|
| 54 |
|
| 55 |
+
- 19.5K training samples grown over 3 rounds of expert iteration on LeetCode, Codeforces and AtCoder problems. Each round fine-tunes the model from the base model on the accumulated samples and adds the outputs that meet the acceptance criteria.
|
| 56 |
|
| 57 |
**Reinforcement learning**
|
| 58 |
|
|
|
|
| 67 |
| AuXSpec-9B-RL | Qwen3.5-9B | 9.4B | BF16 | 32K | [🤗 Hugging Face](https://huggingface.co/AI4TCS/AuXSpec-9B-RL) |
|
| 68 |
| AuXSpec-27B-RL | Qwen3.8-27B | 27.4B | BF16 | 32K | [🤗 Hugging Face](https://huggingface.co/AI4TCS/AuXSpec-27B-RL) |
|
| 69 |
|
| 70 |
+
Both models keep the architecture and tokenizer of their base models (`Qwen3_5ForConditionalGeneration`) and are stored as BF16 safetensors. All evaluations in Section 4 run in vLLM with `max_model_len=32768` and `max_tokens=16384`.
|
| 71 |
|
| 72 |
## 4. Evaluation Results
|
| 73 |
|
| 74 |
+
In each column, bold marks the best value and underline the second best. The small number next to our results is the change from the backbone model, green for a gain and red for a drop. All results use 4 samples per problem. Our models are sampled at temperature 0.3, top-p 0.95, top-k 20, presence penalty 1.0. Other models use their recommended settings. pass@1 is averaged over the 4 samples and pass@4 counts a problem as solved if any sample passes.
|
| 75 |
|
| 76 |
### 4.1 AuXSpec-Test (in domain)
|
| 77 |
|
| 78 |
+
To assess in-domain performance, we evaluate on AuXSpec-Test, a 300-problem expert-reviewed LeetCode benchmark with correctness proofs, in all four tasks. A file passes when it compiles with no error, its guards reproduce the given test cases, and the judge-based quality checks pass.
|
| 79 |
|
| 80 |
<div align="center">
|
| 81 |
<table style="font-size:0.92em;border-collapse:collapse;border-top:2px solid #9ca3af;border-bottom:2px solid #9ca3af">
|
|
|
|
| 106 |
|
| 107 |
The repair tasks of the frontier models were run with an earlier version of the repair prompts.
|
| 108 |
|
| 109 |
+
**CodeGen efficiency.** To assess the efficiency of generated implementations, we report a stricter *fast only* score next to the *any speed* score above, which accepts correct but slow implementations. *Fast only* counts an implementation as wrong when the implementation judge finds a known algorithm faster by more than a log factor and the implementation takes over about 10^7 steps on the largest admitted input. Δ is fast only minus any speed.
|
| 110 |
|
| 111 |
<div align="center">
|
| 112 |
<table style="font-size:0.92em;border-collapse:collapse;border-top:2px solid #9ca3af;border-bottom:2px solid #9ca3af">
|
|
|
|
| 137 |
|
| 138 |
### 4.2 Verina (out of domain)
|
| 139 |
|
| 140 |
+
To assess generalization beyond the synthesized data, we evaluate on [Verina](https://arxiv.org/abs/2505.23135), a 189-problem manually curated benchmark with reference specifications, implementations and test cases. Following the original evaluation, generated specifications must be sound and complete with respect to the reference specification on the test cases, and generated implementations must pass all positive test cases. We include the test cases in the prompt, which matches the training inputs and is the inference setting we recommend. <sup>†</sup>[VeriSpecGen](https://arxiv.org/abs/2604.10392) is not released, so the VeriSpecGen rows and the rows of its backbones are taken from the VeriSpecGen paper and use that paper's setting (official Verina harness, no test cases in the prompt, second number pass@10 in italic).
|
| 141 |
|
| 142 |
<div align="center">
|
| 143 |
<table style="font-size:0.92em;border-collapse:collapse;border-top:2px solid #9ca3af;border-bottom:2px solid #9ca3af">
|
|
|
|
| 173 |
|
| 174 |
### 4.3 General capabilities
|
| 175 |
|
| 176 |
+
To assess capabilities outside Lean, we evaluate on (1) math with AIME 2025, (2) function-level code with HumanEval+, (3) instruction following with IFEval and (4) graduate-level science with GPQA-Diamond. Following [DeepSeek-R1](https://arxiv.org/abs/2501.12948), we sample with temperature 0.6 and top-p 0.95 up to 32,768 tokens and report pass@1, averaged over 64 samples per problem on AIME and 8 on GPQA-Diamond. IFEval counts strict prompt accuracy.
|
| 177 |
|
| 178 |
<div align="center">
|
| 179 |
<table style="font-size:0.92em;border-collapse:collapse;border-top:2px solid #9ca3af;border-bottom:2px solid #9ca3af">
|
|
|
|
| 193 |
</table>
|
| 194 |
</div>
|
| 195 |
|
| 196 |
+
Both RL models score below their backbones on these benchmarks, with the largest gap on AIME.
|
| 197 |
|
| 198 |
## 5. How to Run Locally
|
| 199 |
|
|
|
|
| 220 |
print(resp.choices[0].message.content)
|
| 221 |
```
|
| 222 |
|
| 223 |
+
**Prompts.** The `prompts/` folder holds the system prompt of each task (`spec_gen`, `code_gen`, `spec_repair`, `code_repair`) and one example user turn. A user turn gives the problem statement, its constraints, the signature, the test cases and the Lean types of `Input` and `Output`. The repair tasks add the failing file and the checker's feedback. The answer is a single Lean file in a ```` ```lean ```` block after the thinking segment, to be checked with Lean 4.32 and Mathlib.
|
| 224 |
|
| 225 |
## 6. Limitations
|
| 226 |
|
| 227 |
+
- The model is specialized for Lean 4 specification and implementation of algorithmic problems, and it scores below its backbone on the general benchmarks of Section 4.3.
|
| 228 |
- A specification that passes the given test cases and the judge-based checks can still miss behavior the tests do not exercise.
|
| 229 |
|
| 230 |
## 7. License
|