Skip to content

feat: add miniF2F benchmark - #1111

Merged
gwarmstrong merged 3 commits into
mainfrom
stepheng/benchmark-minif2f
Apr 23, 2026
Merged

gwarmstrong merged 3 commits into
mainfrom
stepheng/benchmark-minif2f

Conversation

@stephencge

@stephencge stephencge commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Binds the miniF2F Lean4 formal-proof test split (244 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/minif2f/ — benchmark config, prepare.py, prompts/default.yaml, README.
    • Data source: Goedel-LM/Goedel-Prover-V2 minif2f.jsonl pinned to commit 2e9036e118464aa96a8bebaf9f5b9d091aa3585c.
    • Prompt ported from NeMo-Skills lean4/formal-proof-deepseek-prover-v2.yaml byte-for-byte.
    • Per-row schema {name, split, header, informal_prefix, formal_statement, goal} — matches Skills' prepare output exactly (verified: sorted-diff empty across all 244 rows).
    • prepare.py asserts len(test_rows) == 244 to catch upstream drift.

Validated against NeMo Skills

Run on Nemotron-3-Nano-30B-A3B, 4 rollouts per task, T=1.0 max_output_tokens=16384. Both systems used the same NeMo-Skills Lean4 sandbox image (same Dockerfile, same Mathlib v4.12.0).

==========================================================================
miniF2F pass@4 | 244 theorems | 4 rollouts/task | Nemotron-3-Nano-30B
==========================================================================
Metric                     Skills      Gym         Delta
--------------------------------------------------------------------------
pass@1[avg-of-4]           35.86%      34.84%      -1.02pp
pass@4                     54.92%      54.51%      -0.41pp (1 theorem)

Per-theorem agreement (pass@4 success sets):

  • Solved by both: 121 | Gym only: 12 | Skills only: 13 | Jaccard: 0.829

The pass@1 gap sits within Skills' reported ±6.17% CI; per-theorem disagreements are balanced in both directions, consistent with temperature-1.0 sampling noise rather than systematic porting bias.

Test plan

  • ng_prepare_benchmark writes 244-row JSONL byte-identical to NeMo-Skills' test.jsonl (verified via sorted-diff).
  • ng_list_benchmarks shows minif2f bound to minif2f_math_formal_lean_simple_agent, num_repeats=32.
  • Existing resources_servers/math_formal_lean unit tests pass (42/42, mocked sandbox).
  • End-to-end 244×4 rollout against Nemotron-3-Nano-30B-A3B with live Lean4 sandbox; pass@4 reproduces NeMo-Skills within sampling noise.
  • pre-commit run --files benchmarks/minif2f/**/* clean.

🤖 Generated with Claude Code

Binds the miniF2F Lean4 formal-proof test split (244 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/minif2f/` — benchmark config, `prepare.py`, `prompts/default.yaml`,
  README.
  - Data source: Goedel-LM/Goedel-Prover-V2 miniF2F JSONL (244 test theorems),
    pinned to commit `2e9036e118464aa96a8bebaf9f5b9d091aa3585c`.
  - Prompt ported from NeMo-Skills
    `nemo_skills/prompt/config/lean4/formal-proof-deepseek-prover-v2.yaml`
    byte-for-byte.
  - Per-row schema `{name, split, header, informal_prefix, formal_statement, goal}`
    — matches Skills' prepare output exactly (verified: sorted-diff empty across
    all 244 rows).

## Validated against NeMo Skills

Run on `nvidia/nvidia/Nemotron-3-Nano-30B-A3B` (NVIDIA Inference API), 4 rollouts
per task, `T=1.0 max_output_tokens=16384`. Both systems used the same NeMo-Skills
Lean4 sandbox image (same Dockerfile, same Mathlib v4.12.0).

```
==========================================================================
miniF2F pass@4 | 244 theorems | 4 rollouts/task | Nemotron-3-Nano-30B
==========================================================================
Metric                     Skills      Gym         Delta
--------------------------------------------------------------------------
pass@1[avg-of-4]           35.86%      34.84%      -1.02pp
pass@4                     54.92%      54.51%      -0.41pp (1 theorem)
```

Per-theorem agreement (pass@4 success sets):
- Solved by both: 121 | Gym only: 12 | Skills only: 13 | Jaccard: 0.829

Pass@1 gap sits within Skills' reported ±6.17% CI; per-theorem disagreements
are balanced, consistent with temperature-1.0 sampling noise rather than
systematic porting bias.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Stephen Ge <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Apr 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@gwarmstrong gwarmstrong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one minor comment

Extract the Lean4 formal-proof prompt from `benchmarks/minif2f/prompts/default.yaml`
into `benchmarks/prompts/lean4_formal_proof_deepseek_prover_v2.yaml` following
the new shared-prompts convention introduced in #1104 (`gsm8k` / `hendrycks_math`
using `benchmarks/prompts/generic_math.yaml`).

MOBench and PutnamBench use the same prompt byte-for-byte but are on separate
PRs; they'll migrate to this shared file in a follow-up once the pattern is
landed here.

No content changes — file is byte-identical to the deleted
`benchmarks/minif2f/prompts/default.yaml`.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Stephen Ge <[email protected]>
@stephencge
stephencge requested a review from gwarmstrong April 23, 2026 12:55
@gwarmstrong
gwarmstrong merged commit 6706089 into main Apr 23, 2026
6 checks passed
@gwarmstrong
gwarmstrong deleted the stepheng/benchmark-minif2f branch April 23, 2026 17:40
stephencge added a commit that referenced this pull request Apr 23, 2026
Two changes on top of the original port:

1. Prompt switch: drop the zero-shot port of `lean4/formal-proof` in favor of
   the shared `lean4_formal_proof_deepseek_prover_v2` prompt used by miniF2F
   (#1111) and MOBench (#1113). Intentionally differs from NeMo-Skills'
   upstream choice for ProofNet; per user request, all four ported Lean
   benchmarks should use the same prompt for consistency.

2. Move to shared location: reference
   `benchmarks/prompts/lean4_formal_proof_deepseek_prover_v2.yaml` (merged in
   via main) and delete the benchmark-local `prompts/default.yaml`.

Data output and server binding unchanged; only prompt rendering differs at
rollout time.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Signed-off-by: Stephen Ge <[email protected]>
stephencge added a commit that referenced this pull request Apr 23, 2026
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]>
stephencge added a commit that referenced this pull request Apr 23, 2026
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 added a commit that referenced this pull request Apr 23, 2026
## Summary

Binds the ProofNet Lean4 formal-proof test split (186 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/proofnet/` — benchmark config, `prepare.py`,
`prompts/default.yaml`, README.
- Data source: [deepseek-ai/DeepSeek-Prover-V1.5
`proofnet.jsonl`](https://github.com/deepseek-ai/DeepSeek-Prover-V1.5/blob/2c4ba9119eef74d0d611f494261b2c5bae98c69a/datasets/proofnet.jsonl)
pinned to commit `2c4ba9119eef74d0d611f494261b2c5bae98c69a`. 186 test
theorems; 185 `valid` rows dropped.
- Prompt: zero-shot port of
[`lean4/formal-proof.yaml`](https://github.com/NVIDIA-NeMo/Skills/blob/main/nemo_skills/prompt/config/lean4/formal-proof.yaml).
The upstream template has a `{examples}` few-shot placeholder that
renders to an empty string when `examples_type=None` (NeMo-Skills
default), so dropping it here is equivalent for zero-shot evaluation.
- Per-row schema `{name, split, header, informal_prefix,
formal_statement, goal}` — **byte-identical** to Skills'
`nemo_skills/dataset/proofnet/test.jsonl` (verified via sorted-diff
across all 186 rows).
- `prepare.py` asserts `len(test_rows) == 186` to catch upstream drift.

## Test plan

- [x] `ng_prepare_benchmark` writes 186-row JSONL byte-identical to
NeMo-Skills' upstream.
- [x] `ng_list_benchmarks` shows `proofnet` bound to
`proofnet_math_formal_lean_simple_agent` with `num_repeats=32`.
- [x] Existing `resources_servers/math_formal_lean` tests unaffected
(mocked sandbox).
- [x] `pre-commit run --files benchmarks/proofnet/**/*` clean.

End-to-end pass@k baseline deferred to a follow-up run with a Lean
sandbox; this PR is a pure binding — same pipeline as the miniF2F port
(#1111) which was validated against NeMo-Skills.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Stephen Ge <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: George Armstrong <[email protected]>
gwarmstrong added a commit that referenced this pull request Apr 23, 2026
## Summary

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`](https://github.com/trishullab/PutnamBench/tree/64cedd86ef523f3d5f5dc7a21c10e3f69564c7d4)
at pinned commit `64cedd86ef523f3d5f5dc7a21c10e3f69564c7d4`.
`prepare.py` clones the repo into a tempdir, 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` schema.
- Prompt reuses `lean4/formal-proof-deepseek-prover-v2` (same as miniF2F
and MOBench) — **intentionally differs from NeMo-Skills' upstream**
which uses `lean4/formal-proof`. Per user preference for consistency
across the three Lean benchmarks we're porting.
- 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

- [x] `ng_prepare_benchmark` completes the clone+subprocess+parse flow
and writes 660-row JSONL byte-identical to NeMo-Skills' upstream output.
- [x] `ng_list_benchmarks` shows `putnam_bench` bound to
`putnam_bench_math_formal_lean_simple_agent` with `num_repeats=32`.
- [x] Existing `resources_servers/math_formal_lean` tests unaffected
(mocked sandbox).
- [x] `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 `git` on
PATH and network access to `github.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 upstream `rewrite_solutions.py` behavior will trip the
660-file assertion.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Stephen Ge <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: George Armstrong <[email protected]>
gwarmstrong added a commit that referenced this pull request Apr 23, 2026
## Summary

Binds the MOBench Lean4 formal-proof test split (360 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/mobench/` — benchmark config, `prepare.py`,
`prompts/default.yaml`, README.
- Data source: [Goedel-LM/Goedel-Prover-V2
`MOBench.jsonl`](https://github.com/Goedel-LM/Goedel-Prover-V2/blob/2e9036e118464aa96a8bebaf9f5b9d091aa3585c/dataset/MOBench.jsonl)
pinned to commit `2e9036e118464aa96a8bebaf9f5b9d091aa3585c`.
- Prompt reuses `lean4/formal-proof-deepseek-prover-v2` (same as
miniF2F).
- Per-row schema `{name, split, header, informal_prefix,
formal_statement, goal}` — **byte-identical** to Skills'
`nemo_skills/dataset/mobench/test.jsonl` (verified via sorted-diff
across all 360 rows).
  - `prepare.py` asserts `len(rows) == 360` to catch upstream drift.

## Test plan

- [x] `ng_prepare_benchmark` writes 360-row JSONL byte-identical to
NeMo-Skills' upstream.
- [x] `ng_list_benchmarks` shows `mobench` bound to
`mobench_math_formal_lean_simple_agent` with `num_repeats=32`.
- [x] Existing `resources_servers/math_formal_lean` tests unaffected
(mocked sandbox).
- [x] `pre-commit run --files benchmarks/mobench/**/*` clean.

End-to-end pass@k baseline deferred to a follow-up run with a Lean
sandbox; this PR is a pure binding — no model-, agent-, or server-side
changes vs. the miniF2F port (#1111) which already went through full e2e
validation against NeMo-Skills.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Stephen Ge <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: George Armstrong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants