↑↓ move Enter open ⌘K find from any page 256 of 256 tabs
Loading recorded inference…

What a vision-language model is

A vision-language model (VLM) answers questions about images with a language model. It has three parts. A vision encoder turns the image into vectors; a connector maps them into the language model's embedding space as image tokens; and a decoder-only language model reads image tokens and text tokens as one sequence, under one causal mask, and writes the answer. Nothing new is added between the modalities: to the language model the image tokens are just positions in the prompt.

The page records SmolVLM-256M-Instruct (256,484,928 parameters) on an image of a red circle, a blue square and a green triangle, resized to 256 × 256, with the prompt “Name the colors shown in the image. Answer briefly.” The stream buttons switch between its two transformers, Vision · 12 blocks over the image patches and Language · 30 blocks over text and image tokens.

The vision encoder

The vision encoder is a SigLIP-style ViT. The 256 × 256 image is cut into 16 × 16 patches, a 16 × 16 grid of 256; each patch's 768 numbers are projected to width 768 and a learned position embedding is added. There is no class token: the language model receives every patch, not one summary.

Twelve bidirectional blocks follow, each with LayerNorm, 12 heads of 64 dimensions and every patch attending to all 256, and an MLP, 768 → 3072 → 768, with tanh-approximated GELU. A final post-LayerNorm ends the encoder. SigLIP trained such encoders on image–text pairs with a sigmoid contrastive loss, a variant of CLIP's (see the CLIP tab), so their features start out aligned with language.

Pixel shuffle: fewer, wider image tokens

Passing all 256 patch vectors to a language model of width 576 would spend most of a small model's context on one image. The connector first rearranges them. Pixel shuffle lays the 16 patch vectors of each 4 × 4 block end to end, with no weights and nothing averaged, so 256 vectors of 768 become 16 vectors of 12,288. One bias-free matrix, shared by all 16, then projects each to the language width:

The Vision → language connector card shows the 16 strands entering “Pixel shuffle” (16 × 768 → 12,288) and “Wproj” (12,288 → 576), and which 4 × 4 block of the image each image token packs. Nothing is lost in the shuffle itself; the projection decides what of the 12,288 numbers the language model sees. The name comes from super-resolution, where the same rearrangement runs the other way, from channels to space.

Compressing the image this hard is a deliberate choice. SmolVLM's authors found that small models do better with aggressive yet efficient image tokenisation, and the Idefics3 design they build on also uses pixel shuffle.

One sequence, one causal mask

The language input has 38 positions. Text tokens are looked up in the embedding table; the 16 connector outputs are placed unchanged at positions 5–20, between the image marker tokens, where the prompt had placeholders. The Language input popup shows the merge, which has no weights of its own:

The decoder is Llama-style: 30 blocks of width 576 with RMSNorm, RoPE (base 100,000), and grouped-query attention in which 9 query heads share 3 key/value heads, then a SwiGLU MLP, 576 → 1536 → 576. Image and text positions sit under the same causal mask. The question comes after the image, so every question token can attend to all 16 image tokens; the image tokens see only what precedes them. After the last block, the final RMSNorm and the vocabulary projection (576 → 49,280, tied to the embedding table) score the next token.

What the model answers

The Probabilities card shows the next-token distribution after “Assistant:”. At temperature 1, “ The” has 48.67 %, “ Red” 16.14 % and “ There” 7.13 %, with “ Green” and “ Blue” further down. The manifest also records the model's greedy completion: “The image contains four different colors: red, blue, green, and yellow.” The image has three colours on white, so the answer is wrong. The page keeps it because it is what the model wrote; small VLMs can name things that are not in the image.

Where it came from

Flamingo (2022) joined a frozen vision encoder to a frozen language model with new gated cross-attention layers. LLaVA (2023) simplified the joint: project the vision encoder's patch features into the language model's token sequence, then tune on visual instructions. Laurençon et al. tested these choices systematically for Idefics2 (2024), and Idefics3 added pixel shuffle to cut the number of image tokens. SmolVLM (2025) carried the recipe to very small models; its authors report that SmolVLM-256M uses less than 1 GB of GPU memory and outperforms the 300-times larger Idefics-80B.

The ViT tab shows a patch encoder on its own, and the CLIP tab the contrastive training behind SigLIP.

Papers

  1. SmolVLM: Redefining small and efficient multimodal models Andrés Marafioti et al. · arXiv 2025 SmolVLM, the model this page records: a SigLIP encoder, pixel shuffle and a small Llama-style decoder.
  2. Building and better understanding vision-language models: insights and future directions Hugo Laurençon, Andrés Marafioti, Victor Sanh, Léo Tronchon · arXiv 2024 Idefics3, the architecture SmolVLM loads as: a vision encoder, a pixel-shuffle connector and a language decoder.
  3. What matters when building vision-language models? Hugo Laurençon, Léo Tronchon, Matthieu Cord, Victor Sanh · NeurIPS 2024 Idefics2: controlled experiments on encoders, connectors and data for VLMs.
  4. Sigmoid Loss for Language Image Pre-Training Xiaohua Zhai, Basil Mustafa, Alexander Kolesnikov, Lucas Beyer · ICCV 2023 SigLIP, the contrastively trained vision encoder family SmolVLM's encoder comes from.
  5. Visual Instruction Tuning Haotian Liu, Chunyuan Li, Qingyang Wu, Yong Jae Lee · NeurIPS 2023 LLaVA: vision features projected into a language model's token sequence, the layout this page shows.
  6. Flamingo: a Visual Language Model for Few-Shot Learning Jean-Baptiste Alayrac et al. · NeurIPS 2022 An early large VLM that joined a frozen vision encoder and language model with gated cross-attention.
  7. Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network Wenzhe Shi et al. · CVPR 2016 The pixel-shuffle rearrangement, here run from space to channels to pack patches.

See also