A field guide · Vision-language models

Teaching Language Models to See

How vision-language models are pretrained. You already have a strong vision encoder and a strong language model. This is what it takes to make them work as one model.

Vision-language modelsPretrainingTraining data

Why connecting is not enough

Suppose you already own two excellent models. One is a vision encoder, such as SigLIP, that turns an image into a grid of feature vectors. The other is a language model that writes fluent text. Why can't you plug the first into the second and get a vision-language model?

Try it and see what happens. Take the encoder's output vectors. Add a small linear layer so that each vector has the width the language model expects. Put those vectors in front of a question, such as "What is written on the sign?", and let the language model answer.

The answer will be fluent and wrong. The language model will ignore the image, or treat it as noise, or describe something that is not there. Nothing is broken. The shapes match and every operation runs. But the language model has never seen these vectors before. To it they are not words, and they do not mean "a red sign that says OPEN".

This article explains what it takes to close that gap. It is the vision-language counterpart of How LLMs Are Pretrained. The emphasis is on the training recipe. The architecture is covered in The VLM Architecture Gallery, and how pixels become visual tokens is covered in Inside a Modern Vision Encoder. Here we ask a different set of questions:

We start before vision-language models existed, with the older idea of learning vision from language. That history explains why today's vision encoders are good starting points, and why they are still not enough on their own.

Learning vision from language

For most of the 2010s, vision models learned from labels. A model looked at an image and predicted one class out of a fixed list, such as the 1,000 ImageNet classes. This works, but each label carries very little information. The label "dog" says nothing about the dog's color, what it is doing, or what else is in the picture. The model also cannot recognize anything outside the list.

A caption carries far more. "A brown dog catching a frisbee on a beach at sunset" names objects, an action, a place and a time of day. The web contains billions of images that come with some text attached. The question was how to learn from that text when it is noisy and free-form.

Contrastive learning: match images to their captions

CLIP gave the answer that stuck. It trains two encoders side by side. An image encoder maps each image to a vector. A text encoder maps each caption to a vector of the same size. Training uses a batch of B image-caption pairs. The model should place each image close to its own caption and far from the other B − 1 captions in the batch.

Let ui be the normalized image vector and vj the normalized text vector. Their similarity is the dot product sij = ⟨ui, vj⟩. For image i, treat the batch as a classification problem with B choices, where the right choice is caption i. That gives a softmax over each row of the similarity matrix. CLIP does the same over each column, so every caption also picks out its image:

LCLIP = − 1⁄2B ∑i [ log ( esii/τ ⁄ ∑j esij/τ ) + log ( esii/τ ⁄ ∑j esji/τ ) ] τ is a learned temperature. The first term picks the right caption for each image. The second picks the right image for each caption.

CLIP trained this objective on 400 million image-text pairs collected from the web. ALIGN showed that the same idea tolerates much noisier data if there is more of it. It used about 1.8 billion alt-text pairs with only light filtering. The resulting image encoders transferred well to many tasks without task-specific training. They are also the direct ancestors of the encoders inside most VLMs today.

The sigmoid loss: score each pair on its own

The softmax couples every pair in the batch. To compute the loss for one image, you need its similarity to every caption. That makes the batch a single unit that must be gathered across all devices. SigLIP replaced the softmax with an independent yes-or-no decision for every cell of the matrix. The diagonal cells are positives. Every other cell is a negative.

LSigLIP = − 1⁄B ∑i ∑j log σ( zij · ( t sij + b ) ),    zij = +1 if i = j, otherwise −1 t is a learned scale and b a learned bias. Each cell is a separate binary classification, so cells can be computed in chunks on different devices.

Two practical consequences follow. First, the loss decomposes, so it can be computed chunk by chunk without gathering the whole matrix. Second, the paper reports that the sigmoid loss does better than the softmax loss at small batch sizes, and that the benefit of growing the batch fades quickly, with 32k being enough. SigLIP and its successor SigLIP 2 are now the default vision encoders in many open VLMs. Inside a Modern Vision Encoder compares these objectives in more depth.

Figure 1Softmax contrastive loss and sigmoid loss over the same batch

Figure 1. A batch of six images and six captions produces a 6 × 6 similarity matrix. CLIP normalizes each row and each column with a softmax, so every cell competes with the rest of its row and column. SigLIP scores every cell as an independent positive (diagonal) or negative (off-diagonal) decision. The matrix values here are illustrative.

Generative pretraining: describe the image

Contrastive learning produces an encoder that can tell which caption fits. It does not produce a model that can write a caption. A second line of work trained models to generate text from images directly.

It helps to separate two goals that this history mixes together. Representation learning asks for an encoder whose features are useful for many tasks. CLIP and SigLIP are representation learners. Generative multimodal modeling asks for a model that produces language conditioned on an image. A VLM is a generative model. It usually inherits a representation learner as its vision encoder, then has to learn the generative part.

The gap between the two models

Now return to the thought experiment and write it down precisely. An image I goes through the vision encoder fv and produces N feature vectors of width dv:

V = fv(I) ∈ ℝN × dv   →   Zv = g(V) ∈ ℝN′ × dLLM   →   LLM( [ Zv ; E(y) ] ) f_v is the vision encoder. g is the connector. E(y) are the language model's own embeddings of the text tokens y. N′ can differ from N if the connector merges or resamples tokens.

The language model normally receives a matrix E ∈ ℝn × dLLM, one row per text token, taken from its embedding table. The connector g turns the image features into rows of the same width. After that, the image rows and the text rows are simply concatenated into one sequence.

Matching dimensions is not matching meaning

A linear layer can always make the widths agree. That is a statement about shapes. It says nothing about whether the language model can use the result. The language model's later layers were trained on one distribution of inputs: the rows of its embedding table, mixed by its own attention layers. The output of a random connector lands somewhere else in that space.

Three mismatches matter in practice:

A related gap exists inside contrastive models themselves. Liang and colleagues showed that in CLIP's shared space, image vectors and text vectors occupy separate regions, even after training. They traced it to a "cone effect" at initialization that contrastive training then preserves. So "a shared embedding space" never meant "the same place in that space".

What it means for an image vector to become a token

The useful definition is functional. A visual vector has become a token the language model understands when the frozen or lightly tuned language model can use it to predict the right next words. If the caption says "a red bicycle", the image tokens should make "red" and "bicycle" more likely, in the right context.

Early experiments showed this target is closer than it sounds. Frozen trained a vision encoder so that its outputs, fed into a frozen language model, produced correct captions. ClipCap learned a mapping from a CLIP image vector to a short prefix for a frozen GPT-2. LiMBeR went further and showed that a single linear projection from a frozen image encoder into a frozen language model already transfers useful visual information. One explanation is that strong models trained on different modalities learn representations that are partly similar in structure. The Platonic Representation Hypothesis argues this convergence grows with scale.

So the first job of pretraining is modest. Train the connector until image vectors land where the language model can read them. The figure below shows that process in a two-dimensional sketch.

Figure 2Projected image vectors moving into the language model's embedding space

Figure 2. A two-dimensional sketch, not a measured projection. Orange points are text embeddings. Blue points are projected image patches. With a random connector the patches sit outside the region the language model knows, with the wrong scale. As connector training proceeds they move next to related words. The readout on the right shows the nearest word to one tracked patch at each stage. Aligned image tokens stay near related words without landing exactly on them. A small companion lab, which trained a connector between SigLIP and SmolLM2, did not see this movement: the image tokens stayed far from every word (best cosine 0.15 to 0.17, against 0.78 between real words) and grew to about 31 times a word's norm, yet the model learned to read them. See the code.

Aligning the connector is necessary but rarely sufficient. A connector-only model can name objects. It usually cannot read dense text, count reliably or follow a complex question. Those skills need the language model, and often the vision encoder, to change too. How much to change each part, and with what data, is where the main recipes differ.

Four recipes that shaped the field

Between 2022 and 2023, four training recipes set the patterns that most later models follow. Each one makes a different bet about which parts to train. We look at them in the order of how much of the pretrained models they are willing to change.

Flamingo: keep the language model frozen and add new layers

Flamingo froze both pretrained models. The vision encoder was an NFNet trained contrastively. The language model was Chinchilla. All learning happened in new layers placed between them.

Two new pieces did the work. A Perceiver Resampler turned a variable number of image features into a fixed set of 64 visual tokens. Then gated cross-attention layers were inserted between the frozen language-model blocks. Text tokens attend to the visual tokens through these layers. Each layer's output is multiplied by tanh(α), where α is a learned scalar initialized to zero.

That zero initialization is the key training detail. At step zero, every gate is closed. The model is exactly the original language model, so nothing about its language ability is disturbed. As training proceeds, the gates open only as far as visual information helps the loss.

Flamingo also introduced the data type that made it work: interleaved web pages, where images and text alternate in their natural order. Its M3W dataset held about 43 million web pages. It was mixed with three paired datasets: ALIGN with 1.8 billion image-text pairs, LTIP with 312 million pairs, and VTP with 27 million short videos. Training on interleaved pages taught the model to handle several images in one context. That is what gave Flamingo its few-shot ability: show a few examples of a task, then ask about a new image.

BLIP-2: freeze both models and learn a bottleneck

BLIP-2 also froze both the image encoder and the language model. Between them it trained a Q-Former, a small transformer with 32 learned query vectors and about 188 million parameters. The queries attend to the image features and produce a short, fixed-length summary.

Training happened in two stages. In the first stage, the Q-Former learned from the frozen image encoder alone, with three losses at once. An image-text contrastive loss (ITC) aligned query outputs with text. An image-text matching loss (ITM) classified whether a pair matched. An image-grounded text generation loss (ITG) trained the queries to support captioning. In the second stage, the Q-Former outputs were projected into a frozen language model and trained with the language-modeling loss.

The first stage matters for a subtle reason. It teaches the queries to extract language-relevant information before they ever meet the language model. The second stage then only has to translate that summary into the language model's input space. BLIP-2 pretrained on 129 million images.

LLaVA: project, then tune the language model

LLaVA used the simplest connector: a linear layer, later a two-layer MLP in LLaVA-1.5. Every image patch becomes one token. Training has two stages.

  1. Feature alignment. Freeze the vision encoder and the language model. Train only the projector on image-caption pairs. LLaVA used 595 thousand pairs filtered from CC3M. LLaVA-1.5 used 558 thousand.
  2. Visual instruction tuning. Keep the vision encoder frozen. Train the projector and the language model on instruction data: 158 thousand examples for LLaVA, a 665 thousand example mix for LLaVA-1.5.

The first stage is short and cheap. It exists to put image tokens in the right place before the language model starts changing. The second stage is where most capability appears. LLaVA-1.5 used CLIP ViT-L at 336 pixels, which gives 576 visual tokens per image.

The striking fact about LLaVA is its scale. Its pretraining used under a million examples. PaliGemma's authors put this in context: BLIP-2, InternVL, Qwen-VL and Idefics2 all ran multimodal pretraining for around a billion examples. LLaVA and its derivatives used around a million. The difference is a factor of a thousand. Both approaches produced useful models, which tells us that a strong language model already supplies much of what the VLM needs.

PaLI and PaliGemma: train everything together at scale

The PaLI line took the opposite position. Train jointly, on very large multilingual and multitask data, and let all parts adapt. Early PaLI versions still kept the image encoder frozen during the first multimodal stage. PaliGemma dropped that too. Its multimodal pretraining stage states plainly: "nothing is frozen".

Unfreezing the image encoder from the start creates a risk. At the beginning, the language model does not yet understand the image tokens, so the gradients it sends back to the encoder are close to noise. PaliGemma handled this with a slow linear warm-up of the image encoder's learning rate. The encoder is held nearly still while the rest of the model aligns, then allowed to adapt.

PaliGemma's Stage 1 trained at 224 pixels for 1 billion examples. Stage 2 raised the resolution: 50 million more examples at 448 pixels, then 10 million at 896 pixels. We return to this resolution schedule in the section on resolution curricula.

What later models changed

Later open models mostly combined these patterns rather than replacing them. Some typical moves:

Per-family details, including how each family changed from one version to the next, are collected in How the Open VLM Families Were Built. The figure below shows the stage structure of several recipes. Use the tabs to switch recipes.

Figure 3Which parts are frozen in each training stage

Figure 3. Each row is a component. Each column is a training stage. A filled orange cell means the component is trained in that stage. A blue outlined cell with a lock means it is frozen. Data volumes and resolutions are taken from each paper. Stages after pretraining are included in light type so the full sequence is visible.

Which components are trained

Every recipe above answers the same three questions. Is the vision encoder trained? Is the connector trained? Is the language model trained? The connector is almost always trained, because it starts from random weights. That leaves four common settings. Each one has a different goal.

Freezing patterns and what each one is for
Vision encoderConnectorLanguage modelGoalExamples
FrozenTrainedFrozenAlign the two spaces. Teach the connector to place image tokens where the language model can read them.LLaVA stage 1, LLaVA-OneVision stage 1, BLIP-2, Flamingo (new layers only)
FrozenTrainedTrainedAdapt the language side. The language model learns to use image tokens: answer questions, follow instructions, read.LLaVA stage 2, Qwen-VL stage 3, Prismatic
TrainedTrainedFrozenAdapt the vision side. The encoder learns features the fixed language model needs, such as text and fine detail.Qwen-VL stage 1, Qwen2-VL stage 1, InternVL 1.5 pretraining
TrainedTrainedTrainedJoint training. All parts co-adapt. Highest capacity and highest risk.PaliGemma, MM1, Molmo, Idefics2 (backbones with LoRA), Qwen2-VL stage 2

How to read this table: move down the rows and more of the pretrained weights are allowed to change. Recipes usually walk down the table over their stages, starting with the connector and ending with joint training.

Why freeze anything

Freezing has three benefits.

The cost of freezing is capacity. VILA measured this directly. Freezing the language model during pretraining gave "decent zero-shot performance" but the model lacked in-context learning. Getting that ability required unfreezing the language model.

Learning rates, warm-up and initialization

Recipes rarely treat "trained" as a single setting. Different parts get different learning rates. LLaVA-OneVision uses a vision encoder learning rate five times smaller than the language model's. PaliGemma ramps the image encoder's learning rate up slowly from zero. Molmo is the most explicit. It uses a learning rate of 2e-4 for the connector, 2e-5 for the language model and 6e-6 for the vision encoder, with a 200-step warm-up for the connector and 2,000 steps for the other two. All three choices express the same belief: the pretrained encoder is valuable, and it should move only after the rest of the model can send it meaningful gradients.

New parameters need careful initialization for the same reason. Flamingo's tanh gates start at zero, so the inserted layers begin as a no-op. A random MLP projector does not have that property. Its outputs are random vectors that the language model immediately attends to. That is one reason a connector-only alignment stage is common before the language model is unfrozen.

Stability

Idefics2 found a sharp edge when it unfroze the backbones. In a fully autoregressive architecture, where image tokens are fed straight into the language model, full unfreezing "can lead to training divergences". Training the backbones through LoRA adapters instead stabilized the run. It also cut the memory cost. How LoRA Changes a Model Without Rewriting It explains why a low-rank update limits how far the weights can move.

The same paper found that the best architecture depends on what is frozen. With frozen backbones, cross-attention architectures in the style of Flamingo did better. Once the backbones were trained, the fully autoregressive design did better. Architecture comparisons in this field are therefore only meaningful together with the freezing schedule.

Compute and memory

A common rule of thumb for mixed-precision Adam is about 16 bytes per trained parameter: 2 for the bf16 weights, 2 for the gradients, 4 for a float32 master copy and 8 for Adam's two moment estimates. A frozen parameter needs only its 2 bytes of bf16 weights. Inside a Training Step walks through where each byte goes. For a 7-billion-parameter language model, that is the difference between about 14 GB and about 112 GB before activations.

Compute behaves less intuitively than memory. Suppose only the connector is trained. The loss is computed at the language model's output. To reach the connector, the gradient still has to pass backward through every layer of the frozen language model. You skip the weight gradients of the language model, but you still pay for its activation gradients. Training a connector with a few million parameters therefore costs a large fraction of full training compute. The figure below lets you check this.

Figure 4Freeze or train: parameters, memory and compute

Figure 4. Toggle each component between frozen and trained, and choose the model sizes. Memory counts weights, gradients and Adam state at 16 bytes per trained parameter and 2 bytes per frozen parameter, and ignores activations. Compute assumes 576 image patches and 100 text tokens per example. It counts a forward pass of 2 FLOPs per parameter per token, plus 2 for activation gradients wherever the backward pass must travel, plus 2 for weight gradients in trained parts. These are rule-of-thumb estimates, not measurements.

Forgetting

Once the language model is trained on image-text data, it can lose some of its text-only ability. This is catastrophic forgetting, and the general mechanism is covered in Mixing Data Without Losing Capabilities. VILA found that text-only performance dropped after multimodal training. It also found a cheap fix: re-blending text-only instruction data into the fine-tuning mix "not only remedies the degradation of text-only tasks, but also boosts VLM task accuracy". DeepSeek-VL went further during pretraining and kept at least 70% language data. We return to these ratios in the mixture section.

What the data looks like

The recipe decides which weights change. The data decides what they learn. Multimodal pretraining data comes in a few distinct shapes. Each shape teaches a different skill, and each one turns into a token sequence in a different way.

Image-caption pairs

The simplest unit is a pair (I, C): one image and one caption. Web alt-text is the main source. LAION-5B released about 5.85 billion pairs filtered by CLIP similarity. COYO-700M released about 700 million. DataComp turned filtering into a benchmark: its CommonPool holds 12.8 billion candidate pairs, the model and training are fixed, and participants compete on the filter. Google's WebLI, used for PaLI, holds about 10 billion images.

Pairs teach the basic mapping from what is visible to what it is called. They are also short. A typical alt-text is a few words, so most of the sequence is image tokens and the loss is computed on very few text tokens.

Interleaved documents

An interleaved document keeps the web page's natural order: T1, I1, T2, I2, …. Text before an image gives it context. Text after an image often refers back to it. Flamingo's M3W was the first large example. Open versions followed: MMC4 has 101.2 million documents with 571 million images and 43 billion English tokens. OBELICS has 141 million web pages with 353 million images and 115 billion text tokens.

Interleaved data teaches two things pairs cannot. It teaches the model to keep several images in context and refer between them, which is the basis of few-shot learning. It also contains long stretches of ordinary text, which helps keep the language model's writing ability intact.

Text-only data

Some batches contain no images at all. Their job is to protect language ability, as we saw above. MM1 found that text-only data helps both few-shot and text-only performance.

Text in images: OCR, documents, screenshots, charts and tables

Natural photos rarely contain much text, and alt-text rarely transcribes it. Reading has to be taught with data built for it. Common sources include scanned business documents such as OCR-IDL, PDF pages such as PDFA, rendered text over varied fonts and backgrounds, web screenshots paired with their HTML, and charts or tables paired with their underlying data. Idefics2 used 19 million documents from OCR-IDL and 18 million pages from PDFA. MM1.5 added a continual pretraining stage with 45 million high-resolution OCR examples. Document understanding gets its own article in this series, How VLMs Read Documents.

Grounded data

Grounded data links words to regions. A phrase such as "the man on the left" comes with a bounding box, written as text tokens. Kosmos-2 built a large grounded corpus by linking noun phrases in captions to detected boxes. Florence-2 built FLD-5B, with 5.4 billion annotations on 126 million images, using a data engine of specialist models and iterative refinement. Qwen-VL included box coordinates as plain text in its multitask stage. Grounding is the topic of When Language Must Point.

Multiple images and video

Multi-image examples teach comparison and reference across images. Video adds time. Most VLMs treat a video as a sequence of sampled frames, often at reduced resolution so the token count stays manageable. Qwen2-VL, for example, limits each video to 16,384 tokens by adjusting frame resolution. Video gets its own treatment in Seeing in Time.

Synthetic data

Finally, much modern pretraining data is generated by models. A captioning model writes a detailed description for an image that only had a short alt-text. A rendering engine draws text, charts or tables with known content. A language model writes question-answer pairs about a document. Synthetic data is cheap and controllable. Its weakness is that it inherits the errors of the model that produced it. We return to that in the section on data quality.

Pretraining data types, with verified example datasets
TypeExample datasets and scaleWhat it mainly teachesTypical weakness
Caption pairsLAION-5B (about 5.85B pairs), COYO-700M, DataComp CommonPool (12.8B candidates), WebLI (about 10B images)Naming objects, scenes and attributesShort, noisy, often unrelated alt-text
InterleavedM3W (about 43M pages), MMC4 (101.2M docs, 571M images), OBELICS (141M pages, 353M images)Several images in context, few-shot learning, keeping language abilityMany images loosely related to nearby text
Text-onlyThe language model's own pretraining corpusProtects writing and reasoning in textTeaches nothing visual
OCR and documentsOCR-IDL, PDFA, rendered text, MM1.5's 45M OCR stageReading text, layout, documentsNeeds high resolution, so expensive per example
GroundedKosmos-2's grounded pairs, Florence-2's FLD-5B (5.4B annotations, 126M images)Linking words to regions, boxes, pointsBox quality depends on the detector that produced it
VideoFlamingo's VTP (27M short videos), video dialogue dataEvents and change over timeToken cost grows with every frame
Synthetic captionsShareGPT4V (1.2M), Recap-DataComp-1B (1.3B), PixMo-Cap (human, 712k images)Dense, specific descriptionsInherits the generator's hallucinations

How to read this table: the rows near the top are cheap and huge. The rows near the bottom are smaller and costlier, but each one teaches a skill the top rows barely touch.

How each type becomes a training sequence

All these types end up in the same format: one token sequence, with image tokens spliced in where the images go. What differs is which tokens carry a loss. Image tokens never do in the standard recipe, because the model is not asked to predict them. Text tokens usually do, except in instruction-style data, where the prompt is masked and only the answer is scored.

Figure 5Seven data types as token sequences, with the tokens that carry loss

Figure 5. Blue blocks are image tokens. Orange blocks are text tokens. A dark underline marks tokens that contribute to the loss. Token counts are drawn to scale within each row. The percentage at the right of each row shows how much of the sequence carries loss. It differs by more than an order of magnitude between data types.

Data engines, filtering and preprocessing

Raw web data is not training data. The pipelines that turn one into the other are less visible than the model, and they matter as much. Four steps recur across recipes.

Some teams go beyond filtering and build data engines: loops in which models label data, humans or stronger models check it, and the improved labels train the next model. Florence-2's FLD-5B came from such a loop. Synthetic recaptioning is the most common lightweight version. Idefics2 replaced LAION alt-text with model-written captions from LAION COCO and saw its average score rise from 49.8 to 52.9 in an ablation.

Mixing the data

A recipe never trains on one data type. It samples from several, with weights. Write the training distribution as a mixture:

D = λc Dcaptions + λi Dinterleaved + λo DOCR + λt Dtext + …,    ∑ λ = 1 Each λ is the probability that the next training example comes from that source.

The weights λ are among the most consequential choices in the recipe. They decide which skills receive gradient and which ones slowly decay. The general theory, including negative transfer between tasks and mixture laws, is in Mixing Data Without Losing Capabilities. Here we focus on what VLM papers found.

What the ablations show

MM1 ran the most systematic study of pretraining mixtures. Its lessons are short and worth quoting.

MM1's final mix was 45% interleaved documents, 45% caption pairs and 10% text-only, trained for about 400 billion tokens with nothing frozen. Other recipes chose very different ratios:

These numbers look inconsistent until you notice they answer different questions. DeepSeek-VL continued pretraining from an intermediate checkpoint of its language model, so the language data was still part of the language model's own training. InternVL3 started from a finished language model and counted only the multimodal stage. A ratio means little without the starting point and the token budget.

What happens when one type dominates

Two failure patterns are common enough to name.

Captions dominate. The model becomes a good describer. Ask it a specific question and it tends to describe the whole image anyway, or answer in caption style. Short alt-text also teaches short outputs. In-context learning stays weak, because single pairs never show several images in one context.

OCR dominates. The model reads well and transcribes well. It can lose ground on natural images, and it can become verbose in transcription style when the question asks for something else. OCR data also needs high resolution, so a large OCR share raises the cost of every batch.

A related failure appears later, in instruction data. Cambrian-1 named it the "answer machine phenomenon": trained on many short-answer VQA examples, the model answers everything in one word. It fixed this with system prompts that state the expected answer length. Cambrian also found that capping each source at about 250k–350k examples balanced its mixture best. The figure below is a toy model of these tradeoffs.

Figure 6Mixture weights and the capabilities they favor (toy model)

Toy model. The direction of each effect follows the findings of MM1, VILA and DeepSeek-VL. The magnitudes are invented for illustration and are not measurements.

Figure 6. Set the share of each data source, or pick a preset. The weights are normalized to sum to one. Each bar is a saturating function of the data that supports that capability, so the first few percent of a source help much more than the last few. The language bar starts at the base language model's level and decays as the text-only share shrinks. The thin black mark on each bar shows the MM1-style 45/45/10 mixture for reference.

What a visual token costs

Data choices have a cost that text-only pretraining never faced. An image does not have a fixed length. Its token count depends on its resolution and on how the model turns patches into tokens.

With patch size P, an image of height H and width W yields (H/P) × (W/P) patches. Many models then merge each r × r block of patches into one token:

Nv = (H / P) · (W / P) / r2    ∝    HW / P2 At 336 px with P = 14 and no merging, N_v = 24 × 24 = 576 tokens. At 448 px, 1,024 patches; a 2 × 2 merge brings that to 256 tokens.

The key fact is the square. Double the side length and the token count goes up four times. Inside a Modern Vision Encoder covers the mechanics of patching and merging. Here we follow the consequences for training.

Six things that move with resolution

Because each of these depends on resolution, resolution is also a data-mixture decision. Raising resolution for OCR data and keeping it low for captions changes how much compute each source receives, even if the sampling weights λ stay the same. Try it below.

Figure 7Resolution, visual tokens and training cost

Figure 7. Change the image size, patch size, token merging, caption length and language-model size. Visual tokens follow N_v = ⌈H/P⌉ · ⌈W/P⌉ / r², with the grid rounded up to a multiple of r. Language-model FLOPs use 6 × parameters × tokens and ignore attention and the vision encoder, so they are a lower bound. The bottom strip shows how many samples fit in one packed context.

This arithmetic is the starting point for compute-optimal choices about model size, data and resolution. Those are the subject of the next article, How Vision-Language Models Scale. Methods that cut the token count after the encoder, such as pooling, pixel shuffle and token pruning, are covered in The Cost of a Picture.

Resolution curricula

If high resolution is expensive, the obvious move is to use it only when it is needed. Most of what a VLM learns early is coarse: what objects are, what scenes look like, which words go with which things. Coarse knowledge does not need many pixels. Reading a footnote does.

Low resolution first, high resolution later

The classic curriculum starts small and grows. Three recipes show the pattern.

The logic is the same in all three. Most examples are seen at low cost. The expensive examples come at the end, when the model already knows what it is looking at and only needs to learn to read finer detail. PaliGemma's 896-pixel stage used one hundredth as many examples as its 224-pixel stage, but each example had sixteen times as many image tokens.

Raising resolution mid-training has a technical catch. A ViT with learned absolute position embeddings was trained on a fixed grid, such as 16 × 16. A larger image has a larger grid, so the position embeddings must be interpolated to the new size. The model then needs some training to adjust to the stretched positions. How Models Know Where They Are explains why relative schemes such as 2D RoPE make this easier.

Tiles, AnyRes and native resolution

A curriculum over a single square size still distorts many images. A tall receipt squashed into a square loses most of its text. Three families of methods keep more of the original image.

Native resolution changes the shape of the curriculum. Instead of a fixed size that grows by stage, the model sees a range of sizes from the start, usually with a cap on tokens per image. The curriculum then moves into the data: which images are allowed to be large, and how many tokens a batch may spend on them. Inside a Modern Vision Encoder compares these strategies in detail.

Figure 8One document page under four resolution strategies

Figure 8. A portrait page of about 1,000 × 1,300 pixels. A fixed 224-pixel square squashes it into 256 tokens and makes the text unreadable. A larger square at 336 pixels gives 576 tokens and is still distorted. Six 448-pixel tiles plus a thumbnail, with a 2 × 2 merge, give 1,792 tokens at the right aspect ratio. Native resolution with patch size 14 and a 2 × 2 merge gives 36 × 46 = 1,656 tokens. Packing then puts images of different sizes into one sequence. The tile count assumes at most six tiles; InternVL's default of up to 12 tiles gives 3,328 tokens for this page. Qwen2-VL rounds each side to the nearest multiple of 28, while Figure 7's formula rounds the grid up and would give 36 × 47 = 1,692.

Training objectives

So far we have treated the loss as given. It is worth stating each candidate precisely, because they send very different signals to different parts of the model.

Contrastive and matching losses

The contrastive loss from the first section aligns one pooled image vector with one pooled text vector. It gives one learning signal per image-text pair. Image-text matching (ITM) adds a binary classifier that reads the image and text together and decides whether they match. ALBEF and BLIP trained ITM on hard negatives: captions that are similar to the right one but wrong in a detail. That forces the model to look at fine-grained differences. BLIP-2 used both losses, together with a generation loss, to train its Q-Former.

The next-token loss

In a modern VLM, the main pretraining loss is the language model's ordinary next-token loss, computed on text that follows or surrounds an image:

LLM = − ∑t ∈ S log pθ( yt | Zv, y<t ) Z_v are the image tokens, y_<t is the text so far, and S is the set of scored text positions. Image positions are never in S.

The set S is a design choice. For a caption pair, S is the whole caption. For an instruction example, S is the answer only, and the question is masked, as described in Teaching a Language Model to Follow Instructions. PaliGemma ran an ablation on exactly this. It used a prefix-LM: image tokens and the task prefix attend to each other fully, and only the suffix is generated autoregressively. Scoring the prefix as well "clearly reduces average performance". Changing to a fully causal mask over the image and prefix also did worse.

This loss is dense in one sense and sparse in another. Every scored word gives a gradient, so a 200-word caption gives far more signal than a 5-word alt-text. But the gradient only reaches the image through attention. A patch receives signal only if some scored word needed it. A patch showing a detail that no caption mentions receives almost nothing.

Grounding as text

Detection and grounding could be trained with separate box-regression heads. Most VLMs instead write coordinates as text. Kosmos-2 added discrete location tokens. Qwen-VL wrote box coordinates as plain text inside special markers. PaliGemma added 1,024 location tokens for detection and segmentation. The same next-token loss then trains localization. It is an elegant trick. It also inherits the weakness of text: a box that is off by a few pixels costs the same as one that is off by half the image, if the tokens differ. When Language Must Point covers this tradeoff in depth.

Auxiliary vision objectives

Some recipes add a loss on the image side. AIMv2 pretrains its vision encoder with a decoder that predicts both image patches and caption tokens, so every patch receives a direct target. Early-fusion models such as Chameleon go further: they turn images into discrete tokens and put the loss on image tokens too, which lets one model both read and generate images. That direction is the subject of Models That See and Draw.

Figure 9Where each objective puts its learning signal

Figure 9. The contrastive loss compares one pooled vector per image, so every patch receives the same coarse signal. The next-token loss scores each caption word, and the gradient reaches only the patches those words attended to. Grounding tokens add signal at specific locations. An auxiliary patch loss gives every patch a target of its own. Shading on the patch grid shows how much signal each patch receives in each case; the pattern is illustrative. In a small companion lab with SigLIP and a SmolLM2 connector, the next-token gradient did not follow this picture: 95% of it landed on background patches, which cover 86% of the image.

Does the vision encoder need a visual signal of its own?

This is an open question, and the evidence points both ways.

On one side, language loss alone can clearly train a vision encoder. CapPa showed that captioning pretrains encoders about as well as contrastive learning. Qwen2-VL's first stage trains the vision encoder with the language model's loss on around 600 billion tokens. PaliGemma found that an unfrozen encoder trained through the language loss improved on spatial tasks.

On the other side, language loss teaches only what the text describes. Prismatic found that fusing DINOv2 features with SigLIP features gave "significant gains across the board". DINOv2 is trained with a purely visual self-supervised objective. Cambrian-1 built its connector, the Spatial Vision Aggregator, around combining several vision encoders for a similar reason. These gains suggest that self-supervised visual features carry information that a captioning-trained encoder misses.

A reasonable reading today: language supervision is sufficient for whatever the data talks about. Dense captions, OCR transcripts and grounding data widen what the data talks about. A purely visual signal remains useful for the rest, such as fine geometry and textures nobody names. Whether a VLM actually uses those features is a question for interpretability, discussed in What Happens Inside a VLM.

Data quality

Every objective above learns from text. That makes the quality of the text the ceiling on what the model can learn about images. Several distinct properties count as "quality" here.

Synthetic captions and their limits

The fastest way to improve specificity is to recaption. BLIP introduced CapFilt: a captioner writes new captions for web images, and a filter removes captions, original or synthetic, that do not match. ShareGPT4V collected 100 thousand detailed captions from GPT-4V, trained a captioner on them, and expanded the set to 1.2 million. Recap-DataComp-1B recaptioned 1.3 billion images with a LLaVA-1.5 model built on LLaMA-3-8B.

Synthetic captions are cheap and long. Their risk is hallucination: the captioner fills gaps with plausible details. A model trained on them learns that plausible details are acceptable. Hallucination and how alignment reduces it are the topic of Aligning Vision-Language Models.

Case study: PixMo and human-spoken captions

Molmo's PixMo data took the opposite route. Instead of asking a model, it asked people, and it asked them to speak. Annotators described each image aloud for 60 to 90 seconds. The recordings were transcribed and turned into captions. The result was 712 thousand images with 1.3 million transcripts and captions, averaging 196 words, collected "without the use of external VLMs".

Speaking was a deliberate choice. People say more in 60 seconds than they type, and they describe what they see rather than writing a polished paragraph. Typed human captions tend to be short. Speech gets length and detail from humans without paying for typing. Avoiding external VLMs also means the data does not quietly distill a proprietary model's errors.

Molmo then pretrained all parameters on this caption data, with no separate alignment stage, and fine-tuned on a mix of PixMo and academic datasets. Its captions came with a length hint in the prompt 90% of the time, which its paper reports improved caption and pretraining quality. DOCCI made a similar bet at smaller scale, with long human-written descriptions designed to distinguish visually similar images.

Figure 10Four captions for the same image

Figure 10. An illustrated scene with four captions. Alt-text names a file. A web caption names the place. A synthetic dense caption adds detail but invents two objects, marked in red. A spoken human description is long and specific, and each phrase links to a region. Green outlines show the regions a caption phrase is grounded in. The captions are written for illustration.

Real recipes side by side

We now have the vocabulary to compare recipes along every aspect this article introduced. The first table lists concrete models. All numbers come from the papers cited in the references. Cells say "not reported" where a paper does not give the value.

Pretraining recipes of influential VLMs
ModelVision encoderBridgeWhat was frozenPretraining dataStagesResolution
Flamingo (2022)NFNet-F6, contrastivePerceiver Resampler (64 tokens) + gated cross-attentionVision encoder and language model frozen; new layers trainedM3W 43M pages, ALIGN 1.8B pairs, LTIP 312M pairs, VTP 27M videosOneFixed
BLIP-2 (2023)Frozen CLIP-style ViTQ-Former, 32 queries, 188M paramsVision encoder and language model frozen in both stages129M imagesTwo: representation, then generativeFixed
LLaVA-1.5 (2023)CLIP ViT-L/142-layer MLP, 576 tokensStage 1: all but MLP. Stage 2: vision encoder558K caption pairs; 665K instruction mixTwo336 px
Qwen-VL (2023)OpenCLIP ViT-bigG1-layer cross-attention, 256 queriesStage 1: LLM. Stage 2: none. Stage 3: vision encoderAbout 1.4B pairs in stage 1; multitask data in stage 2Three224 → 448 px
MM1 (2024)ViT-H, CLIP on DFN-5BC-Abstractor, 144 tokensNothing frozen in pretraining45% interleaved, 45% pairs, 10% text; about 400B tokensOne pretraining stage378 px
InternVL 1.5 (2024)InternViT-6BPixel shuffle + MLP, 256 tokens per tilePretraining: LLM frozen. Fine-tuning: noneNot reported as a single totalTwo448 px tiles, 1–12 in training
Idefics2 (2024)SigLIP-So400mPerceiver pooling, 64 tokensNothing frozen; backbones trained with LoRAOBELICS, LAION COCO captions, OCR-IDL, PDFA, rendered textTwoUp to 384 → up to 980 px, aspect kept
PaliGemma (2024)SigLIP-So400mLinear projectionNothing frozen; slow LR warm-up for the encoderMultitask mixture; 1B examples, then 50M, then 10MThree (Stage 0 is unimodal)224 → 448 → 896 px
Qwen2-VL (2024)675M ViTMLP after 2×2 mergeStage 1: all but ViT. Stage 2: noneAbout 600B + 800B tokensTwo pretraining + instructionNative, dynamic
Qwen2.5-VL (2025)ViT with window attentionMLP after 2×2 mergeStage 1: all but ViT. Later: none1.5T + 2T + 0.6T tokensThree pretraining + post-trainingNative, dynamic
LLaVA-OneVision (2024)SigLIP-So400m2-layer MLPStage 1: all but projector. Later: none; encoder LR 5× lower558K, then 4M knowledge data, then 3.2M + 1.6MThree (1, 1.5, 2)AnyResMax-9 tiles
Molmo (2024)CLIP ViT-L/14, 336 pxAttention pooling over 2×2 + MLPNothing frozen; separate learning ratesPixMo-Cap: 712K images, 1.3M captionsTwo: captions, then fine-tuningOverlapping multi-crop

How to read this table: read down the "What was frozen" column. Early recipes froze large parts of the model. Since 2024, most recipes train everything, and protect the pretrained parts with lower learning rates, warm-up or LoRA instead of freezing. Meanwhile the data column grew from millions of pairs to trillions of tokens, and the resolution column moved from fixed squares to native sizes.

The second table compares the recipe families along the aspects from each section: what is trained, how much data each needs, how language is protected, what it costs and what tends to go wrong.

Recipe families compared along the aspects of this article
ApproachWhat is trainedData neededProtecting languageTraining costResolution handlingMain riskExamples
Frozen LM, new cross-attentionResampler and inserted layersLarge interleaved and paired corporaAutomatic: LM weights never change; zero-init gatesModerate: backward through LM layers, no LM weight updatesFixed tokens per image via resamplerLimited capacity; weaker detail and readingFlamingo
Frozen backbones, learned bottleneckQ-Former and projectionAbout 100M+ images, two stagesAutomaticLow: small trainable moduleFixed, short summary (32 queries)Bottleneck drops fine detail and textBLIP-2
Projector, then tune LMProjector first, then projector + LMSmall: under 1M pairs plus instruction dataText-only data mixed into tuningLow, but LM tuning stage is full costFixed square, later tiles (AnyRes)Forgetting; shallow visual knowledgeLLaVA, LLaVA-1.5, LLaVA-OneVision
Vision side first, then allViT + adapter with LM frozen, then everythingVery large: billions of pairs or trillions of tokensLM frozen during the noisiest stageHighLow to high, or native dynamicCost; encoder drift if LR too highQwen-VL, Qwen2-VL, Qwen2.5-VL, InternVL 1.5
Joint from the startEverything, with per-part LR, warm-up or LoRALarge and mixed, or small and very denseText-only share in the mixtureHigh per stepCurriculum over size, or nativeEarly divergence; forgetting without text dataPaliGemma, MM1, Idefics2, Molmo, Prismatic
Native multimodal pretrainingEverything, one stage with textMultimodal and text corpora togetherBy construction: language and vision learned togetherHighestNative or tilesRatio tuning is expensive to searchInternVL3; early-fusion models such as Chameleon

How to read this table: each row moves further from "keep the pretrained models intact" toward "train one model". Read across a row and the costs and risks rise together with capacity. The rows toward the bottom need more data, more compute and more care, and they are where most recent open models sit.

Architecture or data

We can now return to the opening question. You have a good vision encoder and a good language model. Why can't you just connect them? Because connecting them only matches shapes. Making the image vectors mean something to the language model is a training problem. It needs an alignment signal, a schedule for which weights may move, a data mixture that teaches each skill without erasing others, a resolution budget that matches the data, and text good enough to describe what the model should see.

Is a good VLM then mainly an architecture problem or a data and curriculum problem? The evidence leans toward data and curriculum, within a sensible architecture.

Architecture still matters, in a specific way. It decides what each visual token costs and how many tokens each image gets. Native resolution, token merging and tiling change the cost of high-resolution data, and so change which data mixtures are affordable. Some architectures also differ in kind: Fuyu fed image patches straight into the decoder with no separate encoder, and NVLM compared decoder-only, cross-attention and hybrid designs under one training recipe. But the recurring lesson of the ablations is that architecture choices show up mainly through their effect on data and compute.

That conclusion sets up the next two questions. First, at a fixed compute budget, how should you split it between model size, data and resolution? That is the subject of How Vision-Language Models Scale. Second, pretraining gives a model that sees. It does not yet give a model that answers questions, follows instructions and handles many visual tasks at once. That is post-training, the subject of One Model, Many Visual Skills.

Key insights and nuances

References

Grouped by topic. Every entry links to its primary source.

Bridging frozen models and the modality gap