Aleksander22's picture
Slayer1B-1.09-Instruct-26.11: weights, card, notes, training code, manifests and results (history squashed; training data not published)
6071ec5
Raw History Blame Contribute Delete
1.93 kB
"""Summarise results/format/<label>/<task>.jsonl (hipoteza_formatu.py output): accuracy per task and model, the share of
the most frequent predicted letter (letter bias), and a paired comparison vs the base (per-question, McNemar-style
z on the difference of correct indicators). acc = argmax of the raw log-likelihood (lm-eval `acc`)."""
import json
import math
import sys
from collections import Counter
from pathlib import Path
root = Path(sys.argv[1])
labels = sys.argv[2].split(",")
base = labels[0]
tasks = ["belebele_mc", "belebele_cloze", "arc_c_mc", "arc_c_mc_przes", "arc_c_cloze", "mmlu_mc", "mmlu_cloze"]
def load(label, task):
p = root / label / f"{task}.jsonl"
if not p.exists():
return {}
out = {}
for line in open(p, encoding="utf-8"):
w = json.loads(line)
ll = w.get("ll") or w.get("logliki") or w.get("loglik")
if ll is None:
continue
pred = max(range(len(ll)), key=lambda i: ll[i])
out[w["id"]] = (pred == w.get("gold", w.get("poprawna")), pred)
return out
print(f"{'task':16s} " + " ".join(f"{l:>22s}" for l in labels))
for t in tasks:
rows = {l: load(l, t) for l in labels}
cells = []
for l in labels:
r = rows[l]
if not r:
cells.append(f"{'-':>22s}")
continue
acc = 100 * sum(c for c, _ in r.values()) / len(r)
top = 100 * Counter(p for _, p in r.values()).most_common(1)[0][1] / len(r)
s = f"{acc:5.1f} (top {top:4.1f}%)"
if l != base and rows[base]:
ids = sorted(set(r) & set(rows[base]))
d = [int(r[i][0]) - int(rows[base][i][0]) for i in ids]
m = sum(d) / len(d)
sd = math.sqrt(sum((x - m) ** 2 for x in d) / max(1, len(d) - 1)) / math.sqrt(len(d))
s += f" {100 * m:+5.1f} z={m / sd if sd else 0:+.1f}"
cells.append(f"{s:>22s}")
print(f"{t:16s} " + " ".join(cells))