"""Build a self-contained reproduction poster (poster.html -> poster.png data-URI) and poster_embed.html with accessible hotspots linking to the logbook claim pages. Figures are rendered with matplotlib from the result JSONs (no external assets).""" import os, sys, json, base64, io import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt BASE = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) OUT = os.path.join(BASE, "outputs", "poster") os.makedirs(OUT, exist_ok=True) GEN = "Qwen/Qwen2.5-32B-Instruct-AWQ" ACCENT = "#2D5F8B"; DEEP = "#1F4566"; EMPH = "#C9A24A"; GREEN = "#2ca02c"; RED = "#d62728" SLUGS = { "c1": "claim-1-mindflow-formulates-research-ideation-as-graph-structured-flow-composed-of-modular-thinking-operators-and-probabilistic-mind-supernet", "c2": "claim-2-mindflow-shows-superiority-as-explicit-controllable-and-optimizable-research-idea-innovator-across-diverse-topics", "c3": "claim-3-tournament-based-relative-ranking-enables-the-controller-to-progressively-favor-higher-quality-thinking-flows", } def load(claim): p = os.path.join(BASE, "outputs", claim, f"{claim}_results.json") return json.load(open(p)) if os.path.exists(p) else None def datauri(fig): b = io.BytesIO(); fig.savefig(b, format="png", dpi=150, bbox_inches="tight", facecolor="white") plt.close(fig); b.seek(0) return "data:image/png;base64," + base64.b64encode(b.read()).decode() def fig_heatmap(c1): ops = c1["ctrl_ops"]; heat = c1["heatmap"]; doms = list(heat.keys()) Z = np.array([[heat[d][o] for o in ops] for d in doms]) fig, ax = plt.subplots(figsize=(5.2, 3.4)) im = ax.imshow(Z, cmap="viridis", vmin=0, vmax=1, aspect="auto") ax.set_xticks(range(len(ops))); ax.set_xticklabels(ops, rotation=40, ha="right", fontsize=8) ax.set_yticks(range(len(doms))); ax.set_yticklabels(doms, fontsize=8) fig.colorbar(im, ax=ax, fraction=0.035).ax.tick_params(labelsize=7) ax.set_title("Mind-supernet P(include operator) by domain", fontsize=10, color=DEEP, weight="bold") return datauri(fig) def fig_claim2(c2): methods = [k for k in c2 if not k.startswith("_")] order = sorted(methods, key=lambda m: c2[m]["agg"]["Overall"]) names = order; ov = [c2[m]["agg"]["Overall"] for m in order] cols = [EMPH if m == "MindFlow" else ACCENT for m in order] fig, ax = plt.subplots(figsize=(5.2, 3.4)) ax.barh(names, ov, color=cols) for i, v in enumerate(ov): ax.text(v + 0.005, i, f"{v:.3f}", va="center", fontsize=8) ax.set_xlabel("Overall win-rate MOScore vs expert", fontsize=9) ax.set_title("Claim 2 — MindFlow best aggregate", fontsize=10, color=DEEP, weight="bold") ax.tick_params(labelsize=8); ax.set_xlim(0, max(ov) * 1.18) return datauri(fig) def fig_claim3(c3): fig, ax = plt.subplots(figsize=(5.2, 3.4)) for mode, col in [("tournament", GREEN), ("pointwise", RED)]: if mode in c3: h = c3[mode]["hist"] ax.plot(h["eval_iter"], h["eval_overall"], "-o", color=col, label=mode, lw=2, ms=4) ax.set_xlabel("Optimization iteration", fontsize=9); ax.set_ylabel("Held-out MOScore", fontsize=9) ax.set_title("Claim 3 — tournament vs pointwise", fontsize=10, color=DEEP, weight="bold") ax.legend(fontsize=8); ax.tick_params(labelsize=8); ax.grid(alpha=0.3) return datauri(fig) def fig_reward(c3): fig, ax = plt.subplots(figsize=(5.2, 2.7)) for mode, col in [("tournament", GREEN), ("pointwise", RED)]: if mode in c3: rs = c3[mode]["hist"]["reward_std"] ax.plot(range(1, len(rs) + 1), rs, "-", color=col, label=f"{mode} (μ={np.mean(rs):.2f})", lw=2) ax.set_xlabel("Iteration", fontsize=9); ax.set_ylabel("Reward std", fontsize=9) ax.set_title("Reward discrimination (↑ = less judgment collapse)", fontsize=9, color=DEEP, weight="bold") ax.legend(fontsize=8); ax.tick_params(labelsize=8); ax.grid(alpha=0.3) return datauri(fig) def build(): c1, c2, c3 = load("claim1"), load("claim2"), load("claim3") mf = c2["MindFlow"]["agg"]["Overall"] methods = [k for k in c2 if not k.startswith("_")] bb_name = max((m for m in methods if m != "MindFlow"), key=lambda m: c2[m]["agg"]["Overall"]) bb = c2[bb_name]["agg"]["Overall"] t_ov = c3["tournament"]["hist"]["eval_overall"]; p_ov = c3["pointwise"]["hist"]["eval_overall"] t_rstd = float(np.mean(c3["tournament"]["hist"]["reward_std"])) p_rstd = float(np.mean(c3["pointwise"]["hist"]["reward_std"])) imgs = {"heat": fig_heatmap(c1), "c2": fig_claim2(c2), "c3": fig_claim3(c3), "rew": fig_reward(c3)} html = f"""
MindFlow: Mind Supernet Powered Thinking Flows for Research Idea Innovation
Independent reproduction of ICML 2026 #1894 (OpenReview GgINST3Qgc) · open backbone {GEN} via vLLM · all three core claims reproduce at mechanism scale
The idea
Research ideation is open-ended and multi-objective (novelty · plausibility · feasibility). MindFlow makes the thinking process explicit, controllable & optimizable:
  • Thinking flow — a DAG over 8 modular operators (Generate, Divergent, Convergent, Critical, Analogical, Counterfactual, Constraint-Driven, Exit).
  • Mind supernet — layer-wise operator inclusion probs π(O|topic); a controller samples topic-specific flows.
  • Tournament ranking — REINFORCE on relative ranks of K flows, not noisy absolute scores.
Reproduction outcome
Claim 1 — supernet instantiates a topic-varying distribution over composable flows.
Claim 2 — trained controller wins aggregate MOScore {mf:.3f} vs best baseline {bb_name} {bb:.3f}.
Claim 3 — tournament reward (std {t_rstd:.2f}) beats collapsed pointwise (std {p_rstd:.2f}); held-out MOScore {t_ov[0]:.3f}→{t_ov[-1]:.3f}.
Scope & cost. 8-query IdeaBench proxy (vs paper's 3,495 papers); 1× RTX 6000 Ada, ~1 hr, ~\\$1–3. Backbone substitution (open 32B) for the paper's unstated closed LLM; 3-judge panel emulated by one model + order randomization.
Claim 1 · graph-structured supernet Open details ↗
Non-uniform, topic-varying operator preferences → a genuine probabilistic supernet.
Claim 2 · superiority across topics Open details ↗
Claim 3 · tournament ranking optimizes the controller Open details ↗
Relative ranking always spreads candidates across ranks 0..K-1 → stable gradient; absolute scoring collapses into a narrow band ('judgment collapse') and barely moves the controller.
Reproduction logbook · Trackio · backbone {GEN} · encoder all-MiniLM-L6-v2 ICML 2026 open-reproduction challenge
""" open(os.path.join(OUT, "poster.html"), "w").write(html) print("wrote poster.html", flush=True) return html def render_png(): from playwright.sync_api import sync_playwright src = os.path.join(OUT, "poster.html") png = os.path.join(OUT, "poster.png") full = "" + open(src).read() + "" tmp = os.path.join(OUT, "_poster_full.html"); open(tmp, "w").write(full) with sync_playwright() as p: b = p.chromium.launch(); pg = b.new_page(viewport={"width": 1600, "height": 900}, device_scale_factor=2) pg.goto("file://" + tmp); pg.wait_for_timeout(400) el = pg.query_selector("#poster"); el.screenshot(path=png) b.close() print("wrote poster.png", os.path.getsize(png), flush=True) return png def build_embed(): png = os.path.join(OUT, "poster.png") uri = "data:image/png;base64," + base64.b64encode(open(png, "rb").read()).decode() # hotspots (percentages of the 1600x900 canvas) over the three claim regions spots = [ {"slug": SLUGS["c1"], "label": "Claim 1 details", "x": 35.0, "y": 20.0, "w": 31.5, "h": 33.0}, {"slug": SLUGS["c2"], "label": "Claim 2 details", "x": 35.0, "y": 55.0, "w": 31.5, "h": 33.0}, {"slug": SLUGS["c3"], "label": "Claim 3 details", "x": 67.5, "y": 20.0, "w": 31.5, "h": 68.0}, ] btns = "\n".join( f'' f'Open details ↗' for s in spots) html = f"""
MindFlow reproduction poster {btns}
""" open(os.path.join(OUT, "poster_embed.html"), "w").write(html) print("wrote poster_embed.html", os.path.getsize(os.path.join(OUT, "poster_embed.html")), flush=True) if __name__ == "__main__": build(); render_png(); build_embed() print("poster done ->", OUT)