Skip to content

feat: add SECQUE and FinanceBench benchmarks, remove duplicate finance_sec_search environment - #2158

Merged
cmunley1 merged 5 commits into
mainfrom
feat/add-secque-financebench-signed
Jul 29, 2026
Merged

cmunley1 merged 5 commits into
mainfrom
feat/add-secque-financebench-signed

Conversation

@ushnish-de

@ushnish-de ushnish-de commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Add SECQUE and FinanceBench benchmarks; consolidate finance_sec_search layout

Adds two open-book financial Q&A benchmark recipes and finishes moving
finance_sec_search onto Gym's canonical two-folder layout
(resources_servers/ + benchmarks/). No resource server Python changes — the
new benchmarks are configs, prompts, and prepare scripts that reuse the
existing equivalence_llm_judge server. The one behavioral change is to the
finance_sec_search judge prompt, described below.

Changes

New: benchmarks/secque/ — README

  • 565-question open-book financial analysis benchmark
    (SECQUE, MIT). The
    authors publish it as an evaluation benchmark, so it ships as a benchmark
    dataset only and is not used for training
  • prepare.py downloads the Hugging Face split and converts it to Gym JSONL
  • config.yaml inherits equivalence_llm_judge_simple_agent and defines an
    isolated judge server with a finance-specific prompt and [[2]]/[[0]]
    verdict labels
  • prompts/judge.txt grades on a 0-2 rubric measuring correctness rather than
    completeness, tolerant of non-essential rounding. Only [[2]] scores 1.0
  • The judge sees the full generation rather than a regex-extracted span

New: benchmarks/financebench/ — README

  • 150-question open-book benchmark
    (FinanceBench,
    CC BY-NC 4.0)
  • Same structure, judge prompt, and 0-2 rubric as SECQUE
  • prepare.py merges the multiple evidence entries per question into one
    context block

Configurable judge model (both new benchmarks)

  • Each config defines a judge_model server, following the existing
    physics_judge and tavily_search convention
  • Defaults to the policy model via
    ${oc.select:judge_model_name,${policy_model_name}}, so single-model setups
    need no extra configuration
  • Setting judge_model_name (plus judge_base_url / judge_api_key if the
    endpoint differs) pins the judge to a fixed model, keeping scores comparable
    across policy models

Grounding requirement in the finance_sec_search judge

  • prompt_templates/finance_sec_search_judge.yaml now makes grounding the
    first grading priority: an answer that restates general financial concepts
    without filing-specific figures, dates, or disclosures scores [[0]] even
    when conceptually correct
  • Without this, a model can score well from parametric knowledge alone and
    never exercise the retrieval tools, which defeats the point of the benchmark
  • Expands accepted filing types beyond 10-K/10-Q to 8-K, DEF 14A, S-1, 20-F,
    and 6-K, since many questions are answerable only from those
  • Adds a worked ungrounded-answer example and annotates the existing examples
    with the filing each is grounded in
  • Aligns the public judge with the prompt that produced the existing
    finance_sec_search evaluation numbers

Removed environments/finance_sec_search/

  • Deleted a duplicate standalone config.yaml, a stale prepare.py, and
    copies of prompts, scripts, and example fixtures that already live under
    resources_servers/finance_sec_search/
  • All five example files were verified byte-identical to the resource server's
    copies; the environment's example_metrics.json already pointed at
    resources_servers/finance_sec_search/data/example.jsonl, so it was never an
    independent fixture set
  • finance_sec_search is an eval and external-SDG environment with no
    Gym-managed train/validation split, so it doesn't need an environments/
    entry

Cleaned up benchmarks/finance_sec_search/ — README

  • Removed hardcoded search_judge_model_base_url /
    search_judge_model_api_key / search_judge_model_name defaults from both
    variant configs; these belong in env.yaml, and the empty-string API key
    default was a footgun

Documentation

  • benchmarks/finance_sec_search/README.md: links to the resource server, adds
    a model configuration section, corrects the parse_html_page description (it
    fetches arbitrary URLs and SEC caching is opt-in), clarifies that Tavily isn't
    needed at prepare time
  • resources_servers/finance_sec_search/README.md:
    documents the opt-in use_cache behavior, which was previously described as
    always-on, replaces stale SECQUE prepare instructions with a pointer to the
    new benchmark, and documents the binary vs scaled reward modes and the new
    grounding requirement in the Verification section
  • All three benchmark READMEs document both the single-command and
    server-plus-client run forms
  • Both new benchmark READMEs note that gold evidence is supplied in the prompt,
    so results measure reasoning over the correct context rather than retrieval
  • benchmarks/{secque,financebench,finance_sec_search}/data/.gitignore: ignore
    generated *_metrics.json alongside *.jsonl

Running

Each README documents both forms. A single command serves and collects:

gym eval prepare --benchmark secque
gym eval run --benchmark secque --split benchmark --model-type openai_model --output results/secque/rollouts.jsonl

Substitute financebench or finance_sec_search/config_no_web_search for
secque. To reuse one server across several runs, gym env start --benchmark <name> in one terminal and gym eval run --no-serve --agent <agent> --input <jsonl> in another; the READMEs give the exact agent and input per benchmark.

Add --limit 1 for a quick end-to-end check. Model configuration goes in
env.yaml at the repo root — see any of the READMEs above.

Test plan

  • pre-commit run --all-files
  • pytest tests/unit_tests -q -m "not sandbox"
  • gym list benchmarks shows secque, financebench, and both
    finance_sec_search variants
  • End-to-end runs against gpt-5-mini: SECQUE 0.789 (565 questions),
    FinanceBench 0.940 (150 questions)
  • End-to-end finance_sec_search run under the grounded judge prompt:
    0.44 (50 questions), down from 0.48 under the previous prompt

@copy-pr-bot

copy-pr-bot Bot commented Jul 27, 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.

@cmunley1

Copy link
Copy Markdown
Contributor

/claude review

kajalj22 added a commit that referenced this pull request Jul 28, 2026
## Summary

- Bumps `/claude review` workflow from FW-CI-templates `v1.7.0` →
`v1.8.4`
- `v1.7.0` had a bug where Claude generated the review but never posted
it to the PR (see #2158 — workflow reported success, no comment
appeared)
- Fixed upstream in FW-CI-templates by [fix: allow Claude review
top-level PR comments
(#523)](NVIDIA-NeMo/FW-CI-templates#523) and
[fix: Claude review comment identity and publish contract
(#525)](NVIDIA-NeMo/FW-CI-templates#525)

## Test plan

- [ ] Trigger `/claude review` on a test PR and confirm a comment is
posted

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

---------

Signed-off-by: Kajal Jain <[email protected]>
Co-authored-by: Claude Sonnet 4.6 (1M context) <[email protected]>
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Jul 28, 2026
@cmunley1

Copy link
Copy Markdown
Contributor

/claude review

@anwithk
anwithk requested review from cwing-nvidia and removed request for cwing-nvidia July 29, 2026 16:42
@cmunley1

Copy link
Copy Markdown
Contributor

i would make sure the license of secque matches the usptream, and consider pin the hf dataset reference @ushnish-de

@kajalj22

Copy link
Copy Markdown
Contributor

/claude review

@claude

claude Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

SHIP WITH CARE — reorganization + two new benchmark recipes, no runtime code paths changed.

This PR (a) moves environments/finance_sec_search/ into resources_servers/finance_sec_search/ + benchmarks/finance_sec_search/ (docs/config only — app.py unchanged), and (b) adds financebench and secque benchmark recipes that reuse the already-tested equivalence_llm_judge server. Reviewed the scoring path, config resolution, and dependency hygiene.

Correctness of the verifier — OK. The new recipes map judge_equal_label: "[[2]]" / judge_not_equal_label: "[[0]]" with use_per_record_regex: false, response_extract_regex: null, check_twice_swap: false. In equivalence_llm_judge/app.py::_generate_judge_evaluation, a [[1]] (partial) verdict matches neither label → returns False → reward 0.0. That matches the documented reward table ([[2]]→1.0, [[1]]/[[0]]→0.0) and mirrors the existing HLE recipe's label pattern. No new scoring code introduced.

Config resolution — OK. The finance benchmark configs drop the search_judge_model_* default block; those are now covered by oc.select fallbacks in resources_servers/finance_sec_search/configs/finance_sec_search.yaml (base_url/api_key/model + tavily_api_key), so the configs still resolve standalone.

Deps — OK. datasets and tqdm are already declared in pyproject.toml.

RISK — silent empty-context on schema drift. Both new prepare.py scripts read the open-book context/evidence with silent .get(..., "") fallbacks. If an upstream HF column is renamed, every row ships an empty context and the whole benchmark silently scores near-0 rather than failing. Inline note on secque/prepare.py; same applies to financebench/_join_evidence. Cheap guard: assert non-empty context (or fail-loud indexing) at prepare time.

NOTE — no tests/test_prepare.py. ~11 benchmarks carry a mocked-load_dataset smoke test that pins the emitted JSONL shape (see benchmarks/hotpotqa_closedbook/tests/test_prepare.py). The two new benchmarks omit it; adding one would catch the field-mapping drift above. Author's call — the verifier itself is already covered by equivalence_llm_judge's tests.

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Jul 29, 2026
@cmunley1
cmunley1 merged commit 33ef603 into main Jul 29, 2026
9 checks passed
@cmunley1
cmunley1 deleted the feat/add-secque-financebench-signed branch July 29, 2026 18:33
OlegSudakov pushed a commit to OlegSudakov/Gym that referenced this pull request Aug 7, 2026
…o#2167)

## Summary

- Bumps `/claude review` workflow from FW-CI-templates `v1.7.0` →
`v1.8.4`
- `v1.7.0` had a bug where Claude generated the review but never posted
it to the PR (see NVIDIA-NeMo#2158 — workflow reported success, no comment
appeared)
- Fixed upstream in FW-CI-templates by [fix: allow Claude review
top-level PR comments
(NVIDIA-NeMo#523)](NVIDIA-NeMo/FW-CI-templates#523) and
[fix: Claude review comment identity and publish contract
(NVIDIA-NeMo#525)](NVIDIA-NeMo/FW-CI-templates#525)

## Test plan

- [ ] Trigger `/claude review` on a test PR and confirm a comment is
posted

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

---------

Signed-off-by: Kajal Jain <[email protected]>
Co-authored-by: Claude Sonnet 4.6 (1M context) <[email protected]>
OlegSudakov pushed a commit to OlegSudakov/Gym that referenced this pull request Aug 7, 2026
…e_sec_search environment (NVIDIA-NeMo#2158)

# Add SECQUE and FinanceBench benchmarks; consolidate
`finance_sec_search` layout

Adds two open-book financial Q&A benchmark recipes and finishes moving
`finance_sec_search` onto Gym's canonical two-folder layout
(`resources_servers/` + `benchmarks/`). No resource server Python
changes — the
new benchmarks are configs, prompts, and prepare scripts that reuse the
existing `equivalence_llm_judge` server. The one behavioral change is to
the
`finance_sec_search` judge prompt, described below.

## Changes

**New: `benchmarks/secque/`** — [README](benchmarks/secque/README.md)

- 565-question open-book financial analysis benchmark
([SECQUE](https://huggingface.co/datasets/nogabenyoash/SecQue), MIT).
The
authors publish it as an evaluation benchmark, so it ships as a
benchmark
  dataset only and is not used for training
- `prepare.py` downloads the Hugging Face split and converts it to Gym
JSONL
- `config.yaml` inherits `equivalence_llm_judge_simple_agent` and
defines an
isolated judge server with a finance-specific prompt and `[[2]]`/`[[0]]`
  verdict labels
- `prompts/judge.txt` grades on a 0-2 rubric measuring correctness
rather than
completeness, tolerant of non-essential rounding. Only `[[2]]` scores
1.0
- The judge sees the full generation rather than a regex-extracted span

**New: `benchmarks/financebench/`** —
[README](benchmarks/financebench/README.md)

- 150-question open-book benchmark

([FinanceBench](https://huggingface.co/datasets/PatronusAI/financebench),
  CC BY-NC 4.0)
- Same structure, judge prompt, and 0-2 rubric as SECQUE
- `prepare.py` merges the multiple evidence entries per question into
one
  context block

**Configurable judge model (both new benchmarks)**

- Each config defines a `judge_model` server, following the existing
  `physics_judge` and `tavily_search` convention
- Defaults to the policy model via
`${oc.select:judge_model_name,${policy_model_name}}`, so single-model
setups
  need no extra configuration
- Setting `judge_model_name` (plus `judge_base_url` / `judge_api_key` if
the
endpoint differs) pins the judge to a fixed model, keeping scores
comparable
  across policy models

**Grounding requirement in the `finance_sec_search` judge**

- `prompt_templates/finance_sec_search_judge.yaml` now makes grounding
the
first grading priority: an answer that restates general financial
concepts
without filing-specific figures, dates, or disclosures scores `[[0]]`
even
  when conceptually correct
- Without this, a model can score well from parametric knowledge alone
and
never exercise the retrieval tools, which defeats the point of the
benchmark
- Expands accepted filing types beyond 10-K/10-Q to 8-K, DEF 14A, S-1,
20-F,
  and 6-K, since many questions are answerable only from those
- Adds a worked ungrounded-answer example and annotates the existing
examples
  with the filing each is grounded in
- Aligns the public judge with the prompt that produced the existing
  `finance_sec_search` evaluation numbers

**Removed `environments/finance_sec_search/`**

- Deleted a duplicate standalone `config.yaml`, a stale `prepare.py`,
and
copies of prompts, scripts, and example fixtures that already live under
  `resources_servers/finance_sec_search/`
- All five example files were verified byte-identical to the resource
server's
  copies; the environment's `example_metrics.json` already pointed at
`resources_servers/finance_sec_search/data/example.jsonl`, so it was
never an
  independent fixture set
- `finance_sec_search` is an eval and external-SDG environment with no
Gym-managed train/validation split, so it doesn't need an
`environments/`
  entry

**Cleaned up `benchmarks/finance_sec_search/`** —
[README](benchmarks/finance_sec_search/README.md)

- Removed hardcoded `search_judge_model_base_url` /
`search_judge_model_api_key` / `search_judge_model_name` defaults from
both
variant configs; these belong in `env.yaml`, and the empty-string API
key
  default was a footgun

**Documentation**

- `benchmarks/finance_sec_search/README.md`: links to the resource
server, adds
a model configuration section, corrects the `parse_html_page`
description (it
fetches arbitrary URLs and SEC caching is opt-in), clarifies that Tavily
isn't
  needed at prepare time
-
[`resources_servers/finance_sec_search/README.md`](resources_servers/finance_sec_search/README.md):
documents the opt-in `use_cache` behavior, which was previously
described as
always-on, replaces stale SECQUE prepare instructions with a pointer to
the
new benchmark, and documents the `binary` vs `scaled` reward modes and
the new
  grounding requirement in the Verification section
- All three benchmark READMEs document both the single-command and
  server-plus-client run forms
- Both new benchmark READMEs note that gold evidence is supplied in the
prompt,
so results measure reasoning over the correct context rather than
retrieval
- `benchmarks/{secque,financebench,finance_sec_search}/data/.gitignore`:
ignore
  generated `*_metrics.json` alongside `*.jsonl`

## Running

Each README documents both forms. A single command serves and collects:

```bash
gym eval prepare --benchmark secque
gym eval run --benchmark secque --split benchmark --model-type openai_model --output results/secque/rollouts.jsonl
```

Substitute `financebench` or `finance_sec_search/config_no_web_search`
for
`secque`. To reuse one server across several runs, `gym env start
--benchmark
<name>` in one terminal and `gym eval run --no-serve --agent <agent>
--input
<jsonl>` in another; the READMEs give the exact agent and input per
benchmark.

Add `--limit 1` for a quick end-to-end check. Model configuration goes
in
`env.yaml` at the repo root — see any of the READMEs above.

## Test plan

- [x] `pre-commit run --all-files`
- [x] `pytest tests/unit_tests -q -m "not sandbox"`
- [x] `gym list benchmarks` shows `secque`, `financebench`, and both
      `finance_sec_search` variants
- [x] End-to-end runs against `gpt-5-mini`: SECQUE 0.789 (565
questions),
      FinanceBench 0.940 (150 questions)
- [x] End-to-end `finance_sec_search` run under the grounded judge
prompt:
      0.44 (50 questions), down from 0.48 under the previous prompt

---------

Signed-off-by: Ushnish De <[email protected]>
Co-authored-by: Christian Munley <[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.

3 participants