One open model to answer, edit and generate

L4StaffDesign15 minSystem design

RolesLLM Product EngineeringCustomer AI Deployment

The question

A design tool wants to ship, with open weights it can host, one model that answers questions about a user's image, edits a region of it on request, and generates a new image from text. The latency per image must stay in seconds, not minutes. Lay out the families you would consider, pick one, and state the test that would make you change the pick.

Answer it first, aloud or on paper. Then open the answer.

The answer

Show short answer

Three open families cover understanding and generation in one model: next-token prediction over discrete codes, which does everything with one loss but spends one pass per code and minutes per image; continuous patches with a diffusion loss next to the text loss, which gives the best fidelity in about 20 passes but trains two losses; and masked discrete decoding, which keeps one loss, fills an image in about 16 passes, and gets region editing free from its masking objective. For a tool that needs editing and a seconds-level latency with open weights, start with the masked discrete family. Change the pick if a fidelity eval on your own prompts shows the quantizer ceiling hurting, or if the latency budget cannot afford sixteen full passes; the continuous two-loss family then takes over, with editing done through conditioned denoising of the region.

Show full answer

The requirements, mapped

RequirementNext-token over codesContinuous two-lossMasked discrete
Visual question answeringyesyesyes
Region editpossible, slow: regenerate codespossible through conditioned denoisingnative: mask the region's codes
Text to imageyes, minutes per imageyes, about 20 passesyes, about 16 passes
Trainingone losstwo losses to balanceone cross-entropy on masked positions
Fidelity ceilingthe quantizer, at 30.5 dB in the best referenceno quantizer, about 32 dB and abovethe quantizer
Open weights to hostyesyesyes

Why masked discrete first

Editing is the feature that distinguishes the product, and the masked objective is editing: mask a region, keep the rest, add the prompt, predict. A latency in the low tens of passes fits a seconds budget. One loss means one training recipe to operate. The reference open model ships text generation, question answering, text-to-image and inpainting from one checkpoint.

Why not the other two first

Next-token over codes spends thousands of passes per image; the reference puts a 512 by 512 image at about 2 minutes at a typical decode rate, and a region edit means regenerating codes in sequence. The continuous design has the best fidelity and no quantizer ceiling, but two losses on different scales need a weight search, and editing needs a conditioned denoising sampler that you build yourself.

The eval that decides

  1. Fidelity: your own prompt set, judged against the continuous reference at matched passes; if the quantizer ceiling shows, as lost fine texture or unreadable text in images, the pick changes.
  2. Edit quality: masked region edits judged for seam quality and prompt adherence.
  3. Latency at your resolution and pass count on your hardware; sixteen full passes of a large transformer can still exceed a budget.
  4. Understanding: the question-answering eval you already run, because the unified model must not fall behind the adapter model it replaces.

Operational notes

Keep the tokenizer fixed and version it with the model; a tokenizer change invalidates every stored code. Log the mask schedule and the pass count as deployment parameters, because they trade latency for quality at serve time without retraining.

Follow-ups

  1. L3SeniorWhich of the three tasks does the masked objective give for free, and why?

    Show expected answer

    region editing; training predicts masked codes from the rest, which is what an edit asks for.

  2. L4StaffHow do you do a region edit in the continuous design?

    Show expected answer

    keep the patches outside the region fixed across the denoising steps and denoise only the region, conditioned on the text and the context; it works, but it is a sampler you write, not a training objective.

  3. L4StaffWhy does the pass count become a serving parameter in the masked design?

    Show expected answer

    more passes commit fewer codes each and raise quality, fewer passes cut latency; the schedule is set at inference, so the product can trade them per request.

  4. L4StaffWhat single measurement tells you that the quantizer is the bottleneck?

    Show expected answer

    the tokenizer's reconstruction of your real images; if the reconstruction already loses the detail your users care about, no generator on those codes can recover it.

Wrong answers

Show the wrong answers that interviewers hear
  • “Ship the next-token model; one loss, one stack, no compromise.”

    Minutes per image at the reference decode rate breaks the latency requirement, and a region edit regenerates codes in sequence.

  • “Fidelity decides, so take the continuous design.”

    Fidelity is one requirement; editing and operational simplicity favor the masked design until an eval shows the ceiling hurting.

  • “Pick the model with the best benchmark score.”

    The product needs three tasks, an edit path and a latency budget; a benchmark covers one of those at best.

Taught in

The Show-o lesson places the three families and names the tasks one checkpoint covers, the Transfusion lesson gives the continuous design, and the Emu3 lesson gives the per-code cost of next-token generation.