Skip to content

support ifbench for LLMs. - #2542

Open
lkk12014402 wants to merge 2 commits into
mainfrom
ifbench
Open

support ifbench for LLMs.#2542
lkk12014402 wants to merge 2 commits into
mainfrom
ifbench

Conversation

@lkk12014402

Copy link
Copy Markdown
Contributor

Description

IFBench evaluation

lkk12014402 and others added 2 commits August 5, 2026 04:45
Signed-off-by: lkk12014402 <kaokao.lv@intel.com>

Copilot AI 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.

Pull request overview

Adds a self-contained IFBench reproduction workflow under benchmark/ifbench/ to evaluate instruction-following for LLMs against an OpenAI-compatible endpoint, using Nemotron 3 Ultra-aligned generation/scoring settings.

Changes:

  • Introduces a one-shot driver script (run_ifbench.sh) that clones upstream IFBench, overlays local config + evaluation logic, sets up a venv, and runs evaluation.
  • Adds an end-to-end generator+scorer (evaluate_model.py) that supports consensus repeats and writes per-repeat + aggregated results.
  • Provides Nemotron-aligned defaults via configs/config.py (pydantic-settings) and configs/env.template, plus usage documentation in README.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
benchmark/ifbench/run_ifbench.sh Driver to clone IFBench, set up environment, apply config overlays, and run the evaluation.
benchmark/ifbench/README.md Documentation for running IFBench reproduction and explaining parameters/results.
benchmark/ifbench/evaluate_model.py End-to-end generation + scoring against an OpenAI-compatible /chat/completions endpoint.
benchmark/ifbench/configs/env.template Template .env with Nemotron-aligned defaults for endpoint + generation settings.
benchmark/ifbench/configs/config.py Pydantic-settings loader for .env configuration used by evaluate_model.py.

Comment on lines +143 to +146
prompt_to_response = {inp.prompt: responses[inp.key] for inp in inputs}
strict = [evaluation_lib.test_instruction_following_strict(i, prompt_to_response) for i in inputs]
loose = [evaluation_lib.test_instruction_following_loose(i, prompt_to_response) for i in inputs]
return strict, loose
Comment on lines +86 to +90
except Exception as e:
last_exc = e
if attempt < max_retries:
time.sleep(min(2**attempt, 30))
continue
Comment on lines +198 to +217
parser.add_argument("--no-thinking", dest="enable_thinking", action="store_false", help="Disable thinking mode")
parser.add_argument("--seed", type=int, default=settings.seed, help="Base seed; repeat i uses seed+i")
parser.add_argument("--workers", type=int, default=settings.workers)
parser.add_argument(
"--request-timeout",
type=float,
default=settings.request_timeout,
help="Per-request timeout in seconds (Nemotron: 3600)",
)
parser.add_argument(
"--max-retries",
type=int,
default=settings.max_retries,
help="Retries per request on timeout/error (Nemotron: 10)",
)
parser.add_argument(
"--num-repeats", type=int, default=settings.num_repeats, help="Consensus repeats (Nemotron uses 8)"
)
parser.add_argument("--limit", type=int, default=None, help="Only evaluate the first N prompts (smoke test)")
parser.add_argument("--save-responses", action="store_true", help="Also dump generated responses per repeat")
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