DreamLLM writes a document and draws its own pictures, deciding where each one goes. It trains by asking a frozen Stable Diffusion to grade its notes, and reaches FID 8.46 on MS-COCO.
See how one language model can both read pictures and make them, and why that may help it understand better.
Pick a partner, then press Write the document. Watch which one draws, and who chooses where the pictures go. Then we build, piece by piece, the reader, the painter, the learned queries that link them, and the evidence.
You need a feel for what a language model does (it predicts the next word) and the idea of a photo as a grid of numbers. We build the rest from zero.
A reading of the paper “DreamLLM: Synergistic Multimodal Comprehension and Creation” by Runpei Dong, Chunrui Han, Yuang Peng, Zekun Qi, Zheng Ge, Jinrong Yang, Liang Zhao, Jianjian Sun, Hongyu Zhou, Haoran Wei, Xiangwen Kong, Xiangyu Zhang, Kaisheng Ma and Li Yi (ICLR 2024). arXiv 2309.11499. Assigned in MIT MMAI (Spring 2026) beside the lecture Cross-modal transfer. The course schedule.
The scores are the paper’s: FID on MS-COCO from Table 2 (SDv2.1 12.43, Emu-13B 11.66, DreamLLM-7B 8.46; lower is better) and VQAv2 accuracy from Table 1 (Flamingo-9B 51.8, Emu-14B 40.0, DreamLLM-7B 56.6). The page, its two slots and the animation are illustrative, and the roles follow the paper’s Fig. 1 and Sec. 3.1.
Chapter 0
See why a model that looks at pictures and a model that paints them were built apart, and what DreamLLM tries to change
A friend asks you for a short travel guide to Vienna. She wants paragraphs, and she wants a photograph after each one. You write the first paragraph. Then you stop and think: a picture of the opera house belongs here. You sketch it, and you carry on writing.
You did two things without noticing. You decided where a picture should go, and you made it. Your reading of the first paragraph also shaped the picture. A language model of 2023 could do almost none of this in one piece.
Researchers call a language model that also takes images a multimodal large language model, or MLLM. A modality is a kind of data, such as words or pictures. The best MLLMs of that time could comprehend: you show a photo and ask a question, and they answer in words. This is like a friend who can look at a picture and describe it.
Making pictures is called creation. The tool for it was a diffusion model such as Stable Diffusion, which paints an image from a text prompt. Think of a painter who takes a written commission. The painter cannot chat, and cannot read a whole essay and decide where the pictures go.
The paper wants one model that does both, as one stream. It also asks a bigger question: if a model learns to create, does it understand better? The authors open with Feynman’s line from his blackboard, “What I cannot create, I do not understand.” Their word for the hoped-for benefit is synergy: two skills that help each other more than they would apart.
The paper talks about posteriors. A posterior is just the answer to “what do I expect, given what I have seen?” The model for p(words | image) is a language posterior: given a picture, which words follow? The model for p(image | words) is an image posterior: given words, which pictures are likely?
A conditional distribution is one of these, with something given. A marginal distribution is a single thing on its own, such as p(words). A joint distribution covers both together, such as a whole page of words and pictures. A model that learns the joint can produce all the others. That is the paper’s aim.
The paper’s Fig. 1 compares four designs. Try them in the device below. Pick one and look at which of five abilities it has.
Left to right: what goes in, the model, what comes out. Choose a design, and the five abilities underneath light up or stay dim.
This is my reading of the paper’s Fig. 1 and its caption, not a table the paper prints. The paper’s own claim about (c) is that its image target lives in CLIP space and that it needs a second-stage Stable Diffusion fine-tune and human choice of image positions.
Design (a) is CLIP, a model with two towers: one encodes text, one encodes images, and training pulls matching pairs together. It reads and aligns, but it does not write. Design (b), the Flamingo and BLIP family, feeds image features into a language model. It answers in words only, so it is not fully autoregressive over images (it never produces the next image piece).
Design (c) is the most recent before DreamLLM. GILL and Emu let the language model output an embedding that matches what CLIP would say about the target picture. A pretrained Stable Diffusion then paints from that embedding. The aim is CLIP space, an intermediate space, not pixels. The next chapters explain why the authors think that hurts.
Design (d) is DreamLLM. It takes raw words and raw images in, and puts raw words and raw images out, in one causal stream. Two principles carry it, in the authors’ words: generate everything as it is, and interleaved generative pre-training.
Principle one says the model should not learn to imitate a CLIP summary of a picture. It should learn a hidden note that makes a frozen painter produce the real picture. We build this note in Chapters 3 to 5. It is called a set of dream queries.
Principle two says the model should train on whole web pages, where words and pictures alternate. A special <dream> token marks “a picture goes here.” We build that in Chapter 6. The headline numbers, which we check in Chapter 7: FID 8.46 on MS-COCO, and 49.9 on MMBench and 35.9 on MM-Vet for the 7B model. The whole thing trained on 128 A800 chips for about 17.5 hours in three stages.
One caution before we start. The paper says 49.1 for MMBench in its introduction and 49.9 in Tables 1 and 5. We use the table value and flag the difference.
Chapter 1
Turn a photo into 256 tokens that a language model can read like words, and count what they cost
You hold up a photo of a cat and ask, “What colour are its eyes?” A person looks and answers. A language model has a problem. It only knows how to take a list of word vectors and predict the next word. It has no eyes.
The fix is simple to say. Turn the photo into a list of vectors of the same kind. Then the model reads the photo the way it reads a sentence: as more items in the list. This chapter builds that conversion. It is the part of DreamLLM that handles comprehension, and it is the standard recipe of that time.
A token is the unit a language model counts: a word, or a piece of one. Inside the model each token becomes an embedding, a list of numbers (for Vicuna-7B, 4,096 of them) that stands for it. A language model plays one game: given all the tokens so far, give each possible next token a probability. This is autoregressive modelling.
The paper writes it as a product of small questions, one per token:
Now the image. Three parts do the work, and the paper names each one. The visual encoder Hφ is CLIP ViT-L/14 from OpenAI. It is frozen, which means its weights never change during DreamLLM’s training. The projector Mζ is one linear layer. The language model is Vicuna-7B.
The image is resized to 224 × 224 pixels. CLIP cuts it into square patches 14 pixels wide, so 16 × 16 = 256 patches. Each patch becomes one feature vector. The paper confirms the count: a sequence of 256 tokens for each image.
Why a linear layer and not something bigger? The CLIP features already carry the meaning. The projector only has to rotate and rescale them into the language model’s space. A small trainable piece also keeps Stage I cheap, because the big models around it stay frozen.
Now put words and pictures in one sequence. Say the document has K ordered images I1 to IK mixed with words. Let Vk be the projected tokens of image k. Let K(t) be the number of images that come before word t. The training goal is to minimise:
A worked example. The training text is: photo, then “a cat on a sofa”. The sequence is <s>, <IMG>, 256 picture vectors, <IMG/>, a, cat, on, a, sofa. The loss covers only the five word positions. Suppose the model gives “cat” the probability 0.20. The loss for that position is −ln 0.20 = 1.609. If training pushes the probability up to 0.60, the loss falls to 0.511. (These probabilities are illustrative.) The picture tokens themselves are never predicted in this equation. Chapter 6 changes that.
Every image takes 258 positions. The paper trains with a maximum token length of 2,048 (Table 13). Do the sums: seven images take 7 × 258 = 1,806 positions and leave 242 for words. An eighth image makes it 2,064, which is over the cap. Try it below.
The bar is the 2,048 positions the model sees at once. Blue blocks are images, warm is words. Slide the number of images and words. Watch the cap.
258 = 256 CLIP patches plus the two markers, and 2,048 is the maximum token length in the paper’s Table 13. The paper does not say how it truncates a document that goes over, so that rule is yours to choose.
Failure mode, as symptom, measurement and fix. Symptom: in long web pages the last pictures never influence the answer. Measurement: add up 258 per image plus the words, and compare with 2,048. Fix: the paper filters its documents (MMC4 pages with a CLIP score above 0.25, about 2 million kept) and caps the length. When you rebuild this, pick a rule for pages that do not fit and write it down.
Chapter 2
Learn to guess the noise that was added to a picture, and see why that guess is also a way to paint
Drop ink into a glass of water. The ink spreads until the water is evenly grey. Nobody can watch the grey water and say where the ink first fell. Now imagine a film of this played backwards: the grey gathers into a drop. A diffusion model learns to run that film backwards for pictures.
Start with a clean picture z. Add a little random noise (numbers drawn from a bell curve, with no pattern). Add more. After enough steps, only noise is left. This forward process is fixed. Nothing is learned in it.
The paper writes one jump from the clean picture straight to noise level t. Here αt is a number that falls from 1 toward 0 as t grows:
A worked example with one number. Let z = 0.8, αt = 0.64 and ε = −0.5. Then √0.64 = 0.8 and √0.36 = 0.6. So zt = 0.8 × 0.8 + 0.6 × (−0.5) = 0.64 − 0.30 = 0.34. The noisy value is 0.34. (Illustrative numbers.)
Here is the trick. Give a network the noisy value zt and the noise level t. Ask it to guess ε, the noise that was added. The network is a U-Net, a convolutional network shaped like the letter U that outputs something the same size as its input. Call it εξ, with weights ξ. It also gets a condition C, such as the embedding of a text prompt, so it can paint toward what you ask for.
Continue the worked example. The network guesses ε̂ = −0.2. The miss is (−0.2 − (−0.5))2 = 0.09. A good network guesses −0.5 and the loss is 0. We can also recover the clean value from the guess: (zt − 0.6 × ε̂) / 0.8. With ε̂ = −0.2 that is (0.34 + 0.12) / 0.8 = 0.575. With the perfect guess, (0.34 + 0.30) / 0.8 = 0.80, the true z.
The grey curve is the clean signal. The blue curve is the noisy version. The yellow curve is what you get back from a noise guess. Slide the noise up, then slide the denoiser’s skill up.
Illustrative: a 48-point wave with seeded noise. Skill 1 means the guess equals the true noise; skill 0 means a guess of pure fresh noise. The formulas are the paper’s Eq. (2) and the forward step above.
Look at what the network learned: from any messy picture, which way is the noise? The opposite way points toward a cleaner picture. The paper notes that εξ = −σt sξ, where sξ is the score, the arrow that points uphill in the log of the picture density (toward more likely pictures). So a good noise guess is a good sense of direction. To paint, start from pure noise, guess, take a small step toward the cleaner picture, and repeat. The paper times 50, 100 and 150 steps in Table 9b; each step costs about 0.07 seconds on an A800 chip.
The condition C steers each step. In Stable Diffusion, C is a sequence of vectors that the U-Net reads through cross-attention, a layer where picture features look up information in C. In SDv2.1 that sequence has 77 vectors of width 1,024 (standard for that model; the paper does not print it). Remember this: the painter only sees C. Whatever you put in C is everything it knows about your wishes.
Failure mode. Symptom: the painted picture is mush at high noise. Measurement: at α near 0.02 the signal share is √0.02 = 0.14, so even a good guess leaves a large error in the recovered curve. Fix: take many small steps, not one big one. That is why a diffusion model spends 50 or more steps.
Chapter 3
See why asking a language model to imitate CLIP loses detail, and what the paper measured when it tried
You describe a friend’s face to a sketch artist, but you may only use words that a stranger would also use for everyone. “Round face, brown eyes, smiling.” The artist draws a face. It is a fair face. It is not your friend. The details that make your friend different never passed through the words.
This is the problem the paper sees in earlier designs. To explain it, we first need to know what CLIP learns.
CLIP trains two encoders, one for text and one for images. A contrastive loss pulls the embedding of a picture toward the embedding of its caption, and pushes it away from other captions. The result is a space where a photo of a dog sits near the words “a dog.”
Look at what such training rewards. It rewards information that a caption can say. It does not reward the exact fur pattern, the exact position of the dog, or the light. The paper cites the modality gap (Liang et al., 2022): text and image embeddings occupy separate regions of the space, and the space keeps mainly what is shared between the two modalities. Modality-specific knowledge is mostly lost.
GILL, Emu and SEED-style systems wanted a language model that can also paint with Stable Diffusion. Stable Diffusion already reads a condition built from CLIP text features. So their plan was to make the language model output vectors that look like CLIP’s. Call the language model’s output CMLLM and CLIP’s target CCLIP. The training loss is:
The paper raises three objections to this recipe.
Eight things about a picture. Each has a share a caption can say. Slide the pressure toward CLIP and watch which details survive.
A toy, not a measurement. The eight shares are made-up numbers for how well a caption can express each attribute. The rule is: detail kept = (1 − pressure) + pressure × share. The paper’s only direct test is the collapse in Table 3 (below).
The authors did something direct. They took the DreamLLM design and added Lalign on top (Table 3, line 6). Result: the model “fails to converge but rather ends in a collapsing point.” Table 3 prints N/A for every score on that line. They read this as proof that the learned queries are fitting the true data distribution, and that CLIP’s semantics conflict with what the language model encodes.
Be careful with what this shows. It shows that with this training setup, adding the alignment loss on top breaks training. It does not prove that every CLIP-aligned system must fail; Emu and GILL do produce pictures. The claim is narrower: for this design, the alignment target conflicts with the free queries.
If the target must not be a CLIP summary, what can it be? The paper’s answer: the real image. The language model should output whatever a frozen painter needs to paint the real image. We do not need to know in advance what that looks like. The model finds out by trial, using the painter’s own loss as the teacher. That loss is Eq. (2) from Chapter 2. The next two chapters build the message (the dream queries) and the teaching signal (score distillation).
Failure mode, as symptom, measurement and fix. Symptom: pictures from a CLIP-aligned model get the subject right and lose the layout and the style. Measurement: compare FID on LN-COCO, where captions are long and detailed. Stable Diffusion alone gets 34.26; DreamLLM gets 20.53 (Table 2). Fix: stop aiming at an intermediate space; let the painter’s own loss shape the condition.
Chapter 4
Build the learned message that lets a language model brief a painter, and see why 64 slots work best
You have finished an essay about a Siamese cat. Now you want a painter to illustrate it. You cannot hand the painter your whole mind. So you stick 64 blank notes at the end of the essay and say: “Fill these in with what the painter needs.” Later, the painter reads only the notes.
That is the whole idea of this chapter. The blank notes are dream queries. They are the paper’s key trick for letting a language model talk to a diffusion model without a CLIP target in between.
A dream query is a learned embedding: a vector of 4,096 numbers, the same width as a word in Vicuna-7B. It starts as a blank and training gives it values. There are Q of them; the default is Q = 64. The paper writes the set as d = {d1, …, dQ}. They are the same for every picture. They are like the blank form: the form is fixed, and what the model reads into it changes with the context.
Why does that work? Because the language model is causal: each position can look at everything before it, and nothing after it. If the 64 query positions are placed at the end of the context, each one can read the entire document so far, including earlier pictures. After the model runs, the 64 output vectors at those positions hold its answer. They are the filled-in notes.
Suppose token t is predicted as the special <dream> token. The model then needs the condition for image number K(t)+1. The paper writes:
Why 64 vectors and not one? One vector is a tiny channel for a whole scene: subject, layout, style. Many vectors give the painter many separate things to look up, the same way a long prompt gives it many words. Why queries and not just the last hidden state of the sentence? The hidden state belongs to a word. The queries belong to the job. They always sit in the same place and always have the same duty, so the painter’s cross-attention can learn where to look.
Each small square is one query. Purple lines show every query reading the whole history to its left. Pick 32, 64 or 128 and read the paper’s score.
FID values are the paper’s Table 9a: 32 queries 9.56, 64 queries 8.46, 128 queries 14.24 (zero-shot, MS-COCO 30K, lower is better). The grid and the lines are a drawing of the mechanism, not real attention weights.
The paper looks inside in Fig. 6. It draws the cross-attention between each of the 64 queries and the U-Net’s picture features, averaged over all noise levels. The queries sit in an 8 × 8 grid. Two things stand out. First, the attention is structured and disentangled: different queries pick out different subjects and the background. Second, the patterns look very alike across different prompts. In plain Stable Diffusion, the attention follows which words are in the prompt. In DreamLLM, each query seems to keep a fixed job. The authors guess this comes from the causal order giving a steady semantic structure.
That is a guess, and the paper says “we postulate.” Treat it as a clue, not a proof.
Table 9a says 64 is best, and 128 is worse, at 14.24 FID. The authors say 128 “may be too many,” and that the best number depends on data size and on the decoder. A reimplementer should treat Q as a setting to tune. It is not a law. Failure mode, as symptom, measurement and fix. Symptom: FID jumps from 8.46 to 14.24 after raising Q. Measurement: Table 9a. Fix: go back to 64 unless you have more data and a stronger image decoder.
Chapter 5
Follow the training signal from the painter’s noise error back into the language model, with no CLIP target
Back to the essay and the painter. You wrote 64 notes. The painter, who never changes, tries to repaint a known real picture from your notes. If the notes are poor, the repaint is poor. You see the error, change your notes, and try again. After thousands of tries, your notes get good. The painter did not learn anything. You did.
This is how DreamLLM trains its image side. This chapter shows exactly where the signal goes.
Take the diffusion loss from Chapter 2. Replace the generic condition C with the condition made by the language model, the 64 notes from Chapter 4. The paper’s Eq. (4) is:
Compare with Eq. (2). The formula is almost the same. Only two things changed: C comes from the language model, and the gradient does not update ξ.
This is the point beginners miss. Frozen means the weights ξ are not changed by the optimiser. It does not mean the gradient cannot pass through them. By the chain rule, the loss can still ask: if I nudged the condition C a little, how would the error change? That answer flows backward through the U-Net layers, then through the condition projector Mψ, then through the 64 query outputs, then into the language model and the queries.
A worked example with single numbers. Let the frozen painter be a one-weight function: guess = w · c, with w = −1.5 (frozen). The true noise is ε = −0.5. We want to find the note c. The best note is c* = ε / w = 0.333. Start with a poor note, c = −0.6.
The guess is −1.5 × (−0.6) = 0.9. The loss is (0.9 − (−0.5))2 = 1.96. The gradient with respect to c is 2 × (guess − ε) × w = 2 × 1.4 × (−1.5) = −4.2. With learning rate 0.2, the new note is c = −0.6 − 0.2 × (−4.2) = 0.24. The new guess is −0.36, and the loss is 0.0196. One step took the loss from 1.96 to 0.02, and w never moved. (Illustrative numbers.)
The painter weight w is locked at −1.5. Only the note c changes. Choose a learning rate and press Step or Run. Then try the big one.
A one-number toy of the gradient path, not the real U-Net. The update is c ← c − lr × 2(w·c − ε)·w. It converges when lr × 2w² is below 2, which fails for the big rate here.
Chapter 2 said the noise guess is a score, a direction toward likelier pictures. The frozen Stable Diffusion has already learned that score from billions of pictures. DreamLLM distils from it: it borrows the painter’s knowledge and uses it as the teacher for the notes. The paper links this to score distillation sampling (the trick used to turn 2D painters into 3D shape makers) and to textual inversion (learning one word embedding that makes a painter draw a given subject). DreamLLM’s version learns a whole condition, from a model, for every document.
The paper also writes the same objective as a KL divergence (Eq. 5): it pushes the distribution the painter would give under the condition toward the true one. If you take Stable Diffusion as the best possible score function, then minimising Eq. (4) is maximum likelihood for the image posterior. This is a modelling assumption of the paper, not something it proves.
Failure mode, as symptom, measurement and fix. Symptom: the loss climbs after a few steps. Measurement: print the loss every step and the note value; if the note flips sign each step, the step is too big. Fix: lower the learning rate. In the paper the learning rates are 2e-3 in Stage I (only projectors and queries train) and 2e-5 in Stage II, when the whole language model is open (Table 13).
Chapter 6
Learn how one model decides where a picture goes, paints it, reads it back, and how the three training stages build that skill
Open any news article. A paragraph, a photo, a paragraph, another photo. Web pages are interleaved documents: words and images in a mixed order. A pair like “photo plus caption” is just a short special case, and so is a page of text alone. If a model learns pages, it learns all of these.
The paper calls this interleaved generative pre-training, or I-GPT. “Pre-training” here means the long first phase of learning from raw documents, before any instruction tuning. The target is a model that can make the page, not just read one.
To write a page, the model must decide when to put a picture. The paper adds one new token, <dream>, and places it before each image in the training data. The model is trained to predict it like any other word. When it does so at inference time, it takes this as “draw now,” “on its free will,” in the paper’s phrase. A closing <dream/> follows the queries, like the <IMG/> marker for input images.
This is the answer to the question in the hero. A CLIP-aligned model needs a person to say where images go. DreamLLM learned where pictures appear in real pages, because that is exactly what it was trained to predict.
For a text token the loss is the usual next-word cross-entropy. For a <dream> token the same loss teaches the placement. For the image that follows, the loss is the diffusion loss from Chapter 5. The paper folds them into one maximum-likelihood statement:
The paper does not state a weight between the word loss and the image loss. A reimplementer has to choose one; weighting both by 1 is the simplest start. This is an unspecified detail, and it matters.
The causal order gives every conditional for free. Words given an image, p(w | I), is comprehension. An image given words, p(I | w), is text-to-image. A page is the joint. One stream, all of them.
At inference the model writes like a normal language model, with one extra move. Step through it below. The example is the paper’s Fig. 2: “I like my cute Siamese cat.” then a picture, then “She has beautiful blue eyes…”
Press Next to walk through one image being created. The bottom strip is the context. The boxes above are the pipeline pieces.
The sentence and its token counts are illustrative (a real tokenizer splits differently). The pipeline order, 64 queries, 50 denoising steps, the classifier-free scale 7.5 and the 258-position feedback are the paper’s (Sec. 3, Fig. 2, Appendix C.2, Table 9b).
One extra detail: classifier-free guidance (CFG). At each denoising step the painter makes two guesses, one with the condition and one with an empty condition. The final guess pushes away from the empty one: ε̂ = (1 + s) ε(C) − s ε(∅). The scale s makes pictures more faithful and less varied. DreamLLM uses it only at inference: the scale is 7.5 by default and 2.0 for MS-COCO scoring.
| Stage | What trains | Data | Learning rate | Cost |
|---|---|---|---|---|
| I Alignment | visual projector, condition projector, dream queries (LLM, CLIP, SD frozen) | about 30M image-text pairs | 2e-3 | about 6 h, 128 A800 |
| II I-GPT pretraining | the same, plus the whole language model | about 2M MMC4 documents (CLIP score above 0.25) plus 2M BLIP-LAION pairs | 2e-5 | about 10 h, 128 A800 |
| III Instruction tuning | language model unfrozen | 80K LLaVA instructions, 20K InstructMMC4, 20K Instruct-BLIP-LAION | 4e-5, 3 epochs | about 1.5 h, 128 A800 |
Why this order? Stage I lets the new small parts (projectors, queries) settle against frozen big ones, with a high learning rate that would wreck a large model. Stage II opens the language model once those parts are sane. Stage III turns the model into an assistant. The last two data sets were made by prompting GPT-4 with document summaries or image captions.
Failure mode, as symptom, measurement and fix. Symptom: pictures in a generated page look unrelated to each other. Measurement: the paper notes that MMC4 has no image consistency, so pages come out with inconsistent subjects (Fig. 3). Fix: the paper fine-tunes on about 270K subject-consistent samples for 20 epochs, following BLIP-Diffusion (Appendix A.4, Fig. 8).
Chapter 7
Read the drawing scores, the understanding scores and the synergy test, then list what the paper admits it cannot do
A friend tells you her new method “draws better and understands better.” You ask: better than what, measured how, and could something else explain it? This chapter asks those three questions of each table in the paper.
FID, the Fréchet Inception Distance, scores a whole set of generated pictures. A fixed image network turns real pictures and generated pictures into feature vectors. FID is the distance between the two clouds of features. Lower is better, and zero would mean the clouds are identical. It does not judge one picture; it judges the batch. “Zero-shot” means the model was not trained on the test set’s own training split.
The paper tests on MS-COCO (short captions, 30K validation prompts) and LN-COCO (long, detailed captions). Table 2 reports: Stable Diffusion v2.1 alone, 12.43 and 34.26. DreamLLM after Stage I alone, 8.76 and 22.42. DreamLLM at the end, 8.46 and 20.53. So the language model cut MS-COCO FID by 3.97 and LN-COCO FID by 13.73 from the same frozen painter. The authors read the large LN-COCO gain as better use of long context. For comparison: Emu-13B 11.66, GILL-8B 12.20, CM3Leon-7B 10.82. But specialist painters beat DreamLLM: Imagen 7.27 and Parti-20B 7.23. The paper says “competitive,” and that is a fair word.
Note how DreamLLM generated those images. For MS-COCO it sampled 8 pictures per prompt and picked by CLIP score, like earlier work. For LN-COCO it sampled one, because the captions are too long for CLIP’s limit. Eval settings differ across the compared models, so small gaps need care.
Table 1 covers captioning and question answering. On VQAv2 (answer questions about a photo; the score is accuracy), DreamLLM-7B gets 56.6. Emu scores 40.0, so the gain is +16.6, as the paper says. Flamingo-9B is 51.8. On the comprehensive tests MMBench and MM-Vet it reports 49.9 and 35.9. Those scores are judged by GPT models. A version trained on LLaVA-1.5’s instruction data (marked with a star) reaches 72.9 on VQAv2 and 58.2 on MMBench, but the paper marks it as non-zero-shot. Do not compare the starred row with zero-shot rows.
The hallucination test POPE asks “is there a [object] in the image?” with absent objects chosen in three tricky ways. DreamLLM-7B scores 86.36 accuracy on the random split, with 52.75% “yes” answers. The ideal is 50%, so it does not say yes to everything. Several rivals in Table 7 answer yes 95 to 100% of the time.
Pick a table. DreamLLM is in green. Read the direction note on each chart, because lower is better for FID.
All values are printed in the paper. Table 3 and Table 1 columns were read from a text extraction; check the original before you quote them. The synergy rows list the ablations with the same architecture and data, as the paper describes.
This is the paper’s main claim, and Table 3 is its evidence. The authors train three versions with the same architecture and data, differing only in the objective: creation-only (image loss only), comprehension-only (word loss only) and joint (both, the default). They also vary whether interleaved data (ID) is used in Stage II. Read it carefully.
| Setup | Interleaved data | MM-Vet | VQAv2 | COCO FID |
|---|---|---|---|---|
| Stable Diffusion alone | no | none | none | 12.43 |
| Creation-only | no / yes | none | none | 8.50 / 8.57 |
| Comprehension-only | no / yes | 31.0 / 34.4 | 55.1 / 54.3 | none |
| Joint (DreamLLM) | yes | 35.9 | 56.6 | 8.46 |
| Joint plus CLIP alignment | yes | collapsed | collapsed | collapsed |
What does it support? Drawing: the language model helps a lot (8.50 against 12.43), but joint training adds almost nothing over creation-only (8.46 against 8.50). Understanding: joint beats comprehension-only with interleaved data by 1.5 on MM-Vet (35.9 against 34.4) and 2.3 on VQAv2 (56.6 against 54.3). Interleaved data helps MM-Vet (31.0 to 34.4) but VQAv2 slips (55.1 to 54.3). So the evidence for synergy is real but modest: a gain of about 1 to 2 points in understanding, on single runs, with no error bars. The paper shows no seeds or confidence intervals.
A second control is the rewrite-then-generate baseline (Table 10): the model writes a prompt and a stock Stable Diffusion draws it, with no learned queries. It gets FID 11.91, VQAv2 54.2 and MM-Vet 34.1, against DreamLLM’s 8.46, 56.6 and 35.9. The paper also reports that language-only scores mostly hold: DreamLLM is above Vicuna-7B on 5 of 6 tests, but MMLU drops from 45.0 to 41.8, a loss of 3.2 points (Table 4).
For free-form pages, the paper generates from instructions on 15K held-out InstructMMC4 documents. FID against the ground-truth images is 36.62 for DreamLLM, against 74.77 for Stable Diffusion given the matched text. In a human study (150 samples, five volunteers) 60.68% of DreamLLM pages were judged supported, against 77.24% for real MMC4 pages, which contain duplicate and poor images. The paper compares this with a 30% bar it calls the Turing test requirement. At inference the extra cost is small: about 0.2 s over Stable Diffusion alone for 50 steps, because the U-Net dominates.
Failure mode, as symptom, measurement and fix. Symptom: a reported gain looks bigger than it is. Measurement: compare with the right control (same data, same size) and check the direction of the metric. Fix: quote Table 3 differences of 1 to 2 points as suggestive and re-run with seeds before building on them.
Chapter 8
Keep the numbers, the terms, a rebuild checklist, the core code and the reading list in one place
DreamLLM turns a language model into a writer of illustrated documents. It reads images through a frozen CLIP and a linear projector. It paints through a frozen Stable Diffusion, briefed by 64 learned dream queries. A <dream> token tells it when to paint. The only training signal on the image side is the painter’s own noise-prediction error, passed back through the frozen U-Net. Go back to the hero and rerun the three partners: you now know what each one lacks.
| Quantity | Value | Where |
|---|---|---|
| Language model | Vicuna-7B (LLaMA-1 on ShareGPT) | Sec. 3, App. C.2 |
| Visual encoder | CLIP ViT-L/14, frozen, 224 × 224, 256 tokens per image | App. C.2 |
| Image decoder | Stable Diffusion v2.1 at 512 × 512, frozen | App. C.2 |
| Dream queries | 64 (32 gives FID 9.56, 128 gives 14.24) | Table 9a |
| Max token length | 2,048 per training sample | Table 13 |
| Training data | 30M pairs, then 4M documents and pairs, then 120K instructions | Table 13 |
| Compute | 128 A800 GPUs, about 6 h, 10 h and 1.5 h per stage | Table 13 |
| Guidance scale | 7.5 default, 2.0 for MS-COCO scoring | App. C.2 |
| FID, MS-COCO / LN-COCO | 8.46 / 20.53 (SDv2.1: 12.43 / 34.26) | Table 2 |
| VQAv2, MMBench, MM-Vet | 56.6, 49.9, 35.9 (zero-shot, 7B) | Table 1 |
| Extra latency | about 0.2 s over SD at 50 steps | Table 9b |
python# A sketch of DreamLLM's two core moves. Sizes are the standard ones for these backbones. class DreamLLM(nn.Module): def __init__(self, llm, clip, sd_unet, sd_vae, Q=64): self.llm, self.clip = llm, clip.eval() # Vicuna-7B; CLIP ViT-L/14 (frozen) self.unet, self.vae = sd_unet.eval(), sd_vae.eval() # SD v2.1 (frozen) self.vis_proj = nn.Linear(1024, 4096) # M_zeta: CLIP width to LLM width self.cond_proj = nn.Linear(4096, 1024) # M_psi: LLM width to SD condition width self.dream_q = nn.Parameter(torch.randn(Q, 4096) * 0.02) # init is my choice, not the paper's def encode_image(self, img): # img: (B, 3, 224, 224) with torch.no_grad(): f = self.clip(img) # (B, 256, 1024) return self.vis_proj(f) # (B, 256, 4096), wrapped by <IMG> ... <IMG/> def condition(self, prefix_emb): # (B, T, 4096), ends with the <dream> embedding q = self.dream_q.expand(prefix_emb.shape[0], -1, -1) h = self.llm(inputs_embeds=torch.cat([prefix_emb, q], 1)).last_hidden_state return self.cond_proj(h[:, -q.shape[1]:]) # (B, 64, 1024): causal, so queries see the prefix def image_loss(self, prefix_emb, image512, alphas_bar): C = self.condition(prefix_emb) z = self.vae.encode(image512).sample() * 0.18215 # (B, 4, 64, 64) latent; SD's usual scale t = torch.randint(0, 1000, (z.shape[0],)) eps = torch.randn_like(z); a = alphas_bar[t].view(-1, 1, 1, 1) zt = a.sqrt() * z + (1 - a).sqrt() * eps eps_hat = self.unet(zt, t, encoder_hidden_states=C).sample # weights frozen, gradient still flows to C return F.mse_loss(eps_hat, eps) # total loss = text cross-entropy (incl. predicting <dream>) + image_loss; the paper gives no weight, so I use 1.0.
DreamLLM belongs to the line of work that tries to make one model both understand and generate. The paper’s related work notes that early systems tokenise images into discrete codebook entries and predict them like words. DreamLLM keeps the painter separate and learns the brief. The lecture it was assigned with, Cross-modal transfer, asks what carries over between modalities; DreamLLM is one answer for the pair of reading and drawing.
Credit: DreamLLM is the work of Runpei Dong, Chunrui Han, Yuang Peng, Zekun Qi, Zheng Ge, Jinrong Yang, Liang Zhao, Jianjian Sun, Hongyu Zhou, Haoran Wei, Xiangwen Kong, Xiangyu Zhang, Kaisheng Ma and Li Yi, published at ICLR 2024 (arXiv 2309.11499, project page). This lesson is an independent reading for the MIT MMAI course follow-along. Any error is ours.
Now press Present or Teach and explain DreamLLM from memory: why the CLIP target loses detail, what the 64 queries are, how a frozen painter still teaches, and what Table 3 does and does not prove. Then go back to the hero and run it once more.