Repository navigation
feat: add PutnamBench benchmark - #1115
Merged
Merged
Conversation
Binds the PutnamBench Lean4 formal-proof test split (660 theorems) to the
existing `math_formal_lean` resources server and `simple_agent` (single-turn,
matching NeMo-Skills' evaluation protocol). No new server code.
## Includes
- `benchmarks/putnam_bench/` — benchmark config, `prepare.py`, `prompts/default.yaml`,
README.
- Data source: `trishullab/PutnamBench` at pinned commit
`64cedd86ef523f3d5f5dc7a21c10e3f69564c7d4`. `prepare.py` clones the repo,
runs the upstream `lean4/scripts/rewrite_solutions.py` (which emits 660
`.lean` files with `sorry`-swapping applied), then regex-parses each into
the `math_formal_lean` server's schema.
- Prompt reuses `lean4/formal-proof-deepseek-prover-v2` (same as miniF2F and
MOBench) — per user preference, not the upstream NeMo-Skills choice of
`lean4/formal-proof`.
- Per-row schema `{name, split, header, informal_prefix, formal_statement}`
— byte-identical to Skills' `nemo_skills/dataset/putnam-bench/test.jsonl`
(verified via sorted-diff across all 660 rows). No `goal` field; server
doesn't use it and upstream omits it.
- `prepare.py` asserts exactly 660 `.lean` files materialize, to catch drift
in either the pinned repo or the upstream `rewrite_solutions.py`.
## Test plan
- `ng_prepare_benchmark` completes the clone+subprocess+parse flow and writes
660-row JSONL byte-identical to NeMo-Skills' upstream.
- `ng_list_benchmarks` shows `putnam_bench` bound to
`putnam_bench_math_formal_lean_simple_agent` with `num_repeats=32`.
- Existing `resources_servers/math_formal_lean` tests unaffected (mocked sandbox).
- `pre-commit run --files benchmarks/putnam_bench/**/*` clean.
End-to-end pass@k baseline deferred to a follow-up run with a Lean sandbox;
pipeline is the same as the miniF2F port (#1111) which was validated against
NeMo-Skills.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Stephen Ge <[email protected]>
The pinned upstream commit hash `COMMIT_HASH = "64cedd86..."` is a 40-char hex literal and trips detect-secrets' "Hex High Entropy String" rule. The three sibling Lean benchmarks don't hit this because their SHA is embedded inside a raw.githubusercontent.com URL string, which the scanner treats as context. PutnamBench uses `git clone` instead of a raw URL, so the SHA appears bare. Adding the standard inline `pragma: allowlist secret` marker. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Stephen Ge <[email protected]>
gwarmstrong
requested changes
Apr 23, 2026
gwarmstrong
left a comment
Contributor
There was a problem hiding this comment.
Please propagate the prompt location from #1111
Reference `benchmarks/prompts/lean4_formal_proof_deepseek_prover_v2.yaml` (merged in via main after miniF2F #1111 landed) and delete the benchmark-local `prompts/default.yaml`. Same content byte-for-byte; no behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> Signed-off-by: Stephen Ge <[email protected]>
gwarmstrong
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Binds the PutnamBench Lean4 formal-proof test split (660 theorems) to the existing
math_formal_leanresources server andsimple_agent(single-turn, matching NeMo-Skills' evaluation protocol). No new server code.Includes
benchmarks/putnam_bench/— benchmark config,prepare.py,prompts/default.yaml, README.trishullab/PutnamBenchat pinned commit64cedd86ef523f3d5f5dc7a21c10e3f69564c7d4.prepare.pyclones the repo into a tempdir, runs the upstreamlean4/scripts/rewrite_solutions.py(which emits 660.leanfiles withsorry-swapping applied), then regex-parses each into themath_formal_leanschema.lean4/formal-proof-deepseek-prover-v2(same as miniF2F and MOBench) — intentionally differs from NeMo-Skills' upstream which useslean4/formal-proof. Per user preference for consistency across the three Lean benchmarks we're porting.{name, split, header, informal_prefix, formal_statement}— byte-identical to Skills'nemo_skills/dataset/putnam-bench/test.jsonl(verified via sorted-diff across all 660 rows). Nogoalfield; server doesn't use it and upstream omits it.prepare.pyasserts exactly 660.leanfiles materialize, to catch drift in either the pinned repo or the upstreamrewrite_solutions.py.Test plan
ng_prepare_benchmarkcompletes the clone+subprocess+parse flow and writes 660-row JSONL byte-identical to NeMo-Skills' upstream output.ng_list_benchmarksshowsputnam_benchbound toputnam_bench_math_formal_lean_simple_agentwithnum_repeats=32.resources_servers/math_formal_leantests unaffected (mocked sandbox).pre-commit run --files benchmarks/putnam_bench/**/*clean.End-to-end pass@k baseline deferred to a follow-up run with a Lean sandbox; pipeline is the same as the miniF2F port (#1111) which was validated against NeMo-Skills.
Notable difference vs. the other Lean benchmarks
Prepare is heavier than miniF2F/MOBench/ProofNet: it requires
giton PATH and network access togithub.com/trishullab/PutnamBench. Runs the upstream's own Python script as a subprocess in a tempdir. End-to-end prepare takes ~10s on a warm network. Pinning solves the drift concern — any change to the upstreamrewrite_solutions.pybehavior will trip the 660-file assertion.🤖 Generated with Claude Code