File size: 2,453 Bytes
ba0faed | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #!/usr/bin/env python3
# Exp6 method>data: at the SAME data budget, three tiers per domain —
# naive (from D0, before our fix; LOSES gen) < generalist < CorDA-MoS warm-from-gen (OURS; beats gen).
# Shows how much our method (warm-from-gen + CorDA fusion) advances over the naive same-data attempt.
import matplotlib; matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
# ascending by our method -> tallest (math) at the right. OURS = saturated (8-epoch) per-domain peaks.
DOMS = ["cw", "fqa", "general", "code", "math"]
NAIVE = [2.591, 2.775, 3.000, 3.211, 4.632] # naive same-data CorDA-MoS from D0 (per-domain peak) — loses gen
GEN = [2.647, 2.814, 3.049, 3.204, 4.698] # generalist, single best-avg checkpoint
MOS = [2.721, 2.907, 3.108, 3.338, 4.922] # CorDA-MoS warm-from-gen, SATURATED per-domain peak — OURS
x = np.arange(len(DOMS)); w = 0.27
fig, ax = plt.subplots(figsize=(10.5, 5.4))
b0 = ax.bar(x - w, NAIVE, w, label="naive same-data (from D0, before warm-start) — loses", color="#c0392b")
b1 = ax.bar(x, GEN, w, label="generalist (same 250k data)", color="#9aa7b8")
b2 = ax.bar(x + w, MOS, w, label="CorDA-MoS warm-from-gen (OURS, same data) — wins", color="#1b5e20")
for bars in (b0, b1, b2):
for b in bars:
ax.text(b.get_x()+b.get_width()/2, b.get_height()+0.02, f"{b.get_height():.2f}", ha="center", va="bottom", fontsize=7.5)
# show the advance our method makes over the naive version
for j in range(len(DOMS)):
gain = MOS[j] - NAIVE[j]
ax.text(x[j]+w, MOS[j]+0.20, f"+{gain:.2f} vs naive", ha="center", fontsize=7, color="#1b5e20", fontweight="bold")
ax.set_xticks(x); ax.set_xticklabels(DOMS)
ax.set_ylabel("held-out accept length (AL)")
ax.set_ylim(2.0, 5.4)
ax.set_title("Method > Data (same 250k): naive same-data split (from D0) LOSES to gen;\n"
"our warm-from-gen CorDA-MoS BEATS gen on all 5 domains — the gap shows the method's contribution", fontsize=10.5)
ax.legend(loc="upper left", fontsize=8.5); ax.grid(axis="y", ls=":", alpha=0.4)
ax.text(0.58, 0.74, f"avg AL: naive {np.mean(NAIVE):.3f} < gen {np.mean(GEN):.3f} < ours {np.mean(MOS):.3f}",
transform=ax.transAxes, fontsize=9.5, va="top", ha="center",
bbox=dict(boxstyle="round,pad=0.3", fc="#e8f3e8", ec="#1b5e20"))
fig.tight_layout()
fig.savefig("fig_exp5_method_vs_data.png", dpi=140, bbox_inches="tight")
print("OK wrote /tmp/fig_exp5_method_vs_data.png")
|