(4/n) Package Arena-Hard Task Variants - #82
Conversation
6913ab5 to
8b608ac
Compare
| from judgearena.tasks.schema import CategoryDefaultsBaseline, TaskDefaultBaseline | ||
|
|
||
| LEGACY_PAIRWISE_BASELINES: dict[str, str | Mapping[str, str]] = { | ||
| **ARENA_HARD_BASELINES, |
There was a problem hiding this comment.
Note: we have this because we are adding tasks one-by-one and don't want to break the old pipeline.
| from judgearena.datasets.registry import resolve_dataset_adapter | ||
|
|
||
| df_outputs = load_task_model_outputs(resolved_task, local_path_tables) | ||
| adapter = resolve_dataset_adapter(resolved_task.spec.dataset.adapter) |
There was a problem hiding this comment.
adapter handles how to load the dataset now. So we dont need a specific functions as before, different way of loading should be only implemented to adapter classes so executing the pipeline flow is seperated from how to load it in a graceful way.
| load_model_outputs: TaskDataFunction | ||
|
|
||
|
|
||
| def dataset_adapters() -> tuple[DatasetAdapter, ...]: |
There was a problem hiding this comment.
As we want to add new tasks, if it requires a special download function or load function, we will add it here. This will normalize all the instances in the pipeline.
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class DatasetAdapter: |
There was a problem hiding this comment.
Similarly we can write this as a dict object. However writing like this also shows what we expect as data type for its keys. Compared to previous TaskRegistry, I think we should let it be like this.
8b608ac to
cfaa79b
Compare
Define v0.1 and v2.0 from a shared YAML base and move dataset, baseline, prompt, and revision ownership out of legacy maps.
cfaa79b to
e5f2bc9
Compare
Summary
This PR migrates Arena-Hard v0.1 and v2.0 to the declarative task registry introduced in the previous PR.
Arena-Hard configuration was previously distributed across dataset utilities, revision maps, baseline constants, prompt
handling, and pairwise runner conditions. The two versions also share most of their configuration but require different
dataset variants and baseline policies.
The task definitions now provide a single source of truth for both versions.
Task structure
The definitions are organized as:
_base.yaml contains the configuration shared by both versions:
Each public task YAML extends the base and defines only its version-specific differences.
Version-specific behavior
Arena-Hard v0.1 declares:
Arena-Hard v2.0 declares:
Both versions allow users to provide a runtime baseline override when they want to compare against another model.
Dataset adapter
This PR adds an arena_hard dataset adapter responsible for:
Task specification
-> download pinned Arena-Hard JSONL files
-> normalize questions into instruction rows
-> normalize official answers into model-output rows
-> return canonical data to the pairwise runner
The adapter handles the different answer formats found in the upstream files while keeping those details out of the
generic pairwise runner.
A dataset-adapter registry now connects the adapter ID declared in YAML to its Python implementation.
Removed duplication
Arena-Hard-specific information is removed from legacy baseline, revision, prompt, and dataset dispatch mappings. The
task definition now owns this information, while the Python adapter only owns loading and normalization behavior.
This demonstrates how related benchmark versions can share a base definition while keeping their differences explicit
and easy to review.
Notes