Chapter 1: Introduction to Vision-Language Models
Understand what Vision-Language Models are, how they bridge the gap between visual perception and language understanding, and why the multimodal paradigm represents a fundamental shift in AI. Trace the evolution from early VQA systems to modern unified architectures like GPT-4o and Gemini.
- Topics
- 6
- Demo
- 1
- Videos
- 3
- Min read
- 45
Chapter Overview
Vision-Language Models (VLMs) represent a new frontier in artificial intelligence: systems that can simultaneously understand images and generate language about them. Unlike traditional computer vision models that output class labels or bounding boxes, VLMs produce rich, contextual natural language descriptions, answer open-ended questions about visual content, and reason across both modalities.
The core insight behind VLMs is deceptively simple: if we connect a powerful vision encoder to a powerful language model, the resulting system can leverage the reasoning abilities of the LLM while grounding its outputs in visual reality. The conditional generation objective captures this:
This factorization means the model generates text one token at a time, conditioned on everything it has seen so far---both the image features and any preceding text tokens.
The field has evolved rapidly. Early approaches (2015--2020) treated vision-language tasks as classification problems, selecting from a fixed set of answers. The CLIP revolution (2021) demonstrated that contrastive pre-training could align visual and textual representations in a shared embedding space. Flamingo (2022) showed how to inject visual features into frozen language models. LLaVA (2023) proved that a simple linear projection plus visual instruction tuning could match far more complex architectures. And GPT-4V/4o (2023--2024) brought multimodal reasoning to production scale.
This chapter covers:
- What are VLMs? The multimodal paradigm and conditional generation framework
- The Vision-Language Gap: Why bridging modalities is fundamentally challenging
- Evolution of VLMs: From VQA classifiers to native multimodal models
- Architecture Overview: The three-component design pattern
- Key Capabilities: What modern VLMs can actually do
- Landscape of Modern VLMs: Closed vs. open models and how they compare
Chapter Roadmap
Click any topic to jump in
What Are VLMs
The multimodal paradigm — why combining vision and language produces capabilities neither modality has alone.
Understanding the challenge and how architectures address it
The Vision-Language Gap
Why bridging pixels and words is fundamentally hard — grounding, modality mismatch, and alignment challenges.
Architecture Overview
The three-component blueprint: vision encoder, bridge module, and language decoder working together.
Evolution of VLMs
From VQA classifiers to native multimodal models — four eras of increasingly capable systems.
Capabilities and the models that deliver them
Key Capabilities
VQA, captioning, OCR, and visual grounding — what modern VLMs can actually do.
Modern VLM Landscape
Closed vs open-weight models and how to choose — GPT-4o, Gemini, LLaVA, Qwen-VL and more.
Topics
6 topics in this chapter
An image classifier can tell you that a photograph contains a cat; a language model can write fluent prose about cats it has never seen. Neither can answer "what is odd about this particular picture?", because the classifier's entire vocabulary is its label set and the language model has no access to the pixels. Closing that gap needs a model whose text generation is conditioned on visual input, which is exactly the objective the chapter introduction wrote as — keep that factorization at hand, because everything below unpacks it. We begin with the multimodal paradigm, making precise what it means for visual features to occupy positions in the same context window as text tokens. We then contrast unimodal and multimodal systems, since where you fuse the two streams, at the end or at every layer, sets a hard ceiling on the cross-modal reasoning available. Finally we turn the idea into a trainable loss. This ordering matters: The Vision-Language Gap, the topic that follows, is a catalogue of everything this objective quietly assumes, and it only reads as difficult once you know what is being asked.
In this topic
- 1The Multimodal Paradigm
- 2Unimodal vs. Multimodal Models
- 3Conditional Generation Framework
The Multimodal Paradigm
A VLM performs conditional text generation where the conditioning context includes both visual features (extracted from the image by a vision encoder) and textual tokens (the user's prompt or question). The model autoregressively generates output tokens , with each token conditioned on all previous tokens plus the full visual and textual context.
This is a strict generalization of a standard language model, which conditions only on text: . The visual features act as additional context tokens that the language model attends to during generation.
Critically, the visual features are not raw pixels---they are high-dimensional embeddings produced by a vision encoder (typically a Vision Transformer). These embeddings capture semantic content at multiple levels of abstraction, from low-level textures to high-level object relationships.
The joint distribution factorizes over a context window of size , where is the number of visual tokens and is the prompt length. Each attention layer computes over this full context, meaning visual tokens participate in pairwise interactions. The critical insight: visual tokens are not a separate input channel — they occupy the same sequence positions as text tokens, making cross-modal attention an emergent property of standard self-attention rather than a separate mechanism.
A VLM receives an image of a stop sign partially covered by snow and the prompt "What does this sign say?" How does the model process this?
Unimodal vs. Multimodal Models
Traditional AI models are unimodal: they process a single data type. A ResNet classifies images. GPT generates text. A speech model transcribes audio. Each operates in its own modality silo.
Multimodal models break these silos by processing multiple data types jointly. VLMs specifically bridge vision and language, but the principle extends to audio, video, and other modalities. The key challenge is creating a shared representation space where information from different modalities can interact meaningfully.
There are two fundamental approaches:
- Late fusion: Process each modality independently, then combine the final representations. Simple but loses fine-grained cross-modal interactions.
- Early/mid fusion: Interleave information from both modalities during processing. More complex but enables richer cross-modal reasoning.
Late fusion computes where is some combination operator applied to final representations. Early fusion computes where cross-modal interactions occur at every layer. The information-theoretic difference is that late fusion can capture at most bits of cross-modal mutual information (bounded by each encoder's bottleneck), while early fusion can capture up to — the full joint mutual information, preserving correlations that neither modality captures alone.
A doctor examines a chest X-ray and writes a radiology report. Is this task unimodal or multimodal? How does it map to a VLM?
Conditional Generation Framework
VLMs are trained by maximizing the conditional log-likelihood of the target text given the image and prompt. The training loss is the negative log-probability of each ground-truth token, summed over the entire sequence.
During training, the model sees (image, prompt, response) triples. The image is encoded into visual tokens , the prompt provides the textual context , and the model learns to predict each token of the response. This is identical to standard language model training, except the context is augmented with visual features.
The gradient flows through the language model and (optionally) through the bridge module and vision encoder, depending on which components are frozen vs. trainable.
The training loss is a maximum likelihood estimator over the conditional distribution. By the chain rule, minimizing this is equivalent to minimizing — the KL divergence between the true data distribution and the model. The gradient flows through the LLM to the bridge module and optionally to the vision encoder, with the bridge receiving gradients proportional to — how much better predictions would be if the visual token representations changed.
During training, a VLM sees an image of a golden retriever playing in a park with the caption "A golden retriever chasing a frisbee on green grass." What does the loss computation look like?
Theory Exercise
Problem:
Explain why a VLM that processes image and text in a shared transformer (early fusion) might produce more nuanced descriptions than one that processes them separately and concatenates the results (late fusion). What types of visual reasoning tasks would most benefit from early fusion?
Hints:
- Think about what information is available at each transformer layer with early vs. late fusion
- Consider tasks that require fine-grained spatial reasoning, like 'What color is the object to the left of the cat?'
- Think about how cross-attention between visual and textual tokens enables grounding
You now have the conditional objective from What Are Vision-Language Models, and it looks like it should simply work: encode the image, hand the features to the decoder, train on captions. It does not, and the reasons are concrete rather than philosophical. A ViT-L/14 emits 257 vectors of width 1024, tuned so that things which look alike sit nearby. A 7B decoder consumes vectors of width 4096 in strict sequential order, tuned so that things which mean alike sit nearby. Neither the dimensions, the statistics, nor even the notion of adjacency agree. Aligning them means learning a map under which an image of a dog and the string "a photo of a dog" land close together, while enough spatial structure survives that "left of" still refers to something. We start with grounding, attaching nouns, adjectives, relations and verbs to regions, because grounding failures are what users experience as hallucination. We then make the mismatch quantitative, comparing how much information one visual token carries against one subword. We close on alignment itself, contrastive and generative, the mechanism every architecture in this chapter is arranged around.
In this topic
- 1The Grounding Problem
- 2Modality Mismatch
- 3Representation Alignment
The Grounding Problem
Grounding refers to connecting language symbols to their referents in the visual world. When a human reads "the red car on the left," they effortlessly locate the corresponding object in a scene. For a model, this requires learning a mapping from linguistic descriptions to spatial regions in an image.
The grounding problem has multiple levels of difficulty:
- Object-level grounding: Mapping nouns to objects ("dog" bounding box around the dog)
- Attribute grounding: Mapping adjectives to properties ("red" the color of a specific object)
- Relation grounding: Mapping spatial/semantic relations ("on top of" relative positions of two objects)
- Action grounding: Mapping verbs to visual events ("running" motion patterns)
Without effective grounding, a VLM may generate fluent but incorrect descriptions---a phenomenon known as hallucination.
Grounding requires learning a mapping from (visual features, language description) to spatial regions. For object-level grounding, the model must solve an assignment problem: given detected regions and noun phrases , find the optimal matching . Counting failures occur when the vision encoder's feature map has insufficient spatial resolution to separate nearby instances — two objects within the same patch become a single token, losing the distinction.
A VLM is asked "How many cats are in this image?" for a photo containing 3 cats. It answers "2 cats." What type of grounding failure is this?
Modality Mismatch
Vision encoders and language models operate in different embedding spaces with different dimensionalities, different statistical properties, and different learned structures. The vision encoder's embedding space is optimized for visual similarity (similar-looking objects are nearby), while the language model's space is optimized for linguistic coherence (semantically related words are nearby).
Beyond dimensionality, there are deeper structural differences:
- Information density: A single image token from a ViT-L/14 encodes a pixel region with all its color, texture, and edge information. A single text token encodes one subword. Visual tokens are vastly more informationally dense.
- Ordering: Text tokens have a strict sequential order. Image tokens have 2D spatial relationships. The bridge module must reconcile these.
- Granularity: Text can describe a scene at any level of abstraction ("a room" vs. "a Victorian-era parlor with mahogany furniture"). Image features represent all details simultaneously.
Vision tokens live in while text tokens live in , with and fundamentally different statistical structure. A single visual token from ViT-L/14 encodes a -dimensional pixel patch, compressed to — an information density of bytes per dimension. A text token represents one of discrete symbols — approximately bits of information. The bridge module must reconcile these wildly different information densities while preserving the spatial structure that 2D vision tokens encode but 1D text tokens do not.
A ViT-L/14 vision encoder produces 257 tokens of dimension 1024. A Llama-2-7B language model expects tokens of dimension 4096. What are the options for bridging this gap?
Representation Alignment
For a VLM to work, visual and textual representations must be aligned: an image of a dog and the text "a photo of a dog" should produce similar feature vectors. This alignment can be achieved through:
-
Contrastive pre-training (CLIP approach): Train the vision and text encoders jointly so that matching image-text pairs have high cosine similarity while non-matching pairs have low similarity.
-
Generative alignment (LLaVA approach): Fine-tune the bridge module and/or LLM so that visual features can be "understood" by the language model through next-token prediction on image-caption pairs.
-
Hybrid alignment: Use a CLIP-pretrained vision encoder (already partially aligned to language) and then further align through generative fine-tuning.
The quality of alignment directly determines the VLM's ability to ground language in visual content.
Contrastive alignment optimizes the InfoNCE objective, which is a lower bound on mutual information: , where is the batch size. CLIP's temperature parameter controls the sharpness of the softmax: . Lower creates sharper distributions that demand precise alignment. At , a cosine similarity difference of just between the correct and incorrect pairs translates to a probability ratio of .
After CLIP pre-training, the cosine similarity between an image of a cat and the text "a photo of a cat" is 0.85. The similarity between the same image and "a photo of a dog" is 0.15. What does this tell us about alignment quality?
Theory Exercise
Problem:
A VLM correctly identifies objects in an image ("There is a dog, a ball, and a fence") but generates the incorrect spatial relationship ("The dog is behind the fence" when the dog is actually in front of the fence). Analyze which aspect of the vision-language gap is responsible and propose a training strategy to fix it.
Hints:
- Consider which type of grounding (object, attribute, relation, action) is failing
- Think about what information is lost when 2D spatial features are projected into a 1D token sequence
- Consider how spatial relationship training data could be augmented
Related Problems on PixelBank
Given that the modality gap from The Vision-Language Gap is real, someone had to get past it, and the first answer was to sidestep it entirely: if two spaces cannot be aligned, restrict the output to a few thousand fixed answers and the whole problem collapses into a classification head. That is where the field started, and reading the decade since as a list of model names hides the interesting part. Each era removed exactly one constraint the previous era had accepted, so we follow those removals in order. VQA classifiers gave up open-ended output to make fusion tractable. CLIP showed supervision could come from web captions rather than curated label sets, buying alignment at a scale no annotation budget could reach. Generative VLMs kept that aligned encoder, froze it beside a pre-trained language model, and found a small trainable bridge sufficient. Native multimodal models pay the cost the frozen designs avoid, training modalities jointly to remove the bridge bottleneck. Read this way the history is a design argument, and it explains why alignment quality rather than sheer model size is what made later architectures so cheap to build.
In this topic
- 1Era 1: VQA Classifiers (2015--2019)
- 2Era 2: CLIP and Contrastive Pre-Training (2021)
- 3Era 3: Generative VLMs (2022--2023)
- 4Era 4: Native Multimodal Models (2024+)
Era 1: VQA Classifiers (2015--2019)
The earliest vision-language models treated multimodal tasks as classification problems. For Visual Question Answering (VQA), models like VQA (Antol et al., 2015) and Bottom-Up Top-Down Attention (Anderson et al., 2018) extracted image features using a CNN (ResNet, Faster R-CNN), encoded the question with an LSTM, fused the two representations, and classified the answer from a fixed vocabulary of ~3,000 possible answers.
Limitations: Fixed answer vocabulary, no free-form generation, task-specific architectures. A model trained for VQA couldn't do captioning or visual reasoning without retraining.
VQA classifiers model where indexes a fixed answer vocabulary of size . The Hadamard product for fusion is a rank-1 bilinear interaction — it captures element-wise correlations but misses higher-order interactions between visual and textual features. The entropy of the output distribution is bounded by bits, fundamentally limiting the expressiveness compared to generative models where output entropy scales with sequence length.
A VQA classifier is trained on the VQA v2 dataset with 3,129 answer classes. A user asks "What is the chemical formula written on the whiteboard?" How does this expose the model's limitations?
Era 2: CLIP and Contrastive Pre-Training (2021)
CLIP (Contrastive Language-Image Pre-training, Radford et al., 2021) was a watershed moment. Instead of training on labeled datasets, CLIP trained on 400 million image-text pairs scraped from the internet. A vision encoder (ViT or ResNet) and a text encoder (Transformer) were trained jointly so that matching pairs had high cosine similarity.
CLIP demonstrated remarkable zero-shot transfer: without any task-specific fine-tuning, it could classify images, retrieve images from text queries, and perform visual reasoning. CLIP's vision encoder became the standard backbone for subsequent VLMs.
Key innovation: Learning visual representations from natural language supervision at web scale, rather than from manually labeled categories.
CLIP's symmetric InfoNCE loss over a batch of pairs creates classification problems, each with classes. With batch size , the effective learning signal is bits per batch. The learnable temperature (initialized at ) acts as an inverse bandwidth in the similarity kernel: . Training on 400M pairs with creates an embedding space where the cosine similarity margin between matching and non-matching pairs exceeds — enabling zero-shot transfer to downstream tasks without fine-tuning.
CLIP is given an image of a dog and the text candidates ["a photo of a cat", "a photo of a dog", "a photo of a car"]. How does zero-shot classification work?
Era 3: Generative VLMs (2022--2023)
The next leap came from connecting vision encoders to generative language models. Instead of just matching images and text, these models generate free-form text conditioned on images.
- Flamingo (DeepMind, 2022): Inserted gated cross-attention layers into a frozen Chinchilla LLM, allowing it to attend to visual features from a frozen CLIP encoder. Demonstrated few-shot visual learning.
- BLIP-2 (Salesforce, 2023): Introduced Q-Former, a lightweight transformer that bridges frozen vision and language models using learnable query tokens.
- LLaVA (Liu et al., 2023): Showed that a simple linear projection from CLIP features to LLM token space, combined with visual instruction tuning, achieves competitive performance (LLaVA-1.5 later swapped it for a 2-layer MLP, still tiny next to the LLM). Dramatically simpler than alternatives.
Key insight: You don't need to train vision and language from scratch together. Connecting pre-trained frozen components with a small trainable bridge is sufficient.
The original LLaVA's bridge is a single linear projection with only parameters (e.g., for a 7B LLM). LLaVA-1.5's 2-layer MLP is still only tens of millions. This works because CLIP's pre-training already produces features where for matching pairs — the representations are approximately aligned up to a linear transform. Formally, if the CLIP feature spaces satisfy for some unknown , then learning is a linear regression problem solvable with examples, far fewer than learning visual representations from scratch.
LLaVA-1.5 uses a 2-layer MLP with ~31M parameters (1024×5120 + 5120×5120) to connect CLIP ViT-L (304M params) to Vicuna-13B (13B params). How is it possible that such a small bridge works?
Era 4: Native Multimodal Models (2024+)
The most recent generation moves beyond the modular approach (frozen encoder + bridge + frozen LLM) toward models that are designed multimodal from the ground up:
- GPT-4V/4o (OpenAI): Natively multimodal, trained end-to-end on text, images, and audio. Architecture details are proprietary.
- Gemini (Google): Pre-trained from scratch on interleaved multimodal data---text, images, audio, video, code.
- Claude 3/3.5 (Anthropic): Vision capabilities integrated into the language model architecture.
Key distinction: Earlier VLMs bolt vision onto a language model. Native multimodal models treat all modalities as first-class citizens during pre-training, potentially learning deeper cross-modal representations.
Native multimodal models optimize jointly over modalities during pre-training, rather than freezing individual encoders and learning only the bridge. The key advantage is captured by the data processing inequality: for any Markov chain , we have . Modular approaches with frozen encoders form such a chain, meaning the bridge can never recover information discarded by the vision encoder. End-to-end training removes this bottleneck, allowing the vision encoder to preserve information that the LLM specifically needs.
What are the trade-offs between modular VLMs (LLaVA-style) and native multimodal models (Gemini-style)?
Theory Exercise
Problem:
Compare the training efficiency (compute required) and capability range of three approaches: (1) training a task-specific VQA classifier from scratch, (2) fine-tuning a CLIP model for VQA, and (3) visual instruction tuning an LLM (LLaVA approach). Under what circumstances would each be the best choice?
Hints:
- Consider dataset size requirements for each approach
- Think about what capabilities each approach provides beyond VQA
- Consider computational budget constraints
Evolution of VLMs left you with a design argument but no blueprint. You know a frozen encoder, a small bridge and a pre-trained decoder are enough; you do not yet know what any of those things actually is. Without that you cannot read a model card, estimate what a single image costs at inference time, or explain why one VLM reads a receipt reliably and another cannot. This topic supplies the blueprint, taking the three components in the order data flows through them. The vision encoder comes first, because its patch size and input resolution fix the token count everything downstream is obliged to carry. The bridge follows, and it is where the architectural variety lives: a linear map keeps every token, while a resampler or Q-Former buys the decoder a shorter sequence at the price of discarded detail. The language decoder comes third, along with the frozen-versus-fine-tuned decision that determines where gradients are allowed to flow. We close by tracing one image end to end, which is where the quadratic cost of a few hundred visual tokens stops being abstract.
In this topic
- 1Component 1: Vision Encoder
- 2Component 2: Bridge Module (Connector)
- 3Component 3: Language Model Decoder
- 4End-to-End Data Flow
Component 1: Vision Encoder
The vision encoder transforms raw pixel input into a sequence of high-dimensional feature vectors. Modern VLMs almost universally use Vision Transformers (ViT) as their vision encoder, typically pre-trained with CLIP, SigLIP, or DINOv2.
The encoder divides the image into patches (e.g., pixels), embeds each patch into a vector, adds positional information, and processes the sequence through transformer layers. The output is a set of visual tokens---one per patch plus optionally a CLS token---each capturing semantic information about its corresponding image region.
Common choices:
- CLIP ViT-L/14: 304M params, 1024-dim, 256 tokens for 224px input. The standard choice.
- SigLIP-SO400M: 400M params, efficient sigmoid-based contrastive training.
- InternViT-6B: 6B params, the largest open vision encoder.
- DINOv2 ViT-g: 1.1B params, self-supervised (no text alignment).
A ViT with patch size on an image of size produces tokens. Each patch is linearly projected: , where . After transformer layers, the receptive field of each token grows to encompass the entire image through self-attention, but the spatial correspondence is preserved — token still primarily represents patch with contextual enrichment from all other patches. This is why positional embeddings matter: without them, the model sees an unordered set of patches and loses all spatial structure.
A ViT-L/14 processes a 336x336 image. How many visual tokens does it produce?
Component 2: Bridge Module (Connector)
The bridge module maps visual tokens from the encoder's space () to the LLM's embedding space () and optionally compresses the number of tokens from to (where ). This is the most architecturally diverse component across different VLMs.
Common bridge architectures:
-
Linear Projection (LLaVA-v1): Single matrix . Preserves all tokens. Simplest possible approach.
-
MLP Projection (LLaVA-v1.5): Two-layer MLP with GELU activation. Still preserves all tokens but with a more expressive transformation.
-
Perceiver Resampler (Flamingo): Cross-attention from learnable query tokens to visual tokens. Compresses from to tokens (e.g., 256 64).
-
Q-Former (BLIP-2): Lightweight transformer with learnable queries that extract the most relevant information from visual tokens through cross-attention.
-
C-Abstractor (Honeybee): Convolutional abstractor that uses convolutions to reduce spatial resolution before projection.
The Perceiver Resampler compresses visual tokens to query tokens () via cross-attention: , where and . This is a learned bottleneck: the queries must discover which of the visual features are most informative for language generation. Information-theoretically, the bottleneck forces bits, trading visual detail for computational efficiency in the downstream LLM.
Compare the parameter counts and output token counts for a linear projection vs. a Perceiver Resampler when mapping 576 ViT-L tokens (dim=1024) to Llama-2-7B (dim=4096).
Component 3: Language Model Decoder
The language model is the core reasoning engine. It receives a sequence of tokens---visual tokens from the bridge module interleaved with text tokens from the user's prompt---and generates a response autoregressively.
Modern VLMs use decoder-only transformer LLMs as their backbone:
- Vicuna/Llama: 7B--70B params. Most common in open-source VLMs (LLaVA, InternVL).
- Qwen: 1.8B--72B params. Used in Qwen-VL series.
- Phi-3: 3.8B params. Used in Phi-3-Vision for efficient deployment.
- Mixtral: 8x7B MoE. Used for efficient scaling.
A critical design decision is whether the LLM is frozen (weights fixed from pre-training) or fine-tuned during VLM training. Freezing preserves the LLM's language capabilities but limits adaptation. Full fine-tuning allows deeper integration but risks catastrophic forgetting of language skills.
The LLM applies causal self-attention over the concatenated sequence , computing where masks future tokens. Visual tokens are never masked from each other (they are all "past" relative to text tokens), so the LLM can freely attend across all visual patches when processing the prompt. The decision to freeze vs. fine-tune the LLM affects gradient flow: frozen LLMs have , forcing all adaptation into the bridge module's -M parameters.
LLaVA-v1 freezes the LLM during pre-training and fine-tunes it during instruction tuning. LLaVA-v1.5 fine-tunes the LLM in both stages. Why does this matter?
End-to-End Data Flow
The complete forward pass concatenates visual and textual tokens into a single sequence that the LLM processes with its standard causal attention mechanism:
- Image encoding:
- Bridge projection:
- Text embedding:
- Concatenation:
- Autoregressive generation:
From the LLM's perspective, visual tokens are indistinguishable from text tokens. They are just additional context in the input sequence. The LLM's self-attention mechanism naturally learns to attend to relevant visual tokens when generating each output word.
The total sequence length (visual + prompt + generated tokens) determines the computational cost: self-attention is and the KV-cache grows as . For a typical setup with visual tokens, prompt tokens, and generated tokens, visual tokens constitute of the sequence but carry all the perceptual information. This motivates token compression: reducing from 576 to 64 cuts the prefill attention cost by .
For a VLM with 576 visual tokens, a 20-token prompt, and a 100-token response, what is the total sequence length? How does this affect computational cost?
Theory Exercise
Problem:
Design a VLM for a mobile phone that must process high-resolution images (1344x1344) in under 2 seconds. Specify your choices for vision encoder, bridge module, and LLM, and justify each choice. What are the key trade-offs you must navigate?
Hints:
- Consider the token count explosion with high-resolution inputs
- Think about which component dominates latency: vision encoder, bridge, or LLM
- Explore MoE (Mixture of Experts) LLMs for efficiency
- Consider dynamic resolution strategies
A pipeline diagram tells you nothing about what the assembled system is good at. Two models sharing the exact three-component structure from VLM Architecture Overview can differ enormously in practice: one reads a scanned invoice reliably while the other, differing only in input resolution, cannot resolve the characters at all. Capability is where architectural choices become visible, and knowing the difficulty ordering among tasks is what lets you predict failures rather than discover them in production. We work from the most general capability toward the most demanding. Visual question answering comes first, because every other task is a special case of it and because its internal spectrum — recognition, then counting, then spatial relations, then multi-hop reasoning — is the ladder the rest of the topic climbs. Captioning follows, where the interesting jump is from a brief caption to a dense description and the hallucination pressure that arrives with it. OCR and document understanding come next, the clearest case of resolution deciding capability outright. Grounding closes the topic, because emitting coordinates demands a spatial precision the other three can do without.
In this topic
- 1Visual Question Answering (VQA)
- 2Image Captioning and Dense Description
- 3Optical Character Recognition (OCR) and Document Understanding
- 4Visual Grounding and Referring Expression Comprehension
Visual Question Answering (VQA)
The most fundamental VLM capability: given an image and a question, generate a natural language answer. Modern VLMs handle open-ended questions far beyond the fixed-vocabulary classifiers of earlier approaches.
Difficulty spectrum:
- Recognition: "What animal is this?" (easy---single object identification)
- Counting: "How many people are in the photo?" (medium---requires instance segmentation)
- Spatial reasoning: "What is to the left of the red car?" (hard---requires precise spatial grounding)
- Complex reasoning: "Based on the graph, what year had the highest GDP growth and what policy might explain this?" (very hard---requires reading, reasoning, and external knowledge)
VQA difficulty correlates with the number of reasoning hops required. Recognition is a single lookup: . Counting requires enumeration: , which demands the model maintain distinct representations for each instance. Spatial reasoning requires composing relations: answering "What is left of the red car?" is — a two-hop query where errors compound multiplicatively across steps.
Rank these VQA questions by difficulty and explain why: (a) "Is there a dog in the image?" (b) "What breed of dog is in the image?" (c) "How does the dog's body language suggest it is feeling?"
Image Captioning and Dense Description
Generating textual descriptions of images, ranging from brief captions to detailed paragraphs. This was one of the earliest multimodal tasks, but modern VLMs have dramatically expanded what is possible.
- Brief captioning: "A dog playing in a park" --- captures the main subject and action.
- Detailed captioning: Multi-sentence descriptions covering objects, attributes, spatial relationships, background elements, lighting, and mood.
- Region-specific captioning: Describing specific parts of an image ("What is in the top-right corner?").
- Structured captioning: Generating JSON-formatted descriptions with attributes, relationships, and bounding boxes.
Caption generation follows , where caption quality depends on the attention pattern over visual tokens at each decoding step. Brief captions attend to high-saliency patches (often of tokens receive significant attention weight). Dense descriptions require near-uniform coverage — the cumulative attention distribution should have high entropy across all visual tokens. Hallucination occurs when the LLM's language prior overwhelms the visual signal , generating plausible but ungrounded continuations.
Why is detailed image captioning harder than brief captioning for a VLM? Isn't generating more text just... generating more tokens?
Optical Character Recognition (OCR) and Document Understanding
Modern VLMs can read and understand text within images, including handwritten text, tables, charts, mathematical equations, code screenshots, and complex document layouts. This emerged as a surprisingly strong capability in GPT-4V and Gemini.
OCR capabilities include:
- Reading printed and handwritten text
- Understanding table structures and extracting data
- Interpreting charts and graphs numerically
- Parsing mathematical equations from LaTeX renderings or handwriting
- Understanding multi-column layouts, headers, footers
This capability is particularly valuable because it means VLMs can process documents, receipts, forms, and screenshots without needing a separate OCR pipeline.
OCR in VLMs requires the vision encoder to preserve character-level detail across patches. For a ViT with patch size at resolution , each patch covers pixels — roughly 2-3 characters of standard font. At this resolution, small or dense text falls below the Nyquist limit for reliable character discrimination. This is why high-resolution VLMs (px) dramatically outperform standard-resolution ones on OCR benchmarks: doubling resolution quadruples the number of patches, giving each character more pixel area per token.
A VLM is given a screenshot of a bar chart showing quarterly revenue for 4 companies. What must the model do to answer "Which company had the highest Q3 revenue?"
Visual Grounding and Referring Expression Comprehension
Visual grounding is the task of localizing specific regions in an image based on a textual description. Given a description like "the person wearing a red hat," the model must output coordinates (a bounding box or a set of points) indicating where that entity is in the image.
Related tasks:
- Referring Expression Comprehension (REC): Text bounding box
- Referring Expression Generation (REG): Bounding box text description
- Phrase grounding: Multiple phrases in a sentence, each mapped to a region
This capability requires fine-grained alignment between language tokens and visual patches, making it one of the hardest VLM tasks. Models like Kosmos-2, Shikra, and Ferret are specifically designed for grounding.
Visual grounding maps a referring expression to a bounding box in normalized image coordinates. The model must learn , typically by predicting coordinate tokens discretized into bins per axis. With , the spatial precision is of the image dimension. The key challenge is that grounding requires attending to a specific subset of visual tokens corresponding to the referred region — the attention pattern must be spatially localized rather than distributed, which is the opposite of what general captioning requires.
A user says to a VLM: "Circle the tallest building in this city skyline photo." What architectural capability does the VLM need that a standard captioning model lacks?
Theory Exercise
Problem:
Design an evaluation benchmark for testing VLM capabilities across five dimensions: recognition, spatial reasoning, OCR, counting, and world knowledge. For each dimension, create one easy, one medium, and one hard example question (with a reference image description). Explain what makes each level progressively harder.
Hints:
- Consider what additional information/skills are needed at each difficulty level
- Think about edge cases that would distinguish truly capable VLMs from those that just guess common answers
- Consider multi-step reasoning chains for hard questions
Related Problems on PixelBank
Key Capabilities told you what a VLM can be asked to do and which of those requests are hard. It did not tell you which model to call, and the answer is rarely whichever one currently tops a leaderboard. That choice is set by constraints benchmarks never measure: whether your data may leave your network at all, whether you need to fine-tune on domain examples, whether your query volume makes per-token pricing or a rented GPU cheaper, and how much operational burden your team can absorb. This topic treats the ecosystem along those axes instead of as a ranking. We look first at closed API models, where you buy state-of-the-art quality and continuous updates and give up inspection, fine-tuning and privacy in exchange. We then look at open-weight models, where the trade runs the other way and the remaining quality gap is far narrower than the parameter counts suggest. We finish with a selection framework that turns these axes into a decision you can defend, because in production the deciding factor is almost always a constraint rather than a score.
In this topic
- 1Closed-Source VLMs
- 2Open-Weight VLMs
- 3Model Selection Criteria
Closed-Source VLMs
These models are available only through APIs, with architecture details undisclosed:
- GPT-4o (OpenAI): Currently the strongest general-purpose VLM. Natively multimodal (text, images, audio, video). Excels at complex reasoning, OCR, and instruction following.
- Gemini 1.5 Pro (Google): Long-context multimodal (up to 1M tokens). Strong at video understanding and document processing.
- Claude 3.5 Sonnet (Anthropic): Strong reasoning, excellent at code generation from screenshots, and careful about hallucination.
- Gemini 2.0 Flash (Google): Optimized for speed while maintaining strong multimodal capabilities.
Key advantage: State-of-the-art performance, continuously updated, no infrastructure management. Key limitation: No fine-tuning (except GPT-4o), no architecture access, cost per token, data privacy concerns.
Closed-source VLMs like GPT-4o are estimated to use Mixture-of-Experts (MoE) architectures with T total parameters but only B active per token. The MoE routing function selects out of experts per token, giving computational cost relative to a dense model of the same total size. This explains how these models achieve superior reasoning (large total parameter count = more stored knowledge) while maintaining acceptable inference latency (small active parameter count = manageable FLOPs per token).
A healthcare company wants to build a VLM that reads medical images (X-rays, MRIs) and generates reports. Should they use GPT-4o or an open model?
Open-Weight VLMs
Models with publicly available weights, enabling fine-tuning, deployment, and inspection:
- LLaVA-NeXT / LLaVA-OneVision (Bytedance/UW): Pioneer of visual instruction tuning. Simple architecture, strong results, easy to fine-tune. 7B--72B variants.
- Qwen-VL / Qwen2-VL (Alibaba): State-of-the-art open VLM. Dynamic resolution, supports video. 2B--72B variants.
- InternVL 2.5 (Shanghai AI Lab): Largest open VLM (InternViT-6B + InternLM2). Excels at OCR, document understanding.
- Molmo (AI2): Focus on grounding and pointing. Open training data and pipeline.
- Pixtral (Mistral): Variable-resolution via native patch handling. 12B params.
- Phi-3-Vision (Microsoft): Efficient 4.2B model suitable for edge deployment.
- Llama 3.2 Vision (Meta): 11B and 90B variants with strong performance across benchmarks.
Key advantage: Full control, fine-tuning, on-premises deployment, transparency. Key limitation: Generally behind closed models on complex reasoning tasks.
Open VLMs achieve competitive performance despite fewer parameters through architectural efficiency. Qwen2-VL's dynamic resolution encodes an image of size with exactly tokens — no padding waste. Combined with the naive resolution-scaling law that VLM performance improves as , this means doubling resolution costs more tokens but yields only units of improvement. The practical optimum balances this diminishing return against the LLM's attention cost, typically landing at -px for 7B-class models.
Compare LLaVA-NeXT-34B, Qwen2-VL-7B, and InternVL2.5-8B for a document understanding task that requires reading tables from scanned PDFs. Which would you choose?
Model Selection Criteria
Choosing the right VLM depends on several factors:
| Criterion | Closed (API) | Open (Self-hosted) |
|---|---|---|
| Performance | Typically best | Close to SOTA |
| Cost | Per-token pricing | Fixed GPU cost |
| Privacy | Data leaves network | Fully on-premises |
| Fine-tuning | Limited/none | Full control |
| Latency | Variable (network) | Predictable |
| Maintenance | None | Significant |
Decision framework:
- Prototyping / research: Use GPT-4o API for best quality
- Production (non-sensitive data): Evaluate cost of API vs. self-hosting at your volume
- Production (sensitive data): Open model, on-premises
- Edge/mobile: Phi-3-Vision or quantized Qwen2-VL-2B
- Domain-specific: Fine-tune open model on domain data
The cost-efficiency frontier follows an approximate power law: with - across current VLMs. This means a increase in per-query cost (e.g., switching from Qwen2-VL-7B to GPT-4o) yields only improvement in benchmark score. For volume-sensitive applications processing queries per month, the break-even point where self-hosting becomes cheaper than API is approximately , where is the monthly GPU cost and are per-query costs.
A startup wants to build a product that analyzes fashion photos and suggests outfit improvements. They have 10,000 fashion expert-annotated image-text pairs. What VLM strategy should they use?
Theory Exercise
Problem:
You are building a visual search engine for an e-commerce platform with 50 million product images. Users upload a photo and expect to find similar products. Evaluate three approaches: (1) CLIP-based image retrieval, (2) VLM-based description + text search, (3) Hybrid approach. Consider latency, accuracy, and infrastructure requirements.
Hints:
- Think about the index size for 50M images with each approach
- Consider whether real-time VLM inference is feasible at search-time
- Think about how text search can handle visual similarity that is hard to describe