Upload build_extrinsic.py with huggingface_hub
Browse files- build_extrinsic.py +45 -1
build_extrinsic.py
CHANGED
|
@@ -48,6 +48,7 @@ METRICS = {
|
|
| 48 |
"delta_floor_nats_per_byte": ("likelihood_delta", "nats/utf8_byte"),
|
| 49 |
"lmc_barrier_nats_per_token": ("likelihood_delta", "nats/token"),
|
| 50 |
"harmfulness_score": ("other", "score_0_1"),
|
|
|
|
| 51 |
}
|
| 52 |
|
| 53 |
# chance levels for single-benchmark accuracy rows
|
|
@@ -509,10 +510,53 @@ def build_goldfish(d, ds):
|
|
| 509 |
"goldfish_crosslingual", lbl, "nats_per_token", r.get(k), None, n, ds,
|
| 510 |
note + " | LIKELIHOOD, not accuracy")
|
| 511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 512 |
# =================================================================== driver
|
| 513 |
BUILDERS = {"merge-accuracy": build_merge_accuracy, "compose-audit": build_compose_audit,
|
| 514 |
"crossarch-1b": build_crossarch, "mergebench": build_mergebench,
|
| 515 |
-
"aim": build_aim, "goldfish": build_goldfish}
|
| 516 |
|
| 517 |
def main():
|
| 518 |
ap = argparse.ArgumentParser()
|
|
|
|
| 48 |
"delta_floor_nats_per_byte": ("likelihood_delta", "nats/utf8_byte"),
|
| 49 |
"lmc_barrier_nats_per_token": ("likelihood_delta", "nats/token"),
|
| 50 |
"harmfulness_score": ("other", "score_0_1"),
|
| 51 |
+
"bliss_score": ("other", "BLiSS sub-score"),
|
| 52 |
}
|
| 53 |
|
| 54 |
# chance levels for single-benchmark accuracy rows
|
|
|
|
| 510 |
"goldfish_crosslingual", lbl, "nats_per_token", r.get(k), None, n, ds,
|
| 511 |
note + " | LIKELIHOOD, not accuracy")
|
| 512 |
|
| 513 |
+
# =================================================================== 7. Beetle merges
|
| 514 |
+
def build_beetle(d, ds):
|
| 515 |
+
"""Beetle merge evaluations. The source already ships a long-format table whose
|
| 516 |
+
columns line up almost exactly with this schema, so this is mostly a relabelling."""
|
| 517 |
+
p = d / "beetle_merge_eval_long.csv"
|
| 518 |
+
if not p.exists(): return
|
| 519 |
+
src = rd(p)
|
| 520 |
+
# a released model that some merge names as its ceiling is a jointly-trained comparator;
|
| 521 |
+
# one named as a parent is a parent. Everything else is a plain reference.
|
| 522 |
+
ceilings = {r["ceiling"] for r in src if r.get("ceiling")}
|
| 523 |
+
parents_set = {r[k] for r in src for k in ("parent_a", "parent_b") if r.get(k)}
|
| 524 |
+
for r in src:
|
| 525 |
+
kind = r.get("kind")
|
| 526 |
+
mid_base = r["merge_id"]
|
| 527 |
+
rung, op, arm = r.get("rung", ""), r.get("operator", ""), r.get("arm", "")
|
| 528 |
+
if kind == "merge":
|
| 529 |
+
role = "merged"
|
| 530 |
+
mid = f"{mid_base}#{rung}" if rung else mid_base
|
| 531 |
+
parents = "|".join(x for x in (r.get("parent_a"), r.get("parent_b")) if x)
|
| 532 |
+
note = (f"Beetle merge; arm={arm}; jointly-trained ceiling for this pair is "
|
| 533 |
+
f"{r.get('ceiling') or 'n/a'}; eval langs {r.get('eval_langs') or 'n/a'}")
|
| 534 |
+
else:
|
| 535 |
+
mid, parents = mid_base, ""
|
| 536 |
+
if mid_base in ceilings:
|
| 537 |
+
role, note = "jointly_trained", ("released bilingual model trained directly on the "
|
| 538 |
+
"pair -- the ceiling a Beetle merge is judged against")
|
| 539 |
+
elif mid_base in parents_set:
|
| 540 |
+
role, note = "parent", "Beetle merge parent, evaluated alone"
|
| 541 |
+
else:
|
| 542 |
+
role, note = "reference", "Beetle reference model"
|
| 543 |
+
bench, metric_in = r["benchmark"], r.get("metric")
|
| 544 |
+
ch = f(r.get("chance"))
|
| 545 |
+
if metric_in == "accuracy":
|
| 546 |
+
# BLiSS accuracy is reported on 0-100, everything else on 0-1
|
| 547 |
+
metric = "accuracy_pct" if (ch is not None and ch > 1) else "accuracy"
|
| 548 |
+
else:
|
| 549 |
+
bench, metric = f"{bench}:{metric_in}", "bliss_score"
|
| 550 |
+
note += f" | BLiSS sub-score '{metric_in}', not an accuracy"
|
| 551 |
+
emit(mid, role, r.get("provenance_family") or "beetle", parents, rung, op,
|
| 552 |
+
"beetle_merge_eval", bench, metric, r.get("value"),
|
| 553 |
+
ch if metric.startswith("accuracy") else ch, f(r.get("n")), ds, note)
|
| 554 |
+
|
| 555 |
+
|
| 556 |
# =================================================================== driver
|
| 557 |
BUILDERS = {"merge-accuracy": build_merge_accuracy, "compose-audit": build_compose_audit,
|
| 558 |
"crossarch-1b": build_crossarch, "mergebench": build_mergebench,
|
| 559 |
+
"aim": build_aim, "goldfish": build_goldfish, "beetle": build_beetle}
|
| 560 |
|
| 561 |
def main():
|
| 562 |
ap = argparse.ArgumentParser()
|