From a draft to a Figure 1 in two messages

A recorded Claude Code session, shown step by step. The agent took 95 seconds to come back with templates and about two minutes to draft the figure. The draft is a made-up test paper, so its numbers are not real results.

You give it

# Remask, Don't Regret: Self-Correcting Masked Diffusion Language Models

## Abstract
Masked diffusion language models (MDLMs) generate text by iteratively unmasking tokens, but once a token is
unmasked it is frozen: early mistakes can never be revised and they compound as later tokens condition on them.
We introduce ReMask, a training-free sampler that lets an MDLM undo its own decisions. At each step ReMask scores
every already-unmasked token with the model's own posterior, re-masks the lowest-confidence ones, and re-predicts
them with the richer context now available. A simple budget schedule keeps the number of network evaluations
unchanged. On OpenWebText, ReMask lowers generative perplexity from 42.1 to 27.8 at 64 steps without reducing
entropy, and on code infilling it raises pass@1 from 31% to 44%. We show that most of the gain comes from
correcting tokens committed in the first 20% of steps.

## Method (notes)
- Standard MDLM sampling: mask -> unmask by confidence -> token frozen forever.
- ReMask: after each unmask step, compute per-token posterior confidence, re-mask bottom-k, continue.
- Budget schedule: k_t decays linearly to 0; total NFE equal to baseline.

A rough draft: an abstract and three lines of notes. draft.md

You get back

The drafted Figure 1: two token grids side by side. In standard sampling a wrong token stays frozen through every step; with ReMask it is re-masked and corrected. A strip below gives the budget schedule and the headline numbers.

A Figure 1 as an editable matplotlib script, a PDF and a PNG. All files from this run

The replay

  1. You Paste the prompt

    I'm writing a paper and need a Figure 1.
    My draft: draft.md
    
    Use Fig1 Atlas to design it: clone https://github.com/pengzhangzhi/Fig1-Atlas and follow its SKILL.md.
    Show me 3 to 5 Figure 1s from accepted papers that make the same kind of argument as mine, recommend one, and sketch how my content fills its layout. After I pick, draft the figure.
  2. Agent Gets the atlas and reads its instructions

    git clone --depth 1 https://github.com/pengzhangzhi/Fig1-Atlas
    cat SKILL.md references/roles.md
  3. Agent Decides what the figure has to argue

    Standard MDLM sampling freezes every unmasked token, so early mistakes survive and compound; ReMask lets the same model re-mask and fix them at the same NFE. That is a prior-vs-ours figure with a problem-setup flavour.
  4. Agent Checks which tags the atlas uses, then searches three ways

    python3 scripts/search.py --list-tags mask
    masked-diffusion(49) masking(24) … remasking(9) … re-masking(2) …
    
    # same argument, related topic
    python3 scripts/search.py --role prior-vs-ours,problem-setup --tags self-correction,remasking,error-accumulation,masked-diffusion,…
    # 6269 hits of 17563 papers, showing 30
    icml26-0239 | ICML 2026 poster | pipeline/prior-vs-ours | Fine-Tuning Masked Diffusion for Provable Self-Correction | Standard inference fixes tokens once unmasked; adding a learned per-token quality score lets the model detect and remask mistakes…
    icml26-4984 | ICML 2026 poster | prior-vs-ours/pipeline | Guided Star-Shaped Masked Diffusion | Prior samplers make irreversible or undirected corrections; ours adds a learned error predictor…
    
    # closest papers, however their figure argues
    python3 scripts/search.py --tags remasking,re-masking,self-correction,masked-diffusion --q "remask low-confidence tokens revise frozen unmasked"
    # the same kind of figure from any field
    python3 scripts/search.py --role prior-vs-ours --role-only --hosted --tags error-accumulation,error-correction,iterative-refinement,…
  5. Agent Reads 16 shortlisted entries

    python3 scripts/show.py icml26-0239 icml26-4984 iclr26-1039 iclr26-1449 icml26-5222 …
    == icml26-0239 | ICML 2026 poster | Fine-Tuning Masked Diffusion for Provable Self-Correction
    role: pipeline (+prior-vs-ours) | style: colorful, icon-heavy, minimal
    layout: 3 panels, left-to-right; dashed divider, green arrow from vanilla to ours, training box at right
    description: Three panels. The left panel, 'MDM Vanilla Inference', shows rows of token boxes going top to bottom through an MDM block … A wrong token, 'eat', stays fixed to the end. …
  6. Agent Downloads eight figures and looks at each one

    python3 scripts/fetch_fig.py iclr26-1449 icml26-0239 iclr26-1039 icml26-5222 neurips26-1599 icml26-0825 icml26-4984 icml26-0140
  7. Agent Comes back with four templates and a pick

    Figure 1 of Soft-Masked Diffusion Language Models

    1. Soft-Masked Diffusion Language Models ICLR 2026

    Layout
    Two token grids side by side, rows are decoding iterations, with a vertical “decoding iterations” arrow. The baseline's final row has one red wrong token; the “this work” grid ends all green.
    Why it fits
    It makes your argument (the baseline commits an error and keeps it; ours does not) with a different mechanism, so you can borrow the layout without resembling a competitor.
    Mapping
    (a) “Standard MDLM: unmask → frozen”, where a wrong token committed in row 1 is carried unchanged to the last row. (b) “ReMask: unmask → score → re-mask → re-predict”, where the same token is flagged, returned to [M], and refilled correctly.
    Figure 1 of Early Decisions Matter: Proximity Bias and Initial Trajectory Shaping in Non-Autoregressive Diffusion Language Models

    2. Early Decisions Matter ICML 2026

    Layout
    Two panels with rows t=0..4, pink tokens against green, and small confidence bar charts above the slots.
    Why it fits
    Its claim is that early choices decide the trajectory, which matches your finding that most of the gain comes from the first 20% of steps.
    Mapping
    The same grids as template 1, with posterior-confidence bars above already-unmasked tokens. The lowest bar is the one that gets re-masked.
    Figure 1 of On the Error Correcting Effects of Stochasticity in Discrete Diffusion

    3. On the Error Correcting Effects of Stochasticity in Discrete Diffusion NeurIPS 2026

    Layout
    Mechanism cartoon on top, step timelines where the proposed sampler has arcs jumping backward, and quality-vs-NFE plots at the bottom.
    Why it fits
    It is the only one that shows “correction at no extra network evaluations” together with the headline number.
    Mapping
    Timeline (a) is MDLM with forward-only arcs. Timeline (b) is ReMask with small backward arcs whose size shrinks linearly to 0. Below, generative perplexity vs steps with 42.1 → 27.8 marked at 64.
    Figure 1 of Rex: A Family of Reversible Exponential (Stochastic) Runge-Kutta Solvers

    4. Rex: Reversible Exponential Runge-Kutta Solvers ICML 2026

    Layout
    Two minimal schematic plots on matching axes, with a red “ε” gap badge against a green “ε=0” badge.
    Why it fits
    It is the cleanest “error accumulates vs. doesn't” picture.
    Mapping
    x = sampling step, y = number of wrong committed tokens. The frozen curve only rises; the ReMask curve bends back down. It would need a measured error-vs-step curve to be honest, and it hides the mechanism.

    Closest prior work, weak templates to copy. PRISM (icml26-0239) and RemeDi (iclr26-1039) draw almost exactly your idea. Reviewers will have them in mind, so your figure should look different and make “training-free, same frozen model, same NFE” visible.

    Recommendation: template 1, with two borrowings. Use the Soft-Masked two-grid layout as the body. Add the confidence bars from template 2 and a thin budget/NFE strip from template 3 along the bottom. The grid shows both the failure and the fix in one glance, and the strip carries the claim that separates you from PRISM and RemeDi.

     (a) Standard MDLM: unmask → frozen          (b) ReMask (ours): unmask → score → re-mask
     step                                         step
      0 │ [M]  [M]   [M]   [M]  [M]   [M] [M]      0 │ [M]  [M]   [M]     [M]  [M]   [M] [M]
      1 │ The  chef  flew✗ [M]  [M]   [M] [M]      1 │ The  chef  flew    [M]  [M]   [M] [M]
        │            frozen                           │           ▁ low posterior conf.
      2 │ The  chef  flew✗ the  pasta [M] [M]      2 │ The  chef  [M]↺    the  pasta [M] [M]
      3 │ The  chef  flew✗ the  pasta in  [M]      3 │ The  chef  cooked  the  pasta in  [M]
      T ▼ The  chef  flew✗ the  pasta in  a pot    T ▼ The  chef  cooked✓ the  pasta in  a pot
          └ early error persists, later tokens         └ re-predicted with richer context
            condition on it
     ───────────────────────────────────────────────────────────────────────────────────────
     re-mask budget k_t: ▇▆▅▄▃▂▁ → 0   |  NFE: 64 = 64  |  Gen. PPL 42.1 → 27.8  |  pass@1 31% → 44%

    Things to settle in the paper. “Re-evaluating Confidence Remasking in Masked Diffusion Language Models” (NeurIPS 2026) reports that confidence remasking gives little benefit at matched NFE. Your equal-NFE claim will be read against it.

    Which template do you want, and in what format: TikZ, matplotlib, or SVG?

    Shortened. The full answer

  8. You Pick one

    1 as recommended. Use matplotlib so I can tweak it in Python, and save a PDF and a PNG next to draft.md.
  9. Agent Writes the script, renders it, looks at the render and fixes it

    python3 fig1_remask.py
    # reads fig1_remask.png, moves a label that collided with the confidence bars, renders again
    python3 fig1_remask.py
  10. Agent Hands over the figure

    The drafted Figure 1

    Three things in it are placeholders, not your data. The sentence (“The chef flew/cooked the pasta in a pot”) is one I made up; swap in a real sample where ReMask fixes an early token. The confidence bars have illustrative heights. The budget bars are a schematic of linear decay, not your actual schedule values.

    To tweak it, edit the EDIT block at the top of the script and rerun python3 fig1_remask.py.

    The layout is adapted from Figure 1 of “Soft-Masked Diffusion Language Models” (ICLR 2026), with the confidence bars borrowed from “Early Decisions Matter” (ICML 2026). Only the layout is borrowed, not the artwork.

    fig1_remask.py, fig1_remask.pdf, the full answer

Try it on your paper