Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,11 @@ implausible row count) and hands the rows to the shared single-metric engine in
identities in `backend/services/carbon_board_identities.py`; other names are
auto-matched or handed to the release radar, and a board's `excluded` names
(partial runs, non-standard setups) are skipped. The engine keeps one row per
catalog model and harness (the best upstream setting), adopts hand-imported
catalog model and harness (the best upstream setting); the three Artificial
Analysis boards set `effort_in_model_name` and keep one row per upstream name
with its effort setting, as their reviewed names do. A managed row whose model
name changes is renamed in place, found by the entry label in its methodology.
The engine adopts hand-imported
rows for the same model, and never creates papers. A managed row whose upstream
entry leaves the leaderboard is deleted (`<job>_deleted`); a row carrying
reviewer notes is kept and reported as `missing_upstream`. The three Artificial
Expand Down
3 changes: 3 additions & 0 deletions backend/services/carbon_board_syncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ def _fetching(
url=CRITPT_URL,
task_slug="scientific-reasoning",
dataset_slug="critpt",
effort_in_model_name=True,
retire_missing=False,
metric="Accuracy",
identities=IDENTITIES["critpt"],
Expand All @@ -760,6 +761,7 @@ def _fetching(
url=CRITPT_V2_URL,
task_slug="scientific-reasoning",
dataset_slug="critpt-v2",
effort_in_model_name=True,
retire_missing=False,
metric="Accuracy",
identities=IDENTITIES["critpt-v2"],
Expand All @@ -775,6 +777,7 @@ def _fetching(
url=TERMINAL_BENCH_SCIENCE_URL,
task_slug="scientific-reasoning",
dataset_slug="terminal-bench-science-0-1",
effort_in_model_name=True,
retire_missing=False,
metric="Accuracy",
identities=IDENTITIES["terminal-bench-science-0-1"],
Expand Down
15 changes: 12 additions & 3 deletions backend/services/leaderboard_model_matching_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ class MatchedModel:
)


def catalog_name(name: str) -> str:
"""The catalog model a leaderboard name denotes, without its effort setting.

A matched model gets this name whether the full leaderboard name or only
its base resolved, so an alias recorded later never renames it.
"""
return _EFFORT_SUFFIX.sub("", name)


_FAMILY_LABS = (
(re.compile(r"(?:claude|opus|sonnet|haiku)\b", re.I), "Anthropic"),
(re.compile(r"(?:gpt|chatgpt|codex)\b|o\d+(?:\b|-)", re.I), "OpenAI"),
Expand Down Expand Up @@ -161,19 +170,19 @@ def match(self, models: list[LeaderboardModel]) -> dict[str, MatchedModel]:
self._alias_matches([name for name in names if name not in releases])
)
matched = {
name: MatchedModel(release.paper_id, name, release.is_open)
name: MatchedModel(release.paper_id, catalog_name(name), release.is_open)
for name, release in releases.items()
}
for name in names:
if name not in matched and (paper_id := announcing_paper_id(self.db, name)):
hf_model_url = self._weights_url(paper_id, name)
matched[name] = MatchedModel(
paper_id, name, hf_model_url is not None, hf_model_url
paper_id, catalog_name(name), hf_model_url is not None, hf_model_url
)
bases = {
name: base
for name in names
if name not in matched and (base := _EFFORT_SUFFIX.sub("", name)) != name
if name not in matched and (base := catalog_name(name)) != name
}
if bases:
base_matches = self.match(
Expand Down
23 changes: 21 additions & 2 deletions backend/services/live_leaderboard_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ class LiveLeaderboard:
Several boards may share a benchmark when each publishes its own metric
(Physics-IQ Verified's I2V and V2V tracks): a board only reads and writes
rows that carry its metric.

An auto-matched entry is named after its catalog model, so the settings of
one model share a row; ``effort_in_model_name`` keeps the upstream name
with its effort setting instead, for boards whose reviewed names do.
"""

source: str
Expand All @@ -81,6 +85,7 @@ class LiveLeaderboard:
model_name_suffix: str = ""
excluded: dict[str, str] = field(default_factory=dict)
adopt_unmanaged: bool = True
effort_in_model_name: bool = False
retire_missing: bool = True

@property
Expand Down Expand Up @@ -113,6 +118,7 @@ class LiveSyncStats:
created: int = 0
changed: int = 0
adopted: int = 0
renamed: int = 0
auto_matched: list[str] = field(default_factory=list)
unreviewed: list[str] = field(default_factory=list)
missing_papers: list[str] = field(default_factory=list)
Expand Down Expand Up @@ -283,10 +289,13 @@ def sync(
if (match := matched.get(entry.name)) is None:
stats.unreviewed.append(entry.label)
continue
model_name = (
entry.name if board.effort_in_model_name else match.model_name
)
selected.append(
(
match.paper_id,
match.model_name + board.model_name_suffix,
model_name + board.model_name_suffix,
match.is_open,
match.hf_model_url,
entry,
Expand Down Expand Up @@ -323,11 +332,14 @@ def sync(
]
rows_by_identity: dict[tuple[int, str, str | None], Evaluation] = {}
unmanaged_by_model: dict[tuple[int, str], Evaluation] = {}
managed_by_label: dict[tuple[int, str], Evaluation] = {}
for row in rows:
rows_by_identity.setdefault(
(row.paper_id, row.model_name, row.harness), row
)
if not (row.methodology or "").startswith(board.managed_prefix):
if label := board.managed_label.match(row.methodology or ""):
managed_by_label.setdefault((row.paper_id, label["label"]), row)
elif not (row.methodology or "").startswith(board.managed_prefix):
unmanaged_by_model.setdefault((row.paper_id, row.model_name), row)
linked_paper_ids = {
paper_id
Expand All @@ -345,6 +357,13 @@ def sync(
entry,
) in best.items():
row = rows_by_identity.get(key)
if row is None:
renamed = managed_by_label.get((paper_id, entry.label))
if renamed is not None and id(renamed) not in published:
row = renamed
row.model_name = model_name
rows_by_identity[key] = row
stats.renamed += 1
if row is None and board.adopt_unmanaged:
fallback = unmanaged_by_model.get((paper_id, model_name))
if fallback is not None and id(fallback) not in published:
Expand Down
66 changes: 66 additions & 0 deletions backend/tests/evaluation/test_carbon_board_syncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,72 @@ def test_sync_reports_unknown_models_to_the_release_radar():
assert session.query(ModelReleaseSignal).count() == 1


def _add_release(session: Session) -> ModelRelease:
release = ModelRelease(
id=7,
paper_id=2,
canonical_name="Mythos 7",
publisher="Anthropic",
aliases=[],
is_open=False,
)
session.add(release)
session.commit()
return release


@pytest.mark.parametrize(
("effort_in_model_name", "model_name"),
[(False, "Mythos 7"), (True, "Mythos 7 (max)")],
)
def test_auto_matched_effort_labels_keep_one_row_when_the_label_gains_an_alias(
effort_in_model_name, model_name
):
session = _session()
release = _add_release(session)
board = _board(effort_in_model_name=effort_in_model_name)
entries = [
_entry("Opus 5.5 (xhigh)", 3.61),
_entry("Sol 5.6 (xhigh)", 4.7),
_entry("Mythos 7 (max)", 6.0),
]
first = LiveLeaderboardSyncService(session, board).sync(entries)
assert first.auto_matched == ["Mythos 7 (max) (mini-SWE-agent)"]
row = _rows(session)[f"{model_name} (mini-SWE-agent)"]

session.add(
ModelProviderAlias(
model_release_id=release.id, provider="test-board", alias="Mythos 7 (max)"
)
)
session.commit()
again = LiveLeaderboardSyncService(session, board).sync(entries)
assert (again.created, again.renamed) == (0, 0)
assert _rows(session)[f"{model_name} (mini-SWE-agent)"] is row
assert session.query(Evaluation).filter_by(paper_id=2).count() == 2


def test_sync_renames_the_managed_row_of_an_upstream_label():
session = _session()
_add_release(session)
entries = [
_entry("Opus 5.5 (xhigh)", 3.61),
_entry("Sol 5.6 (xhigh)", 4.7),
_entry("Mythos 7 (max)", 6.0),
]
LiveLeaderboardSyncService(session, _board()).sync(entries)
row = _rows(session)["Mythos 7 (mini-SWE-agent)"]
row.model_name = "Mythos 7 (max)"
row.methodology += " Reviewer note."
session.commit()

stats = LiveLeaderboardSyncService(session, _board()).sync(entries)
assert (stats.created, stats.renamed) == (0, 1)
assert row.model_name == "Mythos 7"
assert row.methodology.endswith("Test protocol. Reviewer note.")
assert stats.missing_upstream == []


def test_bare_model_names_reach_the_radar_with_their_family_lab():
session = _session()
LiveLeaderboardSyncService(session, _board()).sync(
Expand Down
Loading