datarekha

Unified multimodal models

A vision-language model can see but not draw — it understands images and generates only text. Unified multimodal models do both: one model that perceives and generates images by putting everything in a single token space. Chameleon and Emu3 do pure next-token; Transfusion fuses autoregression and diffusion in one transformer. The path to any-to-any.

7 min read Advanced NLP & Transformers Lesson 41 of 44

What you'll learn

  • Why a standard VLM understands images but can't generate them
  • The unified-token approach — discretize images, predict next token over everything
  • The AR-vs-diffusion tension and the Transfusion hybrid
  • What "any-to-any" unlocks and where it's heading

Before you start

A standard vision-language model can see but not draw — it reads images and outputs only text. Unified multimodal models close the loop: a single model that both perceives and generates images (and beyond). The trick is to stop treating images as something special and put everything in one token space.

One token space for text and images

A visual tokenizer (a VQ-VAE) discretizes an image into a sequence of discrete codes — exactly like text tokens, just from an image codebook. Now text and image are tokens in one vocabulary, and a single next-token transformer can read or write either, switching modality at special markers:

seq = ["<text>", "a", "red", "apple", "<image>", "img42", "img17", "img88", "</image>"]
vocab_text  = {"a", "red", "apple"}
vocab_image = {"img42", "img17", "img88"}      # discrete codes from a visual (VQ) tokenizer

for tok in seq:
    kind = "TEXT" if tok in vocab_text else "IMAGE" if tok in vocab_image else "MARKER"
    print(f"{tok:<10} -> {kind}")
<text>     -> MARKER
a          -> TEXT
red        -> TEXT
apple      -> TEXT
<image>    -> MARKER
img42      -> IMAGE
img17      -> IMAGE
img88      -> IMAGE
</image>   -> MARKER

One autoregressive model predicts the next token across the whole sequence — so the same model that answers “what’s in this image?” can also emit image tokens to generate one. Chameleon does exactly this (early-fusion, mixed-modal tokens trained together); Emu3 pushes “just next-token prediction” over text, images, and video to its logical end.

One token space → one model reads and writes bothimageVQ tokenizerone sequence (text + image tokens)aredappleimg42img17img88one next-token transformertext OR imagepredict next token — understand (read) and generate (write) in one model
A VQ tokenizer turns images into discrete tokens, so one next-token transformer can both read images and write them.

The AR-vs-diffusion tension, and a hybrid

There’s a catch: autoregressive image tokens (from a VQ codebook) don’t match the quality of diffusion — discretizing pixels loses fidelity. So a second family combines both in one transformer: Transfusion runs a next-token loss on text and a diffusion loss on image patches inside a single model, getting language fluency and diffusion-grade images together. Janus takes another route — decouple the visual encoders, using one representation for understanding and a different one for generation, since the two tasks want different features. Different recipes, same goal: one model that both perceives and creates.

In one breath

  • A standard VLM understands images but only generates text; unified multimodal models both perceive and generate by using one token space.
  • A visual tokenizer (VQ-VAE) discretizes images into tokens, so text and image are one vocabulary and one next-token transformer reads or writes either (the demo: text + image tokens in one sequence) — Chameleon, Emu3.
  • Autoregressive image tokens lose quality vs diffusion, so Transfusion fuses a next-token loss (text) and a diffusion loss (image) in one transformer; Janus decouples the understand vs generate encoders.
  • This enables any-to-any (text↔image↔audio in one model) — the basis of native generation in models like GPT-4o, tighter than a bolted-on VLM + diffusion pipeline.
  • The open tension is AR simplicity vs diffusion quality, with hybrids leading.

Quick check

Quick check

0/4
Q1Why can't a standard vision-language model generate images?
Q2How do unified models like Chameleon represent images so one transformer can generate them?
Q3What problem does Transfusion's hybrid address?
Q4What is the advantage of a unified model over a bolted-on VLM + separate diffusion model?

Next

Unified models extend the VLM architectures from understanding to generation, with diffusion often supplying the image quality. Extending the same recipe to audio and physical action is omni & embodied models.

Sign in to track your progress

Completed lessons, your XP, level, and streak save to your account — it's free and takes a few seconds.

Related lessons

Explore further

Skip to content