Buckets:
| #!/usr/bin/env python3 | |
| """Build poster_embed.html for TarGATE ICML logbook (matplotlib + data-URI).""" | |
| from __future__ import annotations | |
| import base64 | |
| import io | |
| import json | |
| from pathlib import Path | |
| import matplotlib | |
| matplotlib.use("Agg") | |
| import matplotlib.pyplot as plt | |
| from matplotlib.patches import FancyBboxPatch, Rectangle | |
| ROOT = Path(__file__).resolve().parents[1] | |
| OUT_DIR = ROOT / "outputs" | |
| OUT_DIR.mkdir(parents=True, exist_ok=True) | |
| def load_results() -> dict: | |
| p = OUT_DIR / "results.json" | |
| if p.exists(): | |
| return json.loads(p.read_text()) | |
| return {} | |
| def card(ax, x, y, w, h, title, body, accent="#38bdf8"): | |
| ax.add_patch( | |
| FancyBboxPatch( | |
| (x, y), | |
| w, | |
| h, | |
| boxstyle="round,pad=0.02,rounding_size=0.08", | |
| facecolor="#1e293b", | |
| edgecolor="#475569", | |
| linewidth=1, | |
| ) | |
| ) | |
| ax.text(x + 0.15, y + h - 0.28, title, fontsize=11, color=accent, fontweight="bold", family="sans-serif") | |
| ax.text(x + 0.15, y + h / 2 - 0.15, body, fontsize=9.5, color="#e2e8f0", va="center", family="sans-serif") | |
| def render_poster_png(results: dict) -> bytes: | |
| fig = plt.figure(figsize=(16, 9), dpi=140) | |
| ax = fig.add_axes([0, 0, 1, 1]) | |
| ax.set_xlim(0, 16) | |
| ax.set_ylim(0, 9) | |
| ax.axis("off") | |
| ax.add_patch(Rectangle((0, 0), 16, 9, facecolor="#0f172a", edgecolor="none")) | |
| ax.add_patch(Rectangle((0, 7.7), 16, 1.3, facecolor="#1e3a5f", edgecolor="none")) | |
| ax.add_patch(Rectangle((0, 7.65), 16, 0.08, facecolor="#38bdf8", edgecolor="none")) | |
| ax.text(0.4, 8.55, "REPRODUCTION · ICML 2026", fontsize=11, color="#7dd3fc", fontweight="bold", va="center") | |
| ax.text(0.4, 8.05, "TarGATE: Target-Aware Data Selection via Token-Attenuation Gates", fontsize=16, color="white", fontweight="bold", va="center") | |
| ax.text(15.6, 8.3, "OpenReview: xaqSrbGpPN\nICML poster #60688", fontsize=9, color="#cbd5e1", ha="right", va="center") | |
| sel = results.get("selection", {}) | |
| tg = sel.get("TarGATE", {}) | |
| rnd = sel.get("Random", {}) | |
| nll = sel.get("NegNLL", {}) | |
| sft = results.get("sft", {}) | |
| xfer = results.get("transfer_sft", {}) | |
| eff = results.get("efficiency", {}) | |
| warm = results.get("warmup", {}) | |
| def pct(m, k): | |
| v = m.get(k) | |
| return f"{100*v:.1f}%" if isinstance(v, (int, float)) else "—" | |
| outcome = ( | |
| f"Outcome: TarGATE precision {pct(tg,'precision')} vs Random {pct(rnd,'precision')} / NegNLL {pct(nll,'precision')} · " | |
| f"gates-only warmup · T4 Job" | |
| ) | |
| ax.add_patch( | |
| FancyBboxPatch((0.35, 6.85), 15.3, 0.65, boxstyle="round,pad=0.02,rounding_size=0.08", facecolor="#052e16", edgecolor="#4ade80", linewidth=1.5) | |
| ) | |
| ax.text(8.0, 7.18, outcome, fontsize=10, color="#bbf7d0", ha="center", va="center", fontweight="bold") | |
| card( | |
| ax, | |
| 0.35, | |
| 4.7, | |
| 7.5, | |
| 1.95, | |
| "Claim 1 — Noisy selection (top-10%)", | |
| f"Precision (target in selected):\n" | |
| f" TarGATE {pct(tg,'precision')} Random {pct(rnd,'precision')} NegNLL {pct(nll,'precision')}\n" | |
| f"Recovery: TarGATE {pct(tg,'recovery')} · n_selected={tg.get('n_selected','—')}\n" | |
| f"Pool: 800 GSM8K + 800 noise · ref=80 · Qwen2.5-0.5B", | |
| "#38bdf8", | |
| ) | |
| card( | |
| ax, | |
| 8.15, | |
| 4.7, | |
| 7.5, | |
| 1.95, | |
| "Claim 1 — Short SFT (optional signal)", | |
| f"Selector SFT eval acc (numeric match):\n" | |
| f" TarGATE {sft.get('TarGATE',{}).get('eval_acc','—')} " | |
| f"Random {sft.get('Random',{}).get('eval_acc','—')} " | |
| f"NegNLL {sft.get('NegNLL',{}).get('eval_acc','—')}\n" | |
| f"Transfer 1.5B: TarGATE {xfer.get('TarGATE',{}).get('eval_acc','—')} " | |
| f"Random {xfer.get('Random',{}).get('eval_acc','—')}\n" | |
| f"(Scaled SFT steps — mechanism verified primarily via precision)", | |
| "#a78bfa", | |
| ) | |
| card( | |
| ax, | |
| 0.35, | |
| 2.5, | |
| 7.5, | |
| 1.95, | |
| "Claim 2 — Efficiency", | |
| f"Trainable gate params: {eff.get('trainable_gate_params', warm.get('n_trainable_gate_params','—'))}\n" | |
| f"Warmup wall: {warm.get('warmup_wall_sec', eff.get('warmup_time_sec','—'))}s\n" | |
| f"Score wall: TarGATE {eff.get('score_time_targate_sec','—')}s vs NLL {eff.get('score_time_nll_sec','—')}s\n" | |
| f"Base frozen; only linear IRR gates updated", | |
| "#fbbf24", | |
| ) | |
| card( | |
| ax, | |
| 8.15, | |
| 2.5, | |
| 7.5, | |
| 1.95, | |
| "Claim 2 — Cross-model transfer", | |
| "Small selector (0.5B) curates data for larger (1.5B) SFT.\n" | |
| f"Selected precision (from small model): {pct(tg,'precision')}\n" | |
| "Data transfer (not weight transfer) matches paper claim that\n" | |
| "a smaller selector can curate fine-tuning data for larger LMs.", | |
| "#34d399", | |
| ) | |
| ax.add_patch(FancyBboxPatch((0.35, 0.35), 15.3, 1.9, boxstyle="round,pad=0.02,rounding_size=0.08", facecolor="#1e293b", edgecolor="#475569", linewidth=1)) | |
| ax.text(0.55, 1.9, "Method · Scope · Links", fontsize=11, color="#38bdf8", fontweight="bold") | |
| ax.text( | |
| 0.55, | |
| 1.1, | |
| "TarGATE = token-level IRR gates on FFN residual · joint quality loss (↑IRR on reference, ↓IRR on noise)\n" | |
| "Scale: toy/medium vs paper (Tulu-200k / full LoRA). Job: HF t4-small · Bucket: junwatu/targate-repro-artifacts\n" | |
| "Code: anonymous.4open.science/r/TarGATE-4008 · OpenReview: openreview.net/forum?id=xaqSrbGpPN\n" | |
| "Models: Qwen/Qwen2.5-0.5B-Instruct · Qwen/Qwen2.5-1.5B-Instruct · Data: openai/gsm8k", | |
| fontsize=9, | |
| color="#e2e8f0", | |
| va="center", | |
| family="sans-serif", | |
| ) | |
| buf = io.BytesIO() | |
| fig.savefig(buf, format="png", facecolor=fig.get_facecolor(), bbox_inches="tight", pad_inches=0.05) | |
| plt.close(fig) | |
| return buf.getvalue() | |
| def write_embed(png_bytes: bytes, path: Path) -> None: | |
| b64 = base64.b64encode(png_bytes).decode("ascii") | |
| # Hotspots map to claim page slugs | |
| html = f"""<!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"/> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> | |
| <title>Reproduction poster — TarGATE</title> | |
| <style> | |
| .poster-wrap {{ position: relative; width: 100%; max-width: 1400px; margin: 0 auto; }} | |
| .poster-wrap img {{ width: 100%; height: auto; display: block; border-radius: 12px; }} | |
| .poster-hotspot {{ | |
| position: absolute; border: 0; padding: 0; margin: 0; | |
| background: transparent; cursor: pointer; z-index: 2; | |
| }} | |
| .poster-hotspot:hover, .poster-hotspot:focus {{ | |
| outline: 2px solid #38bdf8; | |
| background: rgba(56, 189, 248, 0.08) !important; | |
| }} | |
| .poster-hotspot-pill {{ | |
| position: absolute; top: 8px; right: 8px; | |
| background: rgba(15, 23, 42, 0.85); color: #e2e8f0; | |
| font: 600 11px/1.2 system-ui, sans-serif; | |
| padding: 4px 8px; border-radius: 999px; opacity: 0.85; | |
| pointer-events: none; | |
| }} | |
| .poster-hotspot:hover .poster-hotspot-pill, | |
| .poster-hotspot:focus .poster-hotspot-pill {{ opacity: 1; }} | |
| </style> | |
| </head> | |
| <body> | |
| <div class="poster-wrap"> | |
| <img src="data:image/png;base64,{b64}" alt="TarGATE reproduction poster"/> | |
| <button class="poster-hotspot" type="button" | |
| data-logbook-target="claim-1-targate-outperforms-related-baselines-in-both-noisy-and-real-world-data-selection-scenarios" | |
| style="left:2%;top:28%;width:47%;height:28%;" | |
| aria-label="Open Claim 1"> | |
| <span class="poster-hotspot-pill">Open details ↗</span> | |
| </button> | |
| <button class="poster-hotspot" type="button" | |
| data-logbook-target="claim-1-targate-outperforms-related-baselines-in-both-noisy-and-real-world-data-selection-scenarios" | |
| style="left:51%;top:28%;width:47%;height:28%;" | |
| aria-label="Open Claim 1 SFT"> | |
| <span class="poster-hotspot-pill">Open details ↗</span> | |
| </button> | |
| <button class="poster-hotspot" type="button" | |
| data-logbook-target="claim-2-the-method-exhibits-superior-computational-efficiency-and-strong-cross-model-transferability-for-curating-fine-tuning-data" | |
| style="left:2%;top:52%;width:47%;height:24%;" | |
| aria-label="Open Claim 2 efficiency"> | |
| <span class="poster-hotspot-pill">Open details ↗</span> | |
| </button> | |
| <button class="poster-hotspot" type="button" | |
| data-logbook-target="claim-2-the-method-exhibits-superior-computational-efficiency-and-strong-cross-model-transferability-for-curating-fine-tuning-data" | |
| style="left:51%;top:52%;width:47%;height:24%;" | |
| aria-label="Open Claim 2 transfer"> | |
| <span class="poster-hotspot-pill">Open details ↗</span> | |
| </button> | |
| </div> | |
| <script> | |
| document.querySelectorAll('[data-logbook-target]').forEach(function(btn) {{ | |
| btn.addEventListener('click', function() {{ | |
| var slug = btn.getAttribute('data-logbook-target'); | |
| if (window.parent && window.parent !== window) {{ | |
| window.parent.postMessage({{ type: 'logbook-navigate', slug: slug }}, '*'); | |
| }} | |
| location.hash = '#/' + slug; | |
| }}); | |
| }}); | |
| </script> | |
| </body> | |
| </html> | |
| """ | |
| path.write_text(html) | |
| print(f"Wrote {path} ({path.stat().st_size} bytes)") | |
| def main(): | |
| results = load_results() | |
| png = render_poster_png(results) | |
| (OUT_DIR / "poster.png").write_bytes(png) | |
| write_embed(png, OUT_DIR / "poster_embed.html") | |
| # also to logbook dir if present | |
| lb = ROOT.parent / ".trackio" / "logbook" | |
| if lb.exists(): | |
| write_embed(png, lb / "poster_embed.html") | |
| if __name__ == "__main__": | |
| main() | |
Xet Storage Details
- Size:
- 9.52 kB
- Xet hash:
- 76dcf0291ce908c2c5a57d2815149b6be34c1742e3ae729bdeb873607edf5d74
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.