| """Build the shareable HTML page from the same result files the markdown report uses.""" |
| import os, sys, json, glob, base64, math, html, time |
| sys.path.insert(0, "/root/compose-audit") |
| import numpy as np |
| R = "/root/compose-audit/results" |
| F = "/root/compose-audit/figs" |
| HF = "https://huggingface.co/datasets/Mergeability-2/compose-audit" |
|
|
|
|
| def load(pat): |
| out = [] |
| for fp in sorted(glob.glob(f"{R}/{pat}")): |
| for line in open(fp): |
| try: out.append(json.loads(line)) |
| except Exception: pass |
| return out |
|
|
| def _dedup_sp(rows): |
| """Drop duplicate (size, pair) records: a cell may be worked by more than one process.""" |
| seen, out = set(), [] |
| for r in rows: |
| k = (r.get("size"), tuple(r.get("pair", ()))) |
| if k[1] and k in seen: |
| continue |
| seen.add(k); out.append(r) |
| return out |
|
|
|
|
|
|
| def dedup(rows): |
| seen, out = set(), [] |
| for r in rows: |
| k = (r["size"], tuple(r["pair"])) |
| if k in seen: continue |
| seen.add(k); out.append(r) |
| return out |
|
|
|
|
| set1 = dedup(load("set1_*.jsonl") + load("set1x_*.jsonl")) |
| set4 = load("set4_goldfish.jsonl") |
| blimp = _dedup_sp(load("blimp_*.jsonl") + load("blimpB_*.jsonl")) |
| rep = _dedup_sp(load("repair_*.jsonl")) |
| slp = _dedup_sp(load("slerp_*.jsonl")) |
| mb = load("set4_multiblimp.jsonl") |
| bgm = load("bgpt_merge.jsonl") |
| bgc = load("bgpt_ceiling.jsonl") |
| crb = _dedup_sp(load("corpus_*.jsonl")) |
| abl = load("abl_*.jsonl") |
| sizes = sorted({r["size"] for r in set1}, key=lambda s: int(s[:-1])) |
| UNIF = math.log(50304) |
|
|
|
|
| def img(name, alt, cap): |
| p = f"{F}/{name}" |
| if not os.path.exists(p): return "" |
| b = base64.b64encode(open(p, "rb").read()).decode() |
| return (f'<figure class="fig"><img src="data:image/png;base64,{b}" alt="{html.escape(alt)}">' |
| f'<figcaption>{cap}</figcaption></figure>') |
|
|
|
|
| def table(headers, rows, note=None): |
| h = "".join(f"<th>{c}</th>" for c in headers) |
| b = "".join("<tr>" + "".join(f"<td>{c}</td>" for c in r) + "</tr>" for r in rows) |
| n = f'<p class="tnote">{note}</p>' if note else "" |
| return f'<div class="tw"><table><thead><tr>{h}</tr></thead><tbody>{b}</tbody></table></div>{n}' |
|
|
|
|
| |
| S1 = {} |
| for sz in sizes: |
| sub = [r for r in set1 if r["size"] == sz] |
| d0 = np.array([r["rungs"]["M0_naive_avg"]["delta_floor"] for r in sub]) |
| dp = np.array([r["rungs"]["M1_perm_avg"]["delta_floor"] for r in sub]) |
| do = np.array([r["rungs"]["M1_orth_avg"]["delta_floor"] for r in sub]) |
| fl = np.mean([r["floor"] for r in sub]) |
| S1[sz] = dict(n=len(sub), floor=fl, d0=d0.mean(), dp=dp.mean(), do=do.mean(), |
| resc=float(np.mean(1 - dp / d0) * 100), abs_p=fl + dp.mean(), abs_0=fl + d0.mean()) |
|
|
| BL = {} |
| for sz in sorted({b["size"] for b in blimp}, key=lambda s: int(s[:-1])): |
| sub = [b for b in blimp if b["size"] == sz] |
| ce = np.mean([b["ceiling"] for b in sub]) |
| BL[sz] = dict(n=len(sub), ceil=ce, |
| par=float(np.mean([np.mean(list(b["parent_acc"].values())) for b in sub])), |
| m0=float(np.mean([b["rungs"]["M0_naive_avg"]["blimp_acc"] for b in sub])), |
| m1=float(np.mean([b["rungs"]["M1_perm_avg"]["blimp_acc"] for b in sub])), |
| keep=float(np.mean([b["rungs"]["M1_perm_avg"]["blimp_acc"] for b in sub]) - 0.5) / (ce - 0.5) * 100) |
|
|
| conf = [] |
| if os.path.exists(f"{R}/predictor_confirmatory.csv"): |
| rows = [l.rstrip("\n").split(",") for l in open(f"{R}/predictor_confirmatory.csv")] |
| ix = {h: i for i, h in enumerate(rows[0])} |
| for d in rows[1:]: |
| try: |
| conf.append(dict(sub=d[ix["substrate"]], pred=d[ix["predictor"]], |
| auroc=float(d[ix["auroc_heldout_by_seed"]]), |
| p=float(d[ix["perm_p"]] or "nan"), |
| q=float(d[ix["bh_q_within_confirmatory_family"]] or "nan"))) |
| except Exception: pass |
| sig = [c for c in conf if c["q"] == c["q"] and c["q"] < 0.05] |
| tested = [c for c in conf if c["q"] == c["q"]] |
| cs_by = {c["sub"]: c["auroc"] for c in conf if "coordinate share" in c["pred"]} |
|
|
| s4e0 = np.mean([r["rungs"]["M0_naive_avg"]["delta_floor_eng"] for r in set4]) if set4 else float("nan") |
| s4eb = min(np.mean([r["rungs"][k]["delta_floor_eng"] for r in set4]) |
| for k in set4[0]["rungs"] if k.startswith("M1")) if set4 else float("nan") |
| mb_e0 = float(np.mean([r["rungs"]["M0_naive_avg"]["mb_eng"] for r in mb])) if mb else float("nan") |
| mb_par = mb[0]["parents"]["eng_on_mb_eng"] if mb else float("nan") |
| bg_m0 = float(np.mean([r["rungs"]["M0_naive_avg"]["multiblimp_mean"] for r in bgm])) if bgm else float("nan") |
| bg_m1 = max(float(np.mean([r["rungs"][k]["multiblimp_mean"] for r in bgm])) |
| for k in bgm[0]["rungs"] if k.startswith("M1")) if bgm else float("nan") |
| bg_ce = float(np.mean([0.5 * (r["ceiling_mb_eng"] + r["ceiling_mb_x"]) for r in bgm])) if bgm else float("nan") |
|
|
| |
| _d0s = " · ".join("<b>%s</b> +%.1f" % (sz, S1[sz]["d0"]) for sz in sizes) |
| _rescs = " · ".join("<b>%s</b> %.0f%%" % (sz, S1[sz]["resc"]) for sz in sizes) |
| _abss = " · ".join("%.1f" % S1[sz]["abs_p"] for sz in sizes) |
| _flmin = min(S1[s_]["floor"] for s_ in sizes) |
| _flmax = max(S1[s_]["floor"] for s_ in sizes) |
| _cs_str = " · ".join("%s %.2f" % (k.split("-")[1], v) |
| for k, v in sorted(cs_by.items(), key=lambda kv: int(kv[0].split("-")[1][:-1]))) |
| _sig_str = (" (%s, coordinate share, AUROC %.2f, q=%.3f)" % (sig[0]["sub"], sig[0]["auroc"], sig[0]["q"])) if sig else "" |
| FIND = [] |
| FIND.append(("Naive averaging destroys the model — at every size", |
| f"Two PolyPythia checkpoints differ only in the seed: same data, same architecture, same tokenizer. " |
| f"Averaging their weights costs {_d0s} nats/token against parent floors of " |
| f"{_flmin:.1f}–{_flmax:.1f}. " |
| f"At the three smallest sizes the merged model is worse than predicting uniformly over the " |
| f"vocabulary ({UNIF:.1f} nats/token). This is the pure-coordinate case — there is no data, " |
| f"architecture or tokenizer difference left to blame.")) |
| FIND.append(("Unit alignment removes most of the gap and still leaves an unusable model", |
| f"The exactly function-preserving permutation rung (residual basis + free MLP axis + attention " |
| f"heads) removes {_rescs} of that penalty. " |
| f"What is left is {_abss} nats/token absolute. " |
| f"Alignment <em>predicts and reduces</em> the obstruction without <em>enabling</em> the merge.")) |
| FIND.append(("The rescue shrinks monotonically with scale", |
| f"From {S1[sizes[0]]['resc']:.0f}% at {sizes[0]} to {S1[sizes[-1]]['resc']:.0f}% at {sizes[-1]}. " |
| f"The naive penalty shrinks with scale too — but the coordinate-removable <em>share</em> of it " |
| f"shrinks faster. Alignment has the most purchase exactly where the obstruction matters least, " |
| f"and loses it in the direction the field is scaling.")) |
| if BL: |
| k0 = list(BL)[0] |
| FIND.append(("The likelihood rescue buys almost no accuracy", |
| f"Same merges, scored on BLiMP. On pythia-{k0} (n={BL[k0]['n']}) the parents average " |
| f"{BL[k0]['par']:.3f}; the naive merge {BL[k0]['m0']:.3f} and the aligned merge " |
| f"{BL[k0]['m1']:.3f}, against chance 0.500. A ~70% Δfloor rescue is worth about " |
| f"{BL[k0]['m1'] - BL[k0]['m0']:+.3f} accuracy. Across the whole scale ladder the share of the " |
| f"parents' above-chance margin the merge retains stays near a fifth, while the likelihood " |
| f"rescue varies sixfold. Pair by pair, the two rescues are uncorrelated.")) |
| FIND.append(("On the real bilingual models, the wall is the vocabulary", |
| f"Goldfish eng×{{nld,spa,ell,pol}}: the naive merge is +{s4e0:.2f} nats/byte over the English " |
| f"parent's 0.81 floor, and the best aligned rung is +{s4eb:.2f} — no better. The English " |
| f"tokenizer cannot represent 45% of Greek or 11% of Polish, and no permutation or rotation acts " |
| f"on the vocabulary axis. Anchoring on the partner language instead (their tokenizers handle " |
| f"English at <0.1% unknown) removes that wall — and the merge still fails.")) |
| if bgm: |
| FIND.append(("Give alignment a shared vocabulary and it finally does something. It is still not enough.", |
| f"Merging two <em>bilingual</em> B-GPT models of the same language pair — ~94% tokenizer " |
| f"overlap instead of 13–28% — vocabulary transport plus unit alignment lifts MultiBLiMP from " |
| f"{bg_m0:.3f} to {bg_m1:.3f}. The parents sit at {bg_ce:.2f}. Vocabulary is the wall in the " |
| f"composition setting; independent training is the wall behind it.")) |
| if mb: |
| FIND.append(("Likelihood and accuracy dissociate in <em>both</em> directions", |
| f"In the seed setting a large likelihood rescue buys no accuracy. In the bilingual setting the " |
| f"reverse: a merge whose Δfloor says it is destroyed still scores {mb_e0:.2f} on " |
| f"MultiBLiMP-English against a parent at {mb_par:.2f} and chance at 0.50. Neither metric may " |
| f"be reported as a proxy for the other.")) |
| FIND.append(("The predictors do not predict the rescue", |
| f"Held out by seed pair, with a seed-cluster permutation null and Benjamini–Hochberg within the " |
| f"five predictors the brief itself names: <b>{len(sig)} of {len(tested)} cells significant</b>" |
| f"{_sig_str}. That predictor's held-out AUROC across four complete 36-pair grids is {_cs_str}" |
| " — it does not replicate. Nothing survives correction in the wider exploratory family either.")) |
| if abl: |
| wc_a = float(np.mean([r["predictors"]["weight_cosine"] for r in abl])) |
| m160 = [r for r in set1 if r["size"] == "160m"] |
| wc_m = float(np.mean([r["predictors"]["weight_cosine"] for r in m160])) if m160 else float("nan") |
| d_a = float(np.mean([r["rungs"]["M0_naive_avg"]["delta_floor"] for r in abl])) |
| FIND.append(("What remains after alignment is not coordinate", |
| f"A same-basin control — the 160M Pythia data-seed / weight-seed ablations, weight cosine " |
| f"{wc_a:.2f} against {wc_m:.2f} for two PolyPythia seeds — still pays ~{d_a:.1f} nats/token to " |
| f"a naive average, and alignment removes only a few percent of it. Correctly: there is no " |
| f"coordinate mismatch left to remove. Merging is not free inside a basin either.")) |
| if rep or slp: |
| FIND.append(("Not an under-trying artifact", |
| "Naive averaging, permutation alignment, Procrustes, task arithmetic, TIES, SLERP — the " |
| "operator practitioners actually use — and REPAIR-style pre-activation statistics correction " |
| "were all run on the same pairs. REPAIR is the best training-free merge here and takes a " |
| "further bite out of the likelihood gap; BLiMP does not follow it at all. SLERP is worse than " |
| "a plain average. Alignment is what moves the number; the operator on top of it barely matters.")) |
|
|
| find_html = "".join( |
| f'<li class="find"><div class="fnum">{i + 1:02d}</div><div class="fbody">' |
| f'<h3>{t}</h3><p>{b}</p></div></li>' for i, (t, b) in enumerate(FIND)) |
|
|
| |
| t_scale = table( |
| ["substrate", "pairs", "parent floor", "naive Δfloor", "aligned Δfloor", "rescue", "absolute, aligned"], |
| [[f"pythia-{sz}", S1[sz]["n"], f"{S1[sz]['floor']:.2f}", f"+{S1[sz]['d0']:.1f}", |
| f"+{S1[sz]['dp']:.1f}", f"{S1[sz]['resc']:.0f}%", |
| f"{S1[sz]['abs_p']:.1f}" + (" ⚠" if S1[sz]["abs_p"] > UNIF else "")] for sz in sizes], |
| note=f"nats/token on FLORES-200 English devtest. ⚠ marks a merged model worse than predicting " |
| f"uniformly over the 50,304-token vocabulary ({UNIF:.2f} nats/token). The aligned rung is the " |
| f"permutation family, verified function-preserving to float32 noise.") |
|
|
| t_blimp = table(["substrate", "pairs", "parents", "naive merge", "aligned merge", "margin retained"], |
| [[f"pythia-{sz}", BL[sz]["n"], f"{BL[sz]['par']:.3f}", f"{BL[sz]['m0']:.3f}", |
| f"{BL[sz]['m1']:.3f}", f"{BL[sz]['keep']:.0f}%"] for sz in BL], |
| note="BLiMP accuracy, 67 paradigms, chance = 0.500. \"Margin retained\" is the share of " |
| "the parents' above-chance margin the aligned merge keeps.") if BL else "" |
|
|
| t_conf = table(["substrate", "predictor", "AUROC held out by seed", "perm p", "BH q"], |
| [[c["sub"], c["pred"], f"{c['auroc']:.3f}", |
| ("—" if c["p"] != c["p"] else f"{c['p']:.3f}"), |
| ("—" if c["q"] != c["q"] else f"{c['q']:.3f}")] for c in conf], |
| note="Outcome: the share of the naive merge's Δfloor that alignment removes, split at the " |
| "within-substrate median. Null: 2,000 seed-cluster permutations, which preserve the " |
| "dependence between pairs built from 9 shared seeds.") if conf else "" |
|
|
| cov = [] |
| for sz in ["14m", "31m", "70m", "160m", "410m"]: |
| n = len([r for r in set1 if r["size"] == sz]) |
| tot = 36 if sz != "410m" else 15 |
| cov.append([f"SET 1 Δfloor · pythia-{sz}", f"{n}/{tot}", |
| "complete" if n >= tot else ("partial" if n else "not run")]) |
| nb = {} |
| for b in blimp: nb[b["size"]] = nb.get(b["size"], 0) + 1 |
| cov.append(["BLiMP accuracy · SET 1", ", ".join(f"{k} {v}/36" for k, v in sorted(nb.items(), key=lambda kv: int(kv[0][:-1]))), "ran"]) |
| nr = {} |
| for r_ in rep: nr[r_["size"]] = nr.get(r_["size"], 0) + 1 |
| cov.append(["REPAIR rung", ", ".join(f"{k} {v}/36" for k, v in sorted(nr.items(), key=lambda kv: int(kv[0][:-1]))) or "0", "ran" if rep else "not run"]) |
| ns = {} |
| for r_ in slp: ns[r_["size"]] = ns.get(r_["size"], 0) + 1 |
| cov.append(["SLERP rung", ", ".join(f"{k} {v}/36" for k, v in sorted(ns.items(), key=lambda kv: int(kv[0][:-1]))) or "0", "ran" if slp else "not run"]) |
| nc = {} |
| for r_ in crb: nc[r_["size"]] = nc.get(r_["size"], 0) + 1 |
| cov.append(["Corpus robustness (Pile, WikiText)", ", ".join(f"{k} {v}/36" for k, v in sorted(nc.items(), key=lambda kv: int(kv[0][:-1]))) or "0", "ran" if crb else "not run"]) |
| cov.append(["SET 4 Δfloor · Goldfish, both anchoring directions", f"{len(set4)}/4 and {len(load('set4_reverse.jsonl'))}/4", "complete" if len(set4) == 4 else "partial"]) |
| cov.append(["MultiBLiMP accuracy · SET 4", f"{len(mb)}/4", "ran" if mb else "not run"]) |
| cov.append(["Jointly-trained bilingual ceiling (B-GPT)", f"{len(bgc)}/4", "ran" if bgc else "not run"]) |
| cov.append(["Bilingual × bilingual merge (B-GPT en_X × X_en)", f"{len(bgm)}/4", "ran" if bgm else "not run"]) |
| cov.append(["Task arithmetic / TIES on SET 4", "—", "not applicable: no shared ancestor"]) |
| cov.append(["Post-merge finetuning", "—", "out of scope: this audit is training-free"]) |
| cov.append(["Any task beyond minimal-pair grammaticality", "—", "not run"]) |
| t_cov = table(["cell", "n", "status"], cov) |
|
|
| CSS = """ |
| :root{ |
| --ground:#F4F6F5; --surface:#FFFFFF; --ink:#131A19; --muted:#5C6764; --faint:#7C8784; |
| --rule:#DBE2DF; --rule-soft:#E9EEEC; --accent:#0F5F58; --accent-soft:#E3EFEC; |
| --warn:#A4402F; --warn-soft:#F6E9E6; --shadow:0 1px 2px rgba(19,26,25,.05); |
| } |
| @media (prefers-color-scheme:dark){ |
| :root:not([data-theme="light"]){ |
| --ground:#0E1312; --surface:#161C1B; --ink:#E7EDEB; --muted:#98A3A0; --faint:#7C8784; |
| --rule:#28302E; --rule-soft:#1E2523; --accent:#5CC4B7; --accent-soft:#16302C; |
| --warn:#E28572; --warn-soft:#2E1B17; --shadow:none; |
| } |
| } |
| :root[data-theme="dark"]{ |
| --ground:#0E1312; --surface:#161C1B; --ink:#E7EDEB; --muted:#98A3A0; --faint:#7C8784; |
| --rule:#28302E; --rule-soft:#1E2523; --accent:#5CC4B7; --accent-soft:#16302C; |
| --warn:#E28572; --warn-soft:#2E1B17; --shadow:none; |
| } |
| *{box-sizing:border-box} |
| body{ |
| margin:0; background:var(--ground); color:var(--ink); |
| font-family:"IBM Plex Sans","Helvetica Neue",Arial,sans-serif; |
| font-size:16.5px; line-height:1.62; -webkit-font-smoothing:antialiased; |
| } |
| .wrap{max-width:1080px;margin:0 auto;padding:0 28px 96px} |
| .col{max-width:68ch} |
| h1,h2,h3{font-family:Spectral,Georgia,"Times New Roman",serif;font-weight:600;text-wrap:balance;margin:0} |
| h1{font-size:clamp(2.2rem,5.2vw,3.5rem);line-height:1.08;letter-spacing:-.015em} |
| h2{font-size:clamp(1.35rem,2.6vw,1.8rem);line-height:1.2;margin-bottom:.5rem} |
| h3{font-size:1.06rem;line-height:1.32;font-weight:600} |
| p{margin:0 0 1rem} |
| a{color:var(--accent);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--accent) 35%,transparent)} |
| a:hover{border-bottom-color:var(--accent)} |
| a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px} |
| .eyebrow{font-family:"IBM Plex Mono",ui-monospace,Menlo,monospace;font-size:.7rem;letter-spacing:.16em; |
| text-transform:uppercase;color:var(--accent);margin:0 0 1.1rem} |
| header.hero{padding:80px 0 40px;border-bottom:1px solid var(--rule)} |
| .lede{font-size:1.16rem;color:var(--muted);margin-top:1.3rem;max-width:64ch} |
| .meta{display:flex;flex-wrap:wrap;gap:10px 26px;margin-top:2rem; |
| font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:.74rem;color:var(--faint)} |
| .meta b{color:var(--ink);font-weight:500} |
| section{padding:56px 0 8px;border-bottom:1px solid var(--rule-soft)} |
| section:last-of-type{border-bottom:none} |
| .kicker{font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:.7rem;letter-spacing:.14em; |
| text-transform:uppercase;color:var(--faint);margin:0 0 .6rem} |
| .stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(178px,1fr));gap:1px; |
| background:var(--rule);border:1px solid var(--rule);margin:34px 0 8px} |
| .stat{background:var(--surface);padding:20px 22px} |
| .stat .v{font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:1.72rem;font-weight:500; |
| letter-spacing:-.02em;font-variant-numeric:tabular-nums;line-height:1.1} |
| .stat .v.bad{color:var(--warn)} |
| .stat .k{font-size:.78rem;color:var(--muted);margin-top:.5rem;line-height:1.4} |
| ol.finds{list-style:none;margin:34px 0 0;padding:0;display:flex;flex-direction:column;gap:0} |
| li.find{display:grid;grid-template-columns:56px 1fr;gap:22px;padding:26px 0;border-top:1px solid var(--rule-soft)} |
| li.find:first-child{border-top:1px solid var(--rule)} |
| .fnum{font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:.86rem;color:var(--accent); |
| padding-top:.22rem;font-variant-numeric:tabular-nums} |
| .fbody{max-width:66ch} |
| .fbody h3{margin-bottom:.45rem} |
| .fbody p{margin:0;color:var(--muted)} |
| .fbody b{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums} |
| .tw{overflow-x:auto;border:1px solid var(--rule);background:var(--surface);margin:26px 0 0} |
| table{border-collapse:collapse;width:100%;font-size:.85rem; |
| font-family:"IBM Plex Mono",ui-monospace,monospace;font-variant-numeric:tabular-nums} |
| th,td{padding:9px 15px;text-align:right;white-space:nowrap;border-bottom:1px solid var(--rule-soft)} |
| th:first-child,td:first-child{text-align:left} |
| thead th{font-size:.68rem;letter-spacing:.07em;text-transform:uppercase;color:var(--faint); |
| font-weight:500;border-bottom:1px solid var(--rule);background:var(--surface);position:sticky;top:0} |
| tbody tr:last-child td{border-bottom:none} |
| .tnote{font-size:.78rem;color:var(--faint);margin:.65rem 0 0;max-width:74ch;line-height:1.55} |
| .fig{margin:30px 0 0;padding:0} |
| .fig img{display:block;width:100%;height:auto;border:1px solid var(--rule);background:#fff} |
| .fig figcaption{font-size:.78rem;color:var(--faint);margin-top:.6rem;max-width:74ch;line-height:1.55} |
| .callout{border-left:2px solid var(--warn);background:var(--warn-soft);padding:18px 22px;margin:28px 0 0;max-width:70ch} |
| .callout p{margin:0;font-size:.94rem} |
| .callout strong{color:var(--warn)} |
| .note{border-left:2px solid var(--accent);background:var(--accent-soft);padding:18px 22px;margin:28px 0 0;max-width:70ch} |
| .note p{margin:0;font-size:.94rem} |
| details{border-top:1px solid var(--rule-soft);padding:14px 0} |
| summary{cursor:pointer;font-family:"IBM Plex Mono",ui-monospace,monospace;font-size:.8rem; |
| color:var(--accent);list-style:none} |
| summary::-webkit-details-marker{display:none} |
| summary::before{content:"+ ";color:var(--faint)} |
| details[open] summary::before{content:"– "} |
| details .col{padding-top:12px} |
| footer{padding:52px 0 0;color:var(--faint);font-size:.82rem;border-top:1px solid var(--rule)} |
| @media (max-width:640px){ |
| .wrap{padding:0 18px 64px} |
| li.find{grid-template-columns:38px 1fr;gap:14px} |
| header.hero{padding:52px 0 30px} |
| } |
| @media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}} |
| """ |
|
|
| BODY = f""" |
| <link rel="preconnect" href="https://fonts.googleapis.com"> |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&family=Spectral:wght@500;600&display=swap"> |
| <style>{CSS}</style> |
| <div class="wrap"> |
| <header class="hero"> |
| <p class="eyebrow">Evaluation audit · training-free · real models</p> |
| <h1>Merging without composition</h1> |
| <p class="lede">Does representational alignment predict and enable model merging? Tested on the |
| models the claim is about: {sum(S1[s]['n'] for s in sizes)} PolyPythia seed pairs across five |
| scales, and the Goldfish and B-GPT bilingual models — with a likelihood metric and an accuracy |
| metric measured on the same merges.</p> |
| <div class="meta"> |
| <span><b>{sum(S1[s]['n'] for s in sizes)}</b> seed pairs</span> |
| <span><b>{len(sizes)}</b> model scales</span> |
| <span><b>7</b> merge operators</span> |
| <span><b>2</b> metric families</span> |
| <span>generated {time.strftime('%Y-%m-%d %H:%M UTC')}</span> |
| </div> |
| </header> |
| |
| <section> |
| <p class="kicker">The short version</p> |
| <h2>Alignment reduces the obstruction. It does not enable the merge.</h2> |
| <div class="col"> |
| <p>The manuscript's thesis — that representational alignment predicts and enables merging — was |
| demonstrated on one substrate while the bilingual composition models it is <em>about</em> only |
| ever got a naive merge that failed. This puts both on the same real models, and adds the accuracy |
| measurement the thesis needs and did not have.</p> |
| </div> |
| <div class="stats"> |
| <div class="stat"><div class="v bad">+{S1[sizes[0]]['d0']:.0f}</div><div class="k">nats/token that a naive average costs at pythia-{sizes[0]}, against a parent floor of {S1[sizes[0]]['floor']:.1f}</div></div> |
| <div class="stat"><div class="v">{S1[sizes[0]]['resc']:.0f}% → {S1[sizes[-1]]['resc']:.0f}%</div><div class="k">of that penalty alignment removes, from {sizes[0]} to {sizes[-1]}</div></div> |
| <div class="stat"><div class="v">{BL[list(BL)[0]]['m0']:.2f} → {BL[list(BL)[0]]['m1']:.2f}</div><div class="k">BLiMP accuracy, naive → aligned merge, against parents at {BL[list(BL)[0]]['par']:.2f} and chance at 0.50</div></div> |
| <div class="stat"><div class="v">{len(sig)} / {len(tested)}</div><div class="k">pre-merge predictor cells that survive correction, held out by seed pair</div></div> |
| </div> |
| <div class="callout"><p><strong>Δfloor is a likelihood metric, not benchmark accuracy — and here |
| they come apart.</strong> We measured both on the same merges. In the seed setting a ~70% likelihood |
| rescue buys about 0.03 accuracy; in the bilingual setting a merge the likelihood metric calls |
| destroyed still scores {mb_e0:.2f} on MultiBLiMP-English. Neither number may stand in for the other.</p></div> |
| </section> |
| |
| <section> |
| <p class="kicker">Findings</p> |
| <h2>Nine things the grid shows</h2> |
| <ol class="finds">{find_html}</ol> |
| </section> |
| |
| <section> |
| <p class="kicker">Set 1 · PolyPythia seed pairs</p> |
| <h2>The pure-coordinate case</h2> |
| <div class="col"><p><code>EleutherAI/pythia-<size>-seed{{1..9}}</code>: same data, same |
| architecture, same tokenizer, different initialisation. C(9,2) = 36 pairs per size. Whatever stops |
| the merge here is a coordinate problem and nothing else — which is what makes the residual so |
| awkward for the thesis.</p></div> |
| {t_scale} |
| {img("set1_scale_trend.png", "Naive merge penalty and alignment rescue against model size", |
| "Both the obstruction and alignment's purchase on it shrink with scale — and the purchase shrinks faster.")} |
| {img("set1_dfloor_by_rung.png", "Delta-floor by merge rung for each model size", |
| "Every rung on every size. Task arithmetic and TIES are shown to document that the shared-base operators degenerate when the base is not shared: two PolyPythia seeds have no common ancestor.")} |
| <div class="note"><p>One rung is <b>not</b> an alignment. Applying the Procrustes residual map to a |
| PolyPythia parent costs that parent +27 nats/token on its own — LayerNorm subtracts the mean over |
| the residual axis and applies a learned elementwise gain, and neither commutes with a general |
| rotation. The permutation family is exact to float32 noise on both architectures. Every coordinate |
| claim here rests on the permutation rung.</p></div> |
| </section> |
| |
| <section> |
| <p class="kicker">The accuracy test</p> |
| <h2>Does the likelihood rescue transfer?</h2> |
| <div class="col"><p>PolyPythia parents are English language models, so BLiMP applies directly to |
| their merges. Same pairs, same alignment, same merges as the table above.</p></div> |
| {t_blimp} |
| {img("set1_blimp_dissociation.png", "Likelihood rescue against accuracy rescue, and parents against merges", |
| "Left: each point is a seed pair. The size of the likelihood rescue carries no information about the size of the accuracy rescue. Right: parents against merges at each scale.")} |
| </section> |
| |
| <section> |
| <p class="kicker">Set 4 · Goldfish and B-GPT</p> |
| <h2>The composition models themselves</h2> |
| <div class="col"><p>Merging a monolingual English model with a monolingual partner-language model |
| is the operation the manuscript is about. It fails, and unit alignment does not rescue it — but the |
| reason is not the one the coordinate story predicts. The two parents' tokenizers share 13–28% of |
| their surface forms, and the merged model lives in one parent's token-id space. The alignment group |
| acts on the residual basis; the obstruction is on the vocabulary axis.</p></div> |
| {img("set4_joint_ceiling.png", "Bilingual ceiling versus parents versus merges, likelihood and accuracy", |
| "What success would look like. A jointly-trained bilingual model of the same budget is good at both languages at once; no merge of two monolinguals comes close, on either metric. All arms re-scored at a matched 128-token context.")} |
| {img("set4_dfloor.png", "Delta-floor by rung for each Goldfish language pair", |
| "Nine rungs, four language pairs, and no rung meaningfully better than the naive average.")} |
| {img("set4_likelihood_vs_accuracy.png", "MultiBLiMP accuracy against delta-floor for every Goldfish rung", |
| "The other direction of the dissociation. Every merge sits about a nat per byte above the English parent — by the likelihood metric, destroyed — and every one of them still scores far above chance on MultiBLiMP-English.")} |
| </section> |
| |
| <section> |
| <p class="kicker">P0-2 · Predictor validation</p> |
| <h2>Do the pre-merge predictors predict the rescue?</h2> |
| <div class="col"><p>The confirmatory family is the five predictors the brief itself names, on the |
| one outcome it asks about, fixed before looking at the results. Held out by seed: each fold drops |
| every pair touching one seed and fits on the pairs touching neither, so the predictor's direction |
| never sees the held-out data.</p></div> |
| {t_conf} |
| {img("set1_roc.png", "ROC curves for the coordinate share predictor at each model size", |
| "The same predictor, the same outcome, four complete 36-pair grids of the same model family differing only in size.")} |
| {img("set1_rescue_vs_predictor.png", "Realised rescue against coordinate share and against CKA", |
| "The clusters separate by scale, not by predictor value. Within a substrate the relationship is weak; between substrates it is confounded with size.")} |
| </section> |
| |
| <section> |
| <p class="kicker">Coverage</p> |
| <h2>What ran, and what did not</h2> |
| {t_cov} |
| <details><summary>Threats to validity</summary><div class="col"> |
| <p><b>BLiMP and MultiBLiMP are minimal-pair grammaticality benchmarks.</b> They are a real accuracy |
| measurement and not a general one. A merge that scores 0.68 on MultiBLiMP-English is not thereby a |
| usable model — agreement minimal pairs are forgiving of a degraded model, because the two candidates |
| differ in one inflected token.</p> |
| <p><b>PolyPythia's <code>-seed{{n}}</code> repos reseed initialisation and data order together.</b> |
| The 160M ablations separate them only at n=3 pairs each, and both of those families turn out to sit |
| in the same basin.</p> |
| <p><b>The alignment search is the permutation group plus its orthogonal relaxation</b>, plus |
| embedding-row Procrustes for the cross-tokenizer case. It is not the full symmetry group. A better |
| aligner could raise the aligned rungs; nothing here bounds how far. What is bounded is the claim |
| that the aligners already in the codebase do the job on these substrates.</p> |
| <p><b>The largest scales carry the fewest pairs.</b> The complete 36-pair grids are 14m, 31m, 70m |
| and 160m; 410m is partial and directional.</p> |
| <p><b>Everything is training-free by construction.</b> No claim is made about what post-merge |
| finetuning would recover — that is the obvious next experiment and out of scope for this audit.</p> |
| </div></details> |
| </section> |
| |
| <footer> |
| <p>Full report, per-pair records, predictor tables and every script: |
| <a href="{HF}">{HF.replace('https://', '')}</a>. |
| Merge operators, aligners, quotient metrics and the linear-mode-connectivity barrier are imported |
| unmodified from <code>mergeschool.core</code>; the GPT-2 Conv1D symmetry factors and the evaluation |
| harness are new here.</p> |
| </footer> |
| </div> |
| """ |
|
|
| open("/root/compose-audit/compose_audit.html", "w", encoding="utf-8").write( |
| "<title>Merging Without Composition</title>\n" + BODY) |
| print("artifact html written:", len(BODY), "chars") |
|
|