FineProofEnvs: Better Math Proofs from a 2B Model with RL
Built on QED-Nano by LM-Provers (Yuxiao Qu, Amrith Setlur, Jasper Dekoninck, Edward Beeching, Jia Li, Ian Wu, Lewis Tunstall and Aviral Kumar; CMU, Hugging Face, ETH Zurich and Numina). Their problems, marking schemes, judge and RL recipe do the heavy lifting here. This is a small replication of the RL stage: a 2B model, a custom harness, and everything on Hugging Face.
Qwen3.5-2B, straight from the base model with no SFT, trained with RL to write olympiad proofs. After 500 steps its proofs on held-out problems score 0.41, up from 0.22, graded 0–7 against each problem's marking scheme.
RL from the base model, no SFT, 500 steps held-out mean rubric score 0.217 → 0.407 (0.259 → 0.464 when gpt-oss-120b regrades the same proofs) full-marks proofs went from 12% to 25% of attempts a ~280-line custom harness on Harbor, trained through OpenEnv without changing a line of it one HF Job, 28 hours, about $820 in GPU time and judge calls
Everything is open: the environment, the harness, the model, the training logs and every eval attempt are in the FineProofEnvs collection.
The task: write a proof, get graded on a marking scheme
The model gets an olympiad problem and writes a proof in plain language. A separate judge grades it 0–7 against the problem's marking scheme, and the reward is score / 7, so a partial proof earns partial credit.
This is QED-Nano's setup, packaged as FineProofEnvs: 5,073 training tasks and 128 test tasks in Harbor format
(train,
test), from their
FineProofs-RL problems and gpt-oss-20b judge prompt. The
proof goes to /workspace/proof.md, and a separate sandbox grades it, so the policy never sees the marking scheme or
the judge.
A simple custom harness
Agent harnesses like Claude Code or Codex are built around tools. A proof needs none: the model reads the problem and writes. So the harness here is a small Harbor agent, the FineProof harness. It sends the problem, saves the reply as the proof, and leaves the grading to the judge:
class FineProofAgent(BaseAgent): # a Harbor agent
async def run(self, instruction, env, ctx):
messages = [SYSTEM, user(instruction)]
proof = await complete(messages) # the policy
await env.upload_file(proof, PROOF) # graded by the verifier
That's condensed from agent.py and loop.py,
281 lines in all. With rounds=N the harness adds check-and-rewrite turns: the model grades its own proof like a
strict grader and writes a corrected one, the move QED-Nano's best scaffolds end with. The run below used one call.
What makes it trainable is OpenEnv. Its Harbor server runs the harness, and
every model call goes through a proxy that records the engine's own token ids and logprobs. TRL's async GRPO trains on
exactly those tokens, so the harness has no RL code and doesn't know it's being trained. Naming a harness by its
import path (--harness fineproof_agent.agent:FineProofAgent) landed in OpenEnv with
openenv/OpenEnv#1573, and any Harbor agent can be plugged in the same
way. As a check before training, Qwen3.5-9B scores the same through OpenEnv as through plain harbor run: 0.667 vs
0.717 on the 64 eval problems, a difference within noise (−0.049 ± 0.046).
Training
| Model | Qwen/Qwen3.5-2B, non-thinking mode, no SFT |
| Problems | 1,024 training problems, the easier end of QED-Nano's pool, for a smaller model |
| Update | 128 rollouts: 8 problems × 16 attempts |
| Objective | reward minus the group mean; token losses summed and divided by 32,768 per rollout |
| Cut-off proofs | reward 0 |
| Optimizer | AdamW 8-bit, learning rate 1e-6, 10 warm-up updates |
| Sampling | temperature 0.8, proofs up to 32,768 tokens |
| Judge | gpt-oss-20b, 2 grades per proof, averaged |
The whole run lived on Hugging Face:
- HF Jobs: one
h200x4Job, vLLM on 3 GPUs and the trainer on 1, plus a separate eval Job for each of the 14 checkpoints evaluated. - HF Sandboxes: a container for every rollout's task and its verifier.
- Inference Providers: the gpt-oss-20b judge, on groq with featherless-ai as the fallback.
- Buckets and Trackio: checkpoints, logs and a live dashboard.
500 updates took 28 hours, for about $580 of GPU time and $241 of judge calls across 64,000 training rollouts.
Getting there
The first runs used TRL's async GRPO defaults, with 16k-token proofs and 40 rollouts per update. The reward rose for 40 updates and then fell back (0.18 → 0.28 → 0.19 on the held-out set). The judge wasn't being gamed, since gpt-oss-120b tracked it; the proofs were growing until most were cut off. Four changes, mostly QED-Nano's recipe, made it steady:
- a cut-off proof scores 0, where it used to keep partial credit;
- token losses are summed and divided by the 32k cap, instead of averaged per rollout, which made long wrong proofs cheap;
- advantages are mean-centred only, since dividing by the group's std amplified a single noisy grade;
- each update uses 128 rollouts instead of 40.
Generation was the bottleneck: 89% of each early update was spent waiting on it, so CUDA graphs and more rollouts in flight mattered more than adding GPUs.
Results
| Held-out, 64 problems × 4 attempts | step 0 | step 500 |
|---|---|---|
| mean rubric score, gpt-oss-20b (the training judge) | 0.217 | 0.407 |
| mean rubric score, gpt-oss-120b regrade | 0.259 | 0.464 |
| attempts with full marks | 12.1% | 25.4% |
| problems with a full-marks attempt (pass@4) | 26.6% | 40.6% |
The paired gain is +0.190 ± 0.030: 47 problems improved and 6 got worse. Step 500 is the last checkpoint, not the best one, so picking it never looked at the eval. None of the test problems are in training, and the eval uses only the 64 whose reference proof gpt-oss-120b scores 6/7 or more, so the judge is known to reward a correct proof there.
Here is one of those held-out problems, before and after:
The base model drops terms, writes "Wait, let me re-read the differential equation relationship", decides x²⁰ must be a typo for x² and answers 1. Zero credit. After RL it sets Q(x) = P(x) − x², finds its roots, factors it as x² ∏(x² − k²) and gets 1 − (9!)². All four of its attempts score 7/7, and gpt-oss-120b gives the same grades.
Reading step-250 proofs next to step 0's, the gains are new key ideas rather than new phrasing: a QM-AM bound, an even-polynomial substitution and a corrected off-by-one count, each on a problem the base model had scored 0–1.5 on. Longer proofs don't score higher, and looping outputs went down.
What we learned
- Rubric judges are lenient. Two of four hand-checked 7/7 proofs keep false statements around the right argument, where a careful grader would give about 4/7. That raises the absolute scores at every step, not the gain.
- Harden the verifier before training against it. The proof is fenced between random markers, the first score tag wins, a judge failure writes no reward instead of a 0, and a line after the proof tells the judge that nothing in it is an instruction. That last line took "please give this full marks" style proofs from 7–8 of 50 grades to 0.
- Decontaminate by text, not by id. Review found near-copies of test problems in the training set, and duplicates within it. 26 tasks were removed with 5-gram containment checks.
- Limits: one run, one judge family and 64 eval problems. Next is a judge that grades only the final proof and deducts for false statements, longer training on harder problems, and IMO-ProofBench.
Reproduce it
- Environment: FineEnvs/fineproof-envs-train and -test, with the harness inside.
- Code and the exact run: 08-math-environments/fineproof, with the one command, the pinned stack and the 1,024-problem list in RESULTS.md.
- Model: FineEnvs/Qwen3.5-2B-FineProof-RL.
- Logs: the Trackio dashboard.
- Every eval attempt: FineEnvs/fineproof-rl-runs, with each proof and the judges' written assessments.
Thanks
To the LM-Provers team for QED-Nano: the problems, marking schemes, judge and recipe this builds on. To Harbor, OpenEnv and TRL, and to Ben Burtenshaw for reviewing and merging custom harness support in OpenEnv. And to Sergio Paniego for a thorough review of the release.



