A vision-language model (VLM) cuts an image into patches, encodes each patch as a vector, and a small connector turns those vectors into image tokens of the language model’s width that sit in the sequence like words. Every design choice is about those tokens: how many, cut from which pixels, at which positions, and trained to mean what; each one costs context, cache and time like any other token.
Fig. 1: one 512 × 512 photo becomes 1,088 image tokens in SmolVLM and 256 in Qwen3.5
pixel_values.You need: what a vision transformer, CLIP and SigLIP produce (Vision encoders), how a decoder reads a sequence and why it caches keys and values (The transformer from zero), and RoPE (Positional Encodings). Besides SmolVLM, the small VLM the whole topic measures, this page runs a second model, Qwen3.5-0.8B (Apache 2.0, 1.75 GB in bfloat16), chosen because it differs from SmolVLM exactly where this page teaches: native resolution instead of tiles, 3-D positions instead of 1-D, trained to output boxes and read video, and a hybrid language model whose cache grows in only 6 of 24 layers.
Labels: measured = run for this page on an Apple M1 Pro (PyTorch MPS, bfloat16, greedy decoding, 2026-10-17); paper = stated by the cited authors; vendor = a model card or blog; derived = arithmetic on these, formula shown. Two small models on synthetic images are a probe, not a benchmark: one question is several percentage points. The 3D figures turn when dragged and play by themselves once in view; any control stops them.
The encoder gives a grid of vectors: 576 vectors of 1,024 numbers for LLaVA-1.5’s CLIP ViT-L at 336 pixels, or 1,024 vectors of 768 numbers per 512-pixel tile for SmolVLM. The language model expects tokens of its own width (4,096 numbers for a 7B Llama, 960 for SmolVLM’s, 1,024 for Qwen3.5-0.8B’s) and pays for every token it reads. A connector must make the vectors readable (in the language model’s space), few (cheap) and faithful (small text and positions survive); the five designs trade those three.
Fig. 2: same photo, five connectors; only the merge decides how many tokens the language model pays for
One square is one token of the language model’s width, the same size in every step. Grids and counts come from each model’s configuration or paper; SmolVLM’s and Qwen3.5’s are measured on the same 512 × 512 photo, whose views are the processors’ own.
Projector (LLaVA): the trade-off. The cheapest connector to train (LLaVA’s first stage trains only it) and the most faithful, since every patch keeps its own token; but the token count is the patch count, so resolution is paid for quadratically. LLaVA-1.5 reads the encoder’s second-to-last block and drops the [CLS] token (the Vision encoders page measures why a late, not last, layer is better). Right when images are few and small.
Query transformer (BLIP-2’s Q-Former). A fixed set of learned queries (parameters, the same for every image) attend to the frozen encoder’s features: 32 output vectors of 768 against 257 × 1,024 frozen features for ViT-L/14. Thirty-two tokens whatever the image is cheap, but the paper itself calls it “an information bottleneck between the frozen image encoder and the frozen LLM”: fine text, counts and positions must squeeze through, and the Q-Former needs its own pretraining stage (section 6). It suits a frozen language model and a tight budget, not documents.
Resampler and gated cross-attention (Flamingo). A Perceiver Resampler turns however many features into 64 visual outputs; new gated cross-attention blocks between frozen language-model layers read them, each output multiplied by tanh(α) with α initialised to 0, so training starts exactly at the frozen language model. Context stays free (many images or long video cost no sequence length); the price is new layers and an architecture serving stacks support less well. Who attends to whom under cross-attention and under a projector, as attention masks beside eight other designs: section 6 of Native multimodal and any-to-any models.
Merging neighbours (pixel shuffle, patch merger). Lay each block of neighbouring patch vectors side by side into one longer vector, then project: nothing is averaged away, and the projector learns to read several positions out of one vector. InternVL 1.5 cuts tokens to a quarter (a 448 × 448 tile becomes 256 tokens); SmolVLM merges 4 × 4 = 16 (1,024 to 64 per tile); Qwen2-VL merges 2 × 2 with an MLP, so a 224 × 224 image is (224 / 14)² / 4 = 64 tokens plus start and end markers, the paper’s “66 tokens” derived. A fixed compression with no extra stage, combined with tiling or native resolution: today’s default. SmolVLM’s paper reports that “smaller VLMs benefit from more aggressive compression (r=4)”; section 8 measures what happens when tokens are merged further without retraining.
| Design | How the image gets in | Tokens per image | Example |
|---|---|---|---|
| Projector | each patch vector mapped to the language model’s width by a linear layer or a 2-layer MLP; nothing merged | 576 (one 336-pixel view, 24 × 24 patches of 14) derived | LLaVA-1.5 (Liu et al., 2023) |
| Query transformer | 32 learned queries read the patches through cross-attention; their outputs are projected and prepended | 32 paper | BLIP-2 (Li et al., 2023) |
| Resampler + cross-attention | 64 learned latents summarise the features; new gated cross-attention layers inside a frozen language model read them; the image never enters the sequence | 64 per image, outside the context paper | Flamingo (Alayrac et al., 2022) |
| Merge neighbours, tile | 4 or 16 neighbouring patch vectors laid side by side into one (pixel shuffle), then projected; large images cut into tiles plus a thumbnail | 256 per 448-pixel tile, 1 to 12 tiles (InternVL 1.5); 64 per 512-pixel tile, 1,088 for any square (SmolVLM) | InternVL 1.5 (Chen et al., 2024), SmolVLM |
| Native resolution | the image resized only to a multiple of 32 pixels; 2 × 2 neighbours merged by an MLP; positions in 3-D (time, row, column) | one per 32 × 32 pixels: 256 for 512 × 512, 4,096 for 2,048 × 2,048 measured | Qwen2-VL onward (Wang et al., 2024), Qwen3.5 |
Idefics2 (Laurençon et al., May 2024, section 3.2 and Table 3) paper: same backbones, same data, same updates; average score over its benchmarks.
| Architecture | Backbones | Avg. score |
|---|---|---|
| Tokens in the sequence, no resampler | frozen | 51.8 |
| Tokens in the sequence, with resampler | frozen | 60.3 |
| Cross-attention | frozen | 66.7 |
| Cross-attention | LoRA | 67.3 |
| Tokens in the sequence, with resampler | LoRA | 69.5 |
With frozen backbones cross-attention wins; with LoRA (full unfreezing “would yield loss divergences”) tokens in the sequence win, “even though the latter has more parameters”. That is why almost every open VLM since 2024 puts image tokens in the sequence. The same paper’s learned resampler adds 8.5 points (60.3 − 51.8) while cutting tokens “from 729 to 64”, with “no gains when using more than 64 visual tokens” (Table 4: 71.2 at 128, 71.7 at 64).
The Vision encoders page found that SigLIP 2 B/16 at 224 pixels has a few patch tokens with 15 to 22 times the median norm at fixed grid positions in every image (the “high-norm tokens” registers were invented to absorb). A VLM passes every patch to its connector, so such tokens would be a fixed tax on every image. Measured with the same statistic (the last block’s output before the final LayerNorm, each patch’s norm over the median of its view), one dot per test image measured:
Outliers are a property of how an encoder was trained, not of vision transformers as such. A connector that merges neighbours carries them into tokens, so check your own encoder with this one statistic before adding registers or dropping tokens by norm. The What the model saw tab shades every token by this ratio.
An encoder trained on 224 or 384-pixel squares sees a phone screenshot or an A4 page squashed into that square: thin text vanishes and the aspect ratio is wrong. One token per patch at full size fixes it at a cost that grows with the pixel count. Four answers have been used, in this order. Fig. 3 walks one photo through the two this page runs; the table after it shows what each does to a 1,920 × 1,080 screenshot.
Fig. 3: same 3:2 photo; SmolVLM stretches it into tiles, Qwen3.5 keeps its shape
Both models’ real processors measured; the views are decoded back from the pixel_values they produced. SmolVLM: stretched to 2,048 × 1,536, 12 tiles + a global view = 832 tokens; Qwen3.5: 640 × 416, shape kept, 260 tokens.
| Approach | What happens to a 1,920 × 1,080 screenshot | Source |
|---|---|---|
| Fixed square | squashed to 336 × 336: 576 tokens, aspect ratio lost | LLaVA-1.5 (config: image size 336, patch 14) |
| A few grids (AnyRes) | best of 2 × 2, 1 × {2, 3, 4}, {2, 3, 4} × 1 tiles of 336 plus a downscaled view; “up to 672x672, 336x1344, 1344x336” | LLaVA-NeXT (blog, 30 January 2024) vendor |
| Dynamic tiling | the closest of “35 possible combinations of aspect ratios formed by 1 to 12 tiles” of 448 pixels, plus a 448 thumbnail: here 8 tiles (4 × 2) + 1 = 9 views, 2,304 tokens measured with the processor | InternVL 1.5 (section 3.3) paper; InternVL3-1B-hf processor |
| Fixed tiles, long side first | long side scaled to 2,048, short side rounded up to whole 512 tiles (stretched by a third): 12 tiles + global = 832 tokens | SmolVLM processor, measured (root VLM lab recordings) |
| Native resolution | kept at 1,920 × 1,088 (both sides rounded to multiples of 32): 68 × 120 patches, 2,040 tokens measured with the processor | Qwen2-VL “Naive Dynamic Resolution” (section 2.1); Qwen3.5-0.8B processor |
How native resolution works: three changes. (1) The image is resized only until both sides are multiples of the merged patch (32 pixels for Qwen3.5: 16-pixel patches, 2 × 2 merge), with its pixel count kept between a minimum and a maximum (Qwen3.5’s processor: 65,536 to 16,777,216 pixels, that is 64 to 16,384 tokens); the rule is smart_resize (transformers v5.20.1, models/qwen2_vl/image_processing_qwen2_vl.py line 63), ported in the Token budget tab and checked against the processor on 24 sizes. (2) The encoder’s fixed position table is replaced or supplemented by 2-D RoPE (rotation by row and by column), so any grid is legal: Qwen2-VL “modified ViT by removing the original absolute position embeddings and introducing 2D-RoPE” paper. (3) The language model is told where each token sat, through 3-D positions (2a below).
What the budgets do to answers measured. On the root’s 30 questions SmolVLM gets 24 at 64, 26 at 320, 26 at 1,088 image tokens. Qwen3.5 gets 23 at 64, 24 at 256, 27 at 1,024 when a sentence such as “There are 3 red circles” counts as the number, but only 21, 21, 22 under the root lab’s strict rule, because it often ignores “Answer with a number” and writes a sentence: one score measures seeing, the other following the format. More tokens helped Qwen3.5 most on counting shapes; at 64 tokens it also fell for the typographic attack (“dog” for the cat with a DOG sticker); the clock, the sum of the bars and the astronaut’s missing horse fail at every budget (SmolVLM fails the clock and the sum too). Every answer is in out/qa_scored.json.
Square images of every size through the real processors measured: SmolVLM (default N = 4) rescales every image to 2,048 first, so its count does not move; Qwen3.5 (default limits) grows with the pixel count up to its 16,384-token cap; InternVL3-1B (256 tokens per 448 tile plus a thumbnail) steps with the tile grid; LLaVA-1.5 is 576 always.
A language model with RoPE gives each token one integer position. SmolVLM’s does exactly that for image tokens (positions k, k+1, ...), so the token below a given one is 8 positions away inside a tile, and rows and columns survive only through the <row_r_col_c> text tags the processor inserts. M-RoPE (the rotary mechanism is on Positional Encodings) splits the rotary dimensions into time, row and column groups: text tokens get the same value in all three (ordinary RoPE), image tokens keep the time fixed and get their row and column, and the next text starts at the largest image position plus one.
Qwen3.5 reads the 512 × 512 cat as 16 × 16 tokens starting at position 4, measured with the model’s own get_rope_index measured: (t, h, w) runs from (4, 4, 4) to (4, 19, 19) and the next text token gets (20, 20, 20); the whole 277-token prompt ends at position 36, where 1-D positions would end at 276.
Qwen2-VL: “For text inputs, these components utilize identical position IDs, making M-RoPE functionally equivalent to 1D-RoPE”; for an image “the temporal IDs of each visual token remain constant, while distinct IDs are assigned to the height and width components”; the next modality starts at “the maximum position ID of the preceding modality” plus one (section 2.1) paper. Qwen3-VL keeps the three groups but interleaves them across the frequency bands, because “chunking the embedding dimensions into temporal (t), horizontal (h), and vertical (w) groups induces an imbalanced frequency spectrum” (Qwen3-VL Technical Report, section 1) paper; Qwen3.5-0.8B’s config says "mrope_interleaved": true, "mrope_section": [11, 11, 10].
To check: open the What the model saw tab and click any token of any image to read its position, 1-D for SmolVLM and (t, h, w) for Qwen3.5, as the models’ own code computes them (get_rope_index in models/qwen3_5/modeling_qwen3_5.py, line 1364).
Reading text (OCR, optical character recognition) is where the resolution budget shows first. A character must cover enough pixels, after every resize the processor does, for 14 or 16-pixel patches to tell an 8 from a B; after merging, several characters share one token. A model can describe a photo well from 64 tokens and still be unable to read a receipt.
The test measured: 21 synthetic 1,024 × 1,024 pages, each with one random 6-character code (no 0/O or 1/I, no words, so the language model cannot guess) at 7 font sizes, from 5 to 32 pixels tall for capitals, each read at three token budgets per model; “What is the 6-character code written in the image? Answer with the code only.” Scored by exact match and character error rate (CER: edits needed to turn the answer into the code, over 6).
Fig. 4: one 20-pixel code (14-pixel capitals) at the scale each setting gives the page
The crop is the page’s 256 × 128 pixels around the code at 1:1, resampled in the browser at each setting’s scale (the scale is exact; the interpolation only approximates the processor’s). Answers and counts measured.
Why the budgets behave this way. At SmolVLM’s 64-token setting the page is shrunk to 512, so a 9-pixel capital becomes 4.5 pixels, under a third of a 16-pixel patch, and each token covers 64 × 64 pixels of the shrunk page derived: 16-pixel patches × 4 × 4 merge. At its default setting the page is enlarged to 2,048 and cut into 16 tiles. Qwen3.5 at 1,024 tokens sees the page at its own size, one token per 32 × 32 pixels. Equal token budgets can give different legibility: tiles enlarge, native resolution does not. So SmolVLM at 64 tokens still reads 20-pixel text almost as well as at 1,088 (mean CER 0.22 against 0.11), because its single view keeps 512 pixels where Qwen3.5’s 64-token budget keeps 256; and Qwen3.5 at 64 tokens reads nothing below 28 px, answering “000000”, “666666” or invented strings of the right length.
The crops show each font size at 1:1.
Codes read exactly, of 21: SmolVLM 5 at 64, 7 at 320, 8 at 1,088 tokens; Qwen3.5 3 at 64, 9 at 256, 12 at 1,024 tokens. Greedy decoding, 3 codes per cell, so each cell is a probe, not a rate.
Smallest font from which at least 2 of 3 codes are read exactly at every larger size: SmolVLM 28 px (19 px capitals) at 1,088 tokens; Qwen3.5 20 px (14 px capitals) at 256 and none at 1,024, because Qwen3.5 at 1,024 tokens fails the largest text (0 of 3 at 40 px, answering “600000”) while reading it at 64 and 256: a 152-pixel-wide code on a 1,024-pixel page at full resolution is a case its training apparently covered less. More tokens are not monotonically better measured.
Model cards lead with OCR benchmarks because documents, charts, screenshots and GUIs are where VLMs are bought: Qwen3.5-0.8B’s card gives OCRBench 74.5 / 79.1 (thinking / non-thinking) and OmniDocBench1.5 61.0 / 70.6 (Qwen3.5-0.8B card, read 2026-10-17) vendor. What those benchmarks measure is on Long-context and multimodal benchmarks; turning PDFs into text for retrieval, where a VLM is one option among layout parsers and OCR engines, is on Document ingestion and multimodal retrieval.
How to check it on your documents. Render a page at the resolution your users send, count tokens with the processor, and test the smallest text that matters at two or three budgets; a code with no words and no prior separates seeing from guessing.
Grounding ties words to places: “where is the red circle?” answered with a bounding box (left, top, right, bottom). A language model answers in text, so boxes are numbers in text, and the model and the code that draws the box must agree on what the numbers mean. Qwen’s own models changed that meaning twice:
| Model | Box coordinates in the text | Source |
|---|---|---|
| Qwen2-VL | “normalized within [0, 1000)”, written “(Xtop left, Ytop left),(Xbottom right, Ybottom right)” between box tokens | section 2.2.1 paper |
| Qwen2.5-VL | “Unlike traditional approaches that normalize coordinates, our model directly uses the actual dimensions of the input image”: pixels of the image as resized by the processor | section 2.1.2 paper |
| Qwen3-VL | “Different from Qwen2.5-VL, we adopt a normalized coordinate system scaled to the range [0,1000]” | section 3.2.4 paper |
| Qwen3.5-0.8B | not stated in the card; measured below: pixels | this page |
The test measured: 12 synthetic scenes in four shapes (640 × 480, 480 × 640, 800 × 400, 512 × 512), each with two of a red circle, a blue square and a green triangle, exact boxes known; prompt Locate the <shape> in the image. Report its bounding box as JSON: {"bbox_2d": [x1, y1, x2, y2]}. The same raw answers are scored under three readings of the numbers: 0 to 1,000 of the image, pixels of the resized image the encoder saw, and pixels of the original. IoU (intersection over union) is the overlap of predicted and true box over their union: 1 is perfect, above 0.5 the usual “correct”.
Fig. 5: the same four numbers, read three ways
Qwen3.5 writes boxes in pixels, not on Qwen3-VL’s 0 to 1,000 scale measured: mean IoU over the 24 boxes is 0.49 read as resized-image pixels, 0.49 as original pixels and 0.06 as 0 to 1,000; 11 of 24 boxes reach IoU 0.5 under the best reading. The two pixel readings differ only on the 800 × 400 scenes (the processor makes them 800 × 384), and there the resized reading fits better: the Qwen2.5-VL convention. The misses are mostly a right edge or bottom far too large (a blue square of 143 pixels reported 650 wide). SmolVLM writes boxes that mean nothing: all 24 answers are tiny boxes at the origin such as {"bbox_2d": [0, 0, 2, 2]}, IoU 0 under every reading; its training data did not teach it boxes.
How to check it. Draw a model’s boxes on two or three images of different aspect ratios under each documented convention: the right one lines up on all of them, and a wrong one fails worst on non-square images. When the processor resized the image, keep its output size (image_grid_thw × patch size) next to the answer.
A minute of video at 30 frames per second is 1,800 images; even at 256 tokens each that is 460,800 tokens derived. Video VLMs sample a few frames per second, merge pairs of frames into one token, and cap the total. Qwen2-VL samples “two frames per second”; its patch embedding is a 3-D convolution of depth 2 over consecutive frames (“3D tubes instead of 2D patches”; a still image is “treated as two identical frames”), and training capped “the total number of tokens per video to 16384” (section 2.1) paper. Time positions moved from frame counting (Qwen2-VL) to absolute time inside M-RoPE (Qwen2.5-VL) to plain text: Qwen3-VL prefixes each temporal patch with “a timestamp expressed as a formatted text string”, such as “<3.0 seconds>” (Qwen3-VL report, section 2.3) paper.
Qwen3.5’s processor does the same. The real prompt for one 4-second clip sampled at 2 frames per second, timestamps <0.2 seconds> to <3.5 seconds>, each run of 80 video tokens written “x80” measured:
Token arithmetic derived: tokens per second = (frames sampled per second / 2) × (height / 32) × (width / 32), plus a few timestamp tokens per pair of frames. A 320 × 240 clip at 2 frames per second costs 80 tokens per second; a 1,280 × 720 clip costs 720, because the processor caps each frame at 768 tokens and shrinks the frames to 1,152 × 640 measured with the processor. The Token budget tab computes any case.
The test measured: 8 synthetic clips (16 frames, 4 seconds) of a red or blue dot crossing the frame in one of four directions, asked which way it moves; as a control, the same question about the first frame alone.
Fig. 6: one 4-second clip becomes 320 video tokens with its times written as text
video_grid_thw [4, 16, 20]).Qwen3.5 got the direction right in 0 of 8 clips; in 7 it named exactly the opposite direction. Each clip is 320 video tokens (4 temporal patches of 80), 400 prompt tokens in all. The one-frame control got 4 of 8, all horizontal: with the dot near one edge, “it moves away from that edge” is a good guess. The processor keeps the frames in order (decoding the dot from pixel_values_videos, it moves from x = 40 to 248 in the left-to-right clip), so the reversal is the model’s. A 0.8B model on synthetic dots is a narrow probe (the vendor reports VideoMME 63.8, thinking, with subtitles vendor), but direction of motion is what a video model must not get backwards, and checking it costs 16 frames.
A VLM joins two pretrained parts that have never met through a randomly initialised connector. Training everything at once lets the random connector send noise into a good language model; training too little leaves the image tokens unreadable. Every recipe answers which parts train in which stage, on what data, and for how long:
The pattern. A short alignment stage with only the connector training survives everywhere (LLaVA’s stage 1, Qwen3-VL’s S0); after it, recent recipes train everything, the encoder included, on a trillion tokens or more, with text-only data mixed in so the language model does not forget. Image-caption pairs teach what is in an image; interleaved web pages teach several images in context; OCR, chart, document and grounding data teach reading and pointing; instruction and conversation data teach answering. The loss is on text tokens only: the model never predicts image tokens (that is Native multimodal and any-to-any models).
Freeze or train the encoder? Freezing saves memory (no optimiser state for it) and protects features learned from billions of pairs; training lets the encoder learn what the language model needs (small text, positions, the processor’s tiles). Idefics2 found that adapting the backbones with LoRA beat freezing them by 9.2 points in its own table (section 1), and the recipes that train the encoder do so after an alignment stage, usually at a lower learning rate. The weights show it happened in SmolVLM: its encoder moved 0.23 to 0.37 of its norm away from the public SigLIP checkpoint it started from (below).
One row per published recipe, one column per stage; E encoder, C connector, L language model paper. “Not stated” means the paper’s text does not say for that part; BLIP-2’s first stage has no language model at all; Qwen3-VL’s S2 and S3 then extend the context to 32,768 and 262,144 tokens; SmolVLM’s two stages (“(1) a vision stage, and (2) a video stage”) are left out because the passages read do not say what is frozen.
| Model | Stages and what trains | Data and compute stated |
|---|---|---|
| LLaVA-1.5 (2023) | 1: projector only; 2: projector and language model; encoder frozen throughout | 558K captions, 665K instructions, “~1 day on a single 8-A100 node” (paper) |
| BLIP-2 (2023) | 1: Q-Former against the frozen encoder with three losses (contrastive, matching, captioning); 2: Q-Former and projection against the frozen language model; both backbones never train | 129M images; largest model “less than 6 days for the first stage and less than 3 days for the second stage” on “a single 16-A100(40G) machine” (section 3.4) |
| Qwen2-VL (2024) | 1: “exclusively on training the Vision Transformer”; 2: “unfreeze all parameters”; 3: “lock the ViT parameters” and instruction-tune the language model | about 600B tokens then 800B more of image-related data, “a cumulative total of 1.4 trillion tokens”, loss on text tokens only (section 2.2) |
| InternVL 1.5 (2024) | 1: encoder (6B) and MLP projector; 2: “the entire model’s 26 billion parameters” | public datasets listed in its Table 1 (section 4.1) |
| Idefics2 (2024) | new parameters fully trained, backbones adapted with LoRA (full unfreezing diverged); instruction tuning with DoRA | interleaved web documents (OBELICS) and image-caption pairs, then PDFs at up to 980 pixels (sections 3.2 and 4.1) |
| Qwen3-VL (2025) | S0: “only the parameters of the MLP merger are trained”; S1: “unfreeze all model components”; S2 and S3: longer contexts (32,768, then 262,144) | S0 about 67B tokens, S1 about 1T tokens mixing vision-language and text-only data (section 3.1) |
| SmolVLM (2025) | “two stages: (1) a vision stage, and (2) a video stage”; which parts are frozen is not stated in the passages read (root lab) | the video stage keeps “14% of text data and 33% of video” (section 4.1, paper) |
The SmolVLM paper names its encoder (“SigLIP-B/16”) but the passages read do not say whether it was frozen. Its vision tower has the same shape as Google’s public google/siglip-base-patch16-512 (12 blocks, width 768, 1,024 positions; the public checkpoint adds a pooling head a VLM does not use), so each tensor can be compared directly: the relative change ‖WSmolVLM − WSigLIP‖ / ‖WSigLIP‖, averaged over each block weighted by size measured.
Every tensor changed: the transformer blocks by 0.23 (block 0) to 0.37 (block 11) of their norm, rising with depth, the patch and position embeddings by 0.30, the final LayerNorm by 0.02. Rounding to bfloat16 accounts for well under 0.01, and two unrelated checkpoints of this shape would differ by about 1.4 (the norm of a difference of two independent tensors of equal norm is √2 times the norm). So SmolVLM’s encoder started from this checkpoint (or one very close to it; inferred from the match, not stated in the passages read) and was trained inside the VLM, the deep blocks most; it also lost the public checkpoint’s mild fixed-position outliers (section 1).
A VLM writes the most likely text given the image tokens and the words so far. When the visual evidence is weak (a small object, a low budget, a confusing scene) or the question suggests an answer, the language model’s habits win: it names objects that usually appear with what is there, or agrees with the question. This is object hallucination. POPE (Li et al., May 2023) made it a yes/no test, “Is there a <object> in the image?”, over present objects and absent ones drawn at random, from the most frequent objects (popular) or from objects that co-occur with what is there (adversarial), and showed that “LVLMs are prone to hallucinate objects which frequently appear or co-occur in the visual instruction dataset” paper. The older caption metric CHAIR (the share of mentioned objects not in the image) moved with the prompt, up to “doubled values of CHAIR metrics” between two similar instructions, one reason POPE asks short questions.
Measured better than by counting answers measured. The root lab’s 72 yes/no questions on its 16 test images (25 present objects, 16 absent at random, 31 absent but adversarial), scored by P(yes) = probability on yes tokens / (probability on yes + no tokens) at the first answer token, which shows how sure each answer is. Each question is asked four ways: with the image, with a plain grey image, with no image at all (the language model’s prior alone), and with the leading phrasing “There is <object> in the image, isn’t there?”.
What reduces it published, not run here: more image tokens where it matters (LLaVA-NeXT’s blog says higher resolution “reduces the model hallucination that conjectures the imagined visual content when confronted with low-resolution images”); training data with negative and “not visible” answers; preference training against hallucinated captions; shorter answers.
Evaluating a VLM. The failure modes on this page each have a cheap check: a no-word code for reading (section 3), boxes under every convention (section 4), a direction test for video (section 5), P(yes) with blank and no-image baselines for hallucination (above), and matched token budgets for any comparison. Public benchmark scores (MMMU, DocVQA, OCRBench, POPE, video suites) and their pitfalls are on Long-context and multimodal benchmarks; how generative and VLM outputs are judged is on Evaluating generative models.
With the image, SmolVLM says yes (P(yes) ≥ 0.5) to 24 of 25 present objects and 2 of 47 absent ones, Qwen3.5 to 25 and 4; every absent yes is adversarial, an object that goes with the scene (a dog in the typographic-attack image for both; a legend in the chart; numbers and a second hand on the clock; a person at the lighthouse). On a grey image mean P(yes) on present objects is 0.02 and 0.01. With no image SmolVLM keeps about 0.3 on yes whatever the object (0.31 present, 0.33 absent; 13 of 72 yes), Qwen3.5 about 0.15 (0.15 and 0.15; 0 yes). The leading phrasing moved absent objects only slightly: 0.05 to 0.05 (SmolVLM), 0.06 to 0.14 (Qwen3.5). These are 16 easy images, not POPE’s COCO scenes: the method transfers, the rates do not.
Predict first: if you lower the threshold to 0.2, which condition gains the most wrong yeses? Then pick a model and a condition and drag. Green dots are objects that are there (should be high), red absent ones (should be low); highlighted rows are wrong at the current threshold.
Image tokens are ordinary tokens to the language model: they take context, every later token attends to them, and their keys and values are cached for the whole conversation; on top of that the encoder runs once per image. The cache per token is the model’s, whatever the token is: SmolVLM-500M keeps 2 × 32 × 5 × 64 × 2 = 40,960 bytes per token (measured slope equal to the config arithmetic), Qwen3.5-0.8B 12,288 bytes in its 6 attention layers plus a fixed state in the other 18, so its cache grows 3.3 times more slowly measured. Sizing a whole model at any context is the KV-cache calculator on Long context, which carries both models and LLaVA-1.5-7B as presets.
Cache tensors summed by walking the cache object after a real prefill (bfloat16 keys and values, float32 recurrent state) measured. Qwen3.5-0.8B is a hybrid: of its 24 layers only 6 are attention layers with a growing cache (“6 × (3 × (Gated DeltaNet → FFN) → 1 × (Gated Attention → FFN))”, card vendor); the other 18 are linear-attention layers (Gated DeltaNet, a relative of the state-space models on the Mamba page) that keep a fixed-size state.
SmolVLM’s cache grows by 40,960 bytes per token with nothing fixed (3.4 MB at 82 prompt tokens, 46.8 MB at 1,142). Qwen3.5’s grows by 12,288 bytes per token on top of a fixed 19.8 MB held by the 18 linear-attention layers (20.8 MB at 85 tokens, 32.6 MB at 1,045). The fixed state is worth about 1,608 tokens of its attention cache: at 1,000 tokens SmolVLM holds 41.0 MB and Qwen3.5 32.0 MB; at 8,000 tokens (near SmolVLM’s 8,192 context) 327.7 MB against 118.1 MB. For scale, LLaVA-1.5-7B (32 layers, 32 KV heads of 128) keeps 524,288 bytes per token, so one 576-token image holds 302 MB.
Time measured. SmolVLM at 1,088 image tokens (the root lab’s measurement): encoder and connector 1.61 s, a full forward of the 1,142-token prompt 2.04 s, so about 0.44 s in the language model, decoding 13.9 ms per token. Qwen3.5 at 64, 256, 1,024 image tokens: encoder 0.05, 0.13, 0.64 s; full forward (encoder included) 0.31, 0.86, 3.10 s; decoding 24, 24, 25 ms per token; peak GPU memory 2,365, 2,349, 2,341 MiB. Its linear-attention layers run transformers’ reference PyTorch code here (the optimised kernels, flash-linear-attention and causal-conv1d, are not installed and target CUDA GPUs), so its times say little about a datacenter GPU; the token counts and cache sizes transfer exactly.
If most image tokens carry little, can they be dropped at inference? FastV (Chen et al., March 2024) observed that after layer 2 image tokens get little attention in LLaVA-1.5 (“image tokens take up most of the input tokens (64%)”) and pruned half of them there, ranked by “the average attention-score one token received from all other tokens”, reporting “a 45% reduction in FLOPs for LLaVA-1.5-13B” without loss on its benchmarks paper. Here SmolVLM answers the root’s 30 questions with its 1,088 image tokens cut four ways before the language model: at random; by FastV’s ranking (computed at layer 2, but the tokens are removed from the input rather than after layer 2, a simplification); by averaging each 2 × 2 block (a merge the model never saw); and by dropping the 64-token global view.
Fig. 7: SmolVLM’s 1,088 image tokens for the cat, cut before the language model
Every cut costs answers, and the 64 global tokens matter more than the 1,024 tile tokens measured. Right answers of 30: all 1,088 tokens 26 (the root lab’s 26, reproduced through this page’s token-editing path); random half 20, quarter 17, eighth 15; attention-ranked half 16, quarter 12, eighth 9; 2 × 2 average pooling (272 tokens) 19; dropping only the global view and keeping all 1,024 tile tokens: 15. Language-model prefill on the cat question fell from 0.43 s to 0.15 s at a quarter of the tokens.
Three lessons. (1) The model was trained to read the global view first and the tiles as detail, so counting and charts fail without it. (2) Pooling the projector’s outputs, a merge the model never saw, loses 7 answers; the same compression trained into the connector (SmolVLM’s pixel shuffle, Idefics2’s resampler) costs little. (3) FastV’s ranking did worse than random: averaged over all later queries, attention favours early tokens simply because more queries can see them, so it kept mostly the first tiles (for “How many cats are in this image?”, 150 of the 272 kept tokens came from the first four of 16 tiles and 6 from the global view). FastV prunes after layer 2 inside a 7B or 13B model; a 500M model with the pruning moved to the input is a harsher test, so read this as “measure before trusting”, not as a refutation.
When it matters. Token count drives prefill time and cache size linearly (and attention quadratically at long lengths), so a VLM serving screenshots or video is usually bound by image tokens. The cheapest lever is the processor setting (fewer tiles, lower maximum pixels), then a model trained with a stronger merge; training-free pruning is a third option whose loss must be measured on your own questions.
A serving engine (see Topic: inference-and-serving and Batching, KV cache and scheduling in depth) handles a VLM request in four costs, and vLLM (documentation, latest, read 2026-10-17) vendor has a lever for each:
multi_modal_uuids) to skip re-hashing, or skip sending the image when a cache hit is expected (multimodal inputs). The processor cache defaults to 4 GiB (mm_processor_cache_gb, optimization).mm_encoder_tp_mode="data" shards the images instead of the encoder’s weights, which “has been shown to improve the throughput and TTFT by around 10% for tensor_parallel_size=8”.limit_mm_per_prompt bounds the images or videos per request; --video-pruning-rate drops video tokens that barely change from the previous frame, “at some cost in accuracy”.A VLM request through vLLM, with the cache or limit at each stage (documentation read 2026-10-17) vendor.
Real errors and outputs from this page’s runs, each with what to do instead; open the ones that match your work.
"crop_to_patches": false in its image-processor config; the InternVLProcessor overrides it to True (models/internvl/processing_internvl.py line 34, v5.20.1). Call the image processor alone and dynamic tiling silently disappears: a 1,920 × 1,080 screenshot gets 1 view (256 tokens) from the image processor alone and 9 views (2,304 tokens) through the processor; an A4 page at 150 dpi, 1 against 7 measured with the processors. Always build inputs with the model’s processor and count the tokens it produced.video_metadata set measured with the processor. Pass the real frame rate and duration.apply_chat_template with an image entry, then the processor.src/runs/ and src/out/ in this page’s folder (make_inputs.py, smol_cpu.py, siglip_norms.py, encoder_drift.py, token_rules.py, run_vlm2.py; make_data.py builds the page data). Published quotes and numbers: src/facts.md.The exact pixels each model receives and the tokens it makes from them, for four images: the root’s 512 × 512 cat, two photos at their native 3:2 sizes (scikit-image’s chelsea 451 × 300 and rocket 640 × 427; CC0 and public domain) and a tall synthetic receipt (400 × 1,000). The views are decoded back from the pixel_values the processors produced, so stretching and squashing are visible as they happened. Click any token to see where it came from, its position (1-D or (t, h, w)), and its encoder patch-norm ratio; Reading sections 1, 2 and 2a explain what to look for, and section 2 steps through the rocket photo under both models. measured on the real processors and models, 2026-10-17
With shading on, shaded tokens on the grid: the largest encoder patch-norm ratio (norm divided by the view’s median, last block before the final LayerNorm) among the patches merged into that token is above 2.5; darker is higher, dark red is 5 or more. Unshaded tokens are below 2.5. Scripts: runs/smol_cpu.py (SmolVLM, CPU) and the saw phase of runs/run_vlm2.py (Qwen3.5, GPU).
How many tokens an image or a video becomes in four VLMs, and what share of the context that is. The resize and tiling rules are JavaScript ports of the processors (transformers v5.20.1) and are checked against the real processors on 24 image sizes. rules checked on the processors, 2026-10-17
The cache, in one line. Image tokens cost cache exactly like text tokens, so multiply these counts by the model’s bytes per token: one 576-token image holds 302 MB on LLaVA-1.5-7B (524,288 bytes per token), against 40,960 on SmolVLM-500M (measured here, equal to the config arithmetic), 12,288 on InternVL3-1B (2 × 24 × 2 × 64 × 2, config) and 12,288 on Qwen3.5-0.8B’s 6 attention layers plus a fixed state. SmolVLM-500M, Qwen3.5-0.8B and LLaVA-1.5-7B are presets in the KV-cache calculator; section 8 of the Reading tab has the measured cache.
Four images through SmolVLM (three settings) and Qwen3.5 (four budgets): the exact pixels, every token’s region, position and encoder norm, clickable. about 8 min
Tokens and context share for any image size, image count or video length in four VLMs, with rules ported from the processors and checked; accuracy against tokens measured here. about 8 min
72 yes/no object questions, two models, four conditions, a threshold you can move, every probability listed: now a closed block in Reading section 7. about 8 min
The root: how VLMs sit beside the encoders and the generators. Its VLM lab tab keeps the SmolVLM measurements this page does not repeat; its Model map tab lists every VLM’s dates and licences. This page reuses the lab’s SmolVLM model, question set, yes/no objects, token counts and timings.
The encoder side: training, outlier tokens, the encoders-inside-VLMs table. about 34 min
Models that also generate image tokens. about 37 min
Image tokenizers. about 40 min
Metrics and VLM benchmarks in context. about 27 min
MMMU, DocVQA, OCRBench, POPE-style probes and their pitfalls: how the models on this page are scored publicly. about 27 min
PDFs, tables and page images in retrieval systems, where a VLM is one of several parsers. about 28 min
RoPE and its extensions, the base for 2-D RoPE in encoders and M-RoPE in VLMs. about 40 min
The cache arithmetic and schedulers that image tokens load. about 37 min
Serving engines, prefix caching, disaggregated prefill: the context for section 9. about 34 min
Fixed-size recurrent state instead of a growing cache, the family Qwen3.5’s Gated DeltaNet layers belong to. about 24 min
The Qwen model family, including the VL line and Qwen3.5. about 26 min
The contrastive encoder most connectors were first built on. about 27 min
Patches, positions and the vision transformer every VLM encoder here is. about 23 min
The projector design and the two-stage recipe; section 4. about 40 min
MLP projector, 336 pixels, 1.2M samples; the strongest simple baseline. about 30 min
The Q-Former and its two pretraining stages; section 3. about 40 min
Perceiver Resampler, gated cross-attention, interleaved few-shot prompting; sections 2.1 to 2.3. Long; skim the appendices. about 60 min
The controlled ablations: cross-attention against tokens, resampler, freezing, image splitting; Tables 3 and 4 (and the two prose numbers that do not match them). about 45 min
Dynamic tiling with aspect-ratio matching, pixel shuffle, a 6B encoder trained inside the VLM. about 40 min
Naive dynamic resolution, M-RoPE, 3-D patches for video, the three-stage recipe, the [0, 1000) box format. about 50 min
Window attention in the encoder, absolute-pixel boxes, absolute-time positions for video. about 45 min
Interleaved M-RoPE, DeepStack, text timestamps, normalised boxes again, the S0 to S3 recipe. about 50 min
Design choices for small VLMs: aggressive pixel shuffle, learned position tokens, image splitting. about 40 min
Yes/no probing with random, popular and adversarial negatives; why CHAIR was unstable. about 30 min
Attention to image tokens collapses after layer 2; prune half. Table 1 for the trade-off. about 30 min
AnyRes grids and the data mixture that followed LLaVA-1.5. about 10 min
The hybrid layout, recommended sampling settings, the vendor’s benchmark table. about 10 min
Content hashing and UUIDs, processor caching, encoder data parallelism, video token pruning. about 20 min