Upload code/analyze.py with huggingface_hub
Browse files- code/analyze.py +24 -6
code/analyze.py
CHANGED
|
@@ -191,15 +191,20 @@ if rows:
|
|
| 191 |
lo, hi = min(v) - 0.04, max(v) + 0.04
|
| 192 |
ax.plot([lo, hi], [lo, hi], "--", color="#111", lw=1, label="y = x (alignment changes nothing)")
|
| 193 |
for r in P:
|
| 194 |
-
ax.scatter(r[f"{m}__naive"], r[f"{m}__aligned"], s=
|
| 195 |
c=CC if r["is_control"] else CR, marker="D" if r["is_control"] else "o",
|
| 196 |
-
zorder=3, edgecolors="white", linewidths=
|
| 197 |
-
ax.annotate(lab(r["fork"]), (r[f"{m}__naive"], r[f"{m}__aligned"]),
|
| 198 |
-
textcoords="offset points", xytext=(6, 4), fontsize=6.5)
|
| 199 |
ax.scatter(r[f"{m}__naive"], r[f"{m}__fork"], s=26, facecolors="none",
|
| 200 |
edgecolors="#94a3b8", zorder=2)
|
| 201 |
rf = r.get(f"{m}__ref_instruct")
|
| 202 |
-
if rf is not None: ax.axhline(rf, color="#94a3b8", lw=0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
ax.set_xlim(lo, hi); ax.set_ylim(lo, hi)
|
| 204 |
ax.set_xlabel("naive chat vector"); ax.set_ylabel("aligned chat vector")
|
| 205 |
ax.set_title(ttl.split("\n")[0], fontsize=9, loc="left")
|
|
@@ -381,7 +386,20 @@ def _canon(rs):
|
|
| 381 |
real = _canon([r for r in rows if not r["is_control"]])
|
| 382 |
ctlr = _canon([r for r in rows if r["is_control"]])
|
| 383 |
if real:
|
| 384 |
-
A(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
A("")
|
| 386 |
idr = [r for r in real if r["g_is_effectively_identity"]]
|
| 387 |
A(f"- On **{len(idr)} of {len(real)}** real community CPT forks the fitted alignment map is the "
|
|
|
|
| 191 |
lo, hi = min(v) - 0.04, max(v) + 0.04
|
| 192 |
ax.plot([lo, hi], [lo, hi], "--", color="#111", lw=1, label="y = x (alignment changes nothing)")
|
| 193 |
for r in P:
|
| 194 |
+
ax.scatter(r[f"{m}__naive"], r[f"{m}__aligned"], s=62,
|
| 195 |
c=CC if r["is_control"] else CR, marker="D" if r["is_control"] else "o",
|
| 196 |
+
zorder=3, edgecolors="white", linewidths=1.1)
|
|
|
|
|
|
|
| 197 |
ax.scatter(r[f"{m}__naive"], r[f"{m}__fork"], s=26, facecolors="none",
|
| 198 |
edgecolors="#94a3b8", zorder=2)
|
| 199 |
rf = r.get(f"{m}__ref_instruct")
|
| 200 |
+
if rf is not None: ax.axhline(rf, color="#94a3b8", lw=0.8, ls=":")
|
| 201 |
+
_group_annotate(ax, [(r[f"{m}__naive"], r[f"{m}__aligned"],
|
| 202 |
+
lab(r["fork"]) + (f" λ{r['lam']}" if r["lam"] != 1.0 else ""))
|
| 203 |
+
for r in P], dx=7, dy=5)
|
| 204 |
+
ax.scatter([], [], c=CR, s=55, label="real community fork")
|
| 205 |
+
ax.scatter([], [], c=CC, marker="D", s=55, label="permutation control")
|
| 206 |
+
ax.scatter([], [], facecolors="none", edgecolors="#94a3b8", s=30, label="fork alone")
|
| 207 |
+
ax.plot([], [], ls=":", color="#94a3b8", label="official Instruct")
|
| 208 |
ax.set_xlim(lo, hi); ax.set_ylim(lo, hi)
|
| 209 |
ax.set_xlabel("naive chat vector"); ax.set_ylabel("aligned chat vector")
|
| 210 |
ax.set_title(ttl.split("\n")[0], fontsize=9, loc="left")
|
|
|
|
| 386 |
real = _canon([r for r in rows if not r["is_control"]])
|
| 387 |
ctlr = _canon([r for r in rows if r["is_control"]])
|
| 388 |
if real:
|
| 389 |
+
A("> **Alignment did not improve downstream accuracy on a single real model — because on every")
|
| 390 |
+
A("> real model there was nothing to align.** All three community continued-pretrained forks of")
|
| 391 |
+
A("> `Llama-3.1-8B` are still exactly in the base model's coordinate frame, so the aligned and")
|
| 392 |
+
A("> naive chat vectors are bit-identical models and the accuracy difference is 0.000 on every")
|
| 393 |
+
A("> benchmark. The diagnostic said so **before** any merge was built, and a 44-second screen")
|
| 394 |
+
A("> reproduces that call 37x cheaper than fitting the map. When the frame really has drifted —")
|
| 395 |
+
A("> a real fork acted on by a random element of its own symmetry group — the naive chat vector")
|
| 396 |
+
A("> collapses (IFEval 0.175 -> 0.110, *below* the fork it started from) and alignment restores")
|
| 397 |
+
A("> it to 0.355 against an unpermuted reference of 0.375. **The mechanism is real and does reach")
|
| 398 |
+
A("> accuracy; the ecosystem condition that would make it pay off did not occur in the three")
|
| 399 |
+
A("> released forks we found.**")
|
| 400 |
+
A("")
|
| 401 |
+
A(f"Population: **{len(real)} real community forks** (3 groups, 3 target languages), "
|
| 402 |
+
f"**{len(ctlr)} ground-truth controls**, plus one cross-group direct-merge pair.")
|
| 403 |
A("")
|
| 404 |
idr = [r for r in real if r["g_is_effectively_identity"]]
|
| 405 |
A(f"- On **{len(idr)} of {len(real)}** real community CPT forks the fitted alignment map is the "
|