Skip to content

(8/n) Add ELO/Battles datasets as Task - #92

Open
kargibora wants to merge 17 commits into
refactor/task-yaml-pairwisefrom
refactor/task-yaml-elo
Open

(8/n) Add ELO/Battles datasets as Task#92
kargibora wants to merge 17 commits into
refactor/task-yaml-pairwisefrom
refactor/task-yaml-elo

Conversation

@kargibora

Copy link
Copy Markdown
Collaborator

Summary

This PR packages the ELO/arena benchmarks as declarative tasks, unifying them with the rest of the task system. ELO runs are now selected, validated, and configured the same way as every other benchmark instead of through special-cased code paths.

Previously, ELO was dispatched by matching a task-name prefix, arena datasets were downloaded through their own hardcoded path, and arena choices and dataset revisions lived in Python constants. Adding or changing an arena meant touching several unrelated files.

After this change, each arena is a task definition: elo-lmarena, elo-lmarena-100k, elo-lmarena-140k, and elo-comparia. The task YAML declares the arena, its pinned data sources, and its scoring defaults; the runtime resolves the task once and routes it through the shared benchmark registry.

What changed

  • ELO protocol schema. Task YAML can now declare an elo protocol (arena, judging, Bradley-Terry scoring defaults), validated like the pairwise and MT-Bench protocols.
  • Arena battles as a dataset kind. Battle datasets (model A vs. model B with a human winner) are a different contract than instruction datasets, so they get their own small adapter type. ELO tasks download and load their arena data through the same dataset registry as everything else.
  • One dispatch path. The task-name-prefix check for ELO is gone; the ELO runner is a regular registered benchmark.
  • Pins moved into task YAML. Arena dataset revisions previously kept in dataset_revisions.py now live with the task that uses them.
  • Config validation. Unknown task names are rejected at config time with a pointer to judgearena tasks list; ELO runtime settings (battle sampling, calibration, bootstraps) stay in the run config, while stable arena identity stays in the task YAML.

Define task-owned arena and scoring defaults while keeping the Bradley-Terry implementation behind a registered scorer.
Separate battle-backed datasets from instruction adapters and allow ELO tasks to load their pinned arena sources through the dataset registry.
Route ELO through the shared benchmark dispatcher using resolved task definitions, pinned arena sources, and task-selected scoring defaults.
judge_extra_kwargs already carries max_tokens from judge.model_kwargs(),
so passing it explicitly made every calibrate_temperature run crash with
'got multiple values for keyword argument max_tokens'. Matches the main
judge construction.
@geoalgo
geoalgo force-pushed the refactor/task-yaml-elo branch from 55cbf2b to 4ec6e12 Compare August 5, 2026 13:32
@@ -0,0 +1,28 @@
"""Runtime scoring adapters for ELO rating tasks.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note: Although it seems like this only provides a single function, scoreres are generally needed for implementing specific behaviours defined in official protocls like length-controlled results.


judge_chat_model_cal = make_model(
model=cfg.judge.model,
max_tokens=cfg.judge.max_out_tokens,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@geoalgo this was a bug introduced by some PR in main. I actually don't know when this is introduced (possibly alex's PR). Unfortunutely it was breaking the execution.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching this could you add a test for this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes of course, I will add it

Comment thread judgearena/config.py
"""Run-level settings (seed, output, caching, logging)."""

@model_validator(mode="after")
def _validate(self) -> RunConfig:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is getting more complicated, which basically validates the resolved config file we pass for succesful execution. Might have to find better solution in future (not related to this PR)

logger.info("Step 1: Loading battles from %s", cfg.elo.arena)
df_arena_all = load_arena_dataframe(arena=cfg.elo.arena)
logger.info("Step 1: Loading battles from %s", arena)
df_arena_all = load_battles(task)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not necessarily for now but dont we want to have each task define a load_data run_annotations post_process report which are called by a common main?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is a nice question, as PR's are already large (and we have enough tool to just build this) this can be doable. We can discuss this perhaps? (Currently the pipelines are almost same, just dispatched in their own runners with more task configuration. Next steps would be to decompose pipelines into more repeatable steps)


judge_chat_model_cal = make_model(
model=cfg.judge.model,
max_tokens=cfg.judge.max_out_tokens,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching this could you add a test for this?

task: elo-lmarena-100k
description: Arena-anchored ELO evaluation using LMSYS Chatbot Arena 100k battles.

dataset:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

how do we support subsetting different languages here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same as we did in others, we can put a resolver that takes a look at column of the dataset lang and filters the samples. Should be a few line change (I will add it)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I have added the support. Now we can run xxx-en to select languages as well for each of the arena

Comment thread judgearena/config.py
# Fluency tasks are not packaged yet and run through the legacy path.
if self.elo is not None:
raise ValueError("elo config is only valid for ELO tasks.")
if self.model.name is None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

cant we add a general validate_config in tasks which always called in a common main? (not for this PR but as potential improvement)

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