Scoring
Overview
Each benchmark defines its own scorer via the @scorer decorator. The scoring/ package provides reusable scorer implementations:
Scoring Primitives
These functions are the building blocks for @scorer functions. All are importable from the top-level package.
exact_match(sample)
Normalized string comparison: lowercase, strip whitespace and punctuation, collapse articles.
multichoice_regex(sample)
Extracts a letter (A-D by default) from “Answer: X” patterns.
answer_line(sample)
Extracts the text after “Answer:” and compares with math normalization.
numeric_match(sample)
Extracts the last number in the response.
fuzzy_match(sample)
Normalized substring containment. Supports multiple correct answers via metadata["correct_answers"].
code_sandbox(sample)
Runs code in a Docker container with network isolation, memory limits, and timeouts. Extracts code from markdown fences, concatenates with prompt code and test harness, and checks the exit code.
Requires Docker daemon access.
needs_judge(sample)
Signals that this sample requires LLM-as-judge scoring. Returns {"correct": False, "needs_judge": True} so the eval loop’s judge post-processor handles it.
Used by SimpleQA and HealthBench.
LLM-as-Judge Pipeline
Benchmarks that use needs_judge() are scored in a post-processing step by scoring/judge.py. The judge pipeline:
- Collects all samples flagged with
needs_judge: True - Constructs judge prompts from the response and expected answer
- Calls the judge model (configured via
--judge-url/JudgeScoringConfig) - Parses the judge verdict and updates rewards
Configure the judge model:
JSON Schema Scoring
scoring/json_schema.py validates structured model outputs against a JSON schema:
Metrics
pass@k
Standard Codex-style pass@k. Given n attempts per problem with c correct:
Bootstrap Confidence Intervals
95% CI via bootstrap resampling (10,000 iterations):
Category Breakdown
When problems include category metadata, per-category accuracy is computed automatically:
Failure Analysis
The ArtifactCollector categorizes failures automatically:
Output in failure_analysis.json: