Multimodal & Vision-Language Model Architecture

Multimodal & Vision-Language Model (VLM) Architecture

Provenance: reference under the ai-agent-engineering hub. Built via /dr deep-research, 2026-05-31. Owns the “how a text-only transformer becomes multimodal” layer — the vision/audio/video front-end and how it fuses into the decoder. EXTENDS transformer-architecture to other modalities; the decoder block itself (attention/MoE/RoPE/norm) lives there.

This reference answers one question: how do you turn a text-only decoder LLM into a model that can see (and hear)? Every other model-layer reference in the hub (transformer-architecture, llm-pretraining-scaling-laws, llm-fine-tuning-peft, …) is about a text decoder. This one is the front-end and fusion machinery bolted onto that decoder so it can consume images, video, and audio.

The one mental model: the “modality → tokens → residual stream” pipeline. A decoder LLM only consumes a sequence of d_model-dimensional vectors (token embeddings) on its residual stream. So every modality must become a sequence of d_model vectors that live in the same space as text-token embeddings. Three jobs:

  1. Encode the raw modality (pixels, audio, frames) into feature vectors — the vision encoder (or audio encoder).
  2. Connect / project those features into the LLM’s embedding dimension and (usually) reduce their count — the connector / projector.
  3. Fuse the resulting “visual tokens” with the text tokens so the decoder attends across both — the fusion strategy.

Almost the entire VLM zoo is a choice of {encoder} × {connector} × {fusion} × {resolution handling} × {training stages}. The dominant recipe in 2024-2026 is simple: a SigLIP/CLIP ViT encoder → a 2-layer MLP projector → concatenate visual tokens in front of text tokens → feed one decoder (the “LLaVA recipe”). Everything else is a variation on, or a deliberate rejection of, that recipe. Scope: image/video/audio understanding + the discrete-token generation path (Chameleon-style); NOT diffusion/DiT image-generation internals.

1. Vision encoders (ViT / CLIP / SigLIP / DINOv2 / EVA)

Nearly all VLMs encode images with a Vision Transformer (ViT): split the image into fixed-size patches (e.g. 14×14 px), linearly embed each patch, add position embeddings, run transformer blocks. A 336×336 image at patch-14 → 24×24 = 576 patch tokens. What matters is how that ViT was pretrained:

Mixture-of-encoders: Eagle (NVIDIA, arXiv 2408.15998) found concatenating tokens from complementary encoders (CLIP/SigLIP semantics + DINOv2 spatial + OCR-specialized) is as good as complex fusion, and stronger perception measurably reduces hallucination + helps OCR.

Frozen vs trained: early VLMs froze the encoder; the 2024-2026 trend trains the ViT (often from scratch, native-resolution) — Qwen2.5-VL and Pixtral train new ViTs. transformer-architecture owns the ViT’s transformer block; this owns what makes it a vision encoder.

2. The connector / projector (MLP vs Q-Former vs cross-attention)

The encoder emits ~576 vectors of dim d_vis; the decoder wants d_model vectors, ideally fewer (image tokens are expensive KV). The connector does dimension-matching + token-count reduction:

Pick: MLP-concat = simplest, best detail, most tokens. Resampler = fixed small budget, good for many-image/video/frozen. Cross-attention = keep the LLM frozen, bolt vision on the side.

3. Fusion strategy (unified/early-fusion vs cross-attention vs late fusion)

The most important architectural axis — distinct from the connector:

Mental model: unified-concat fuses at the input (shares all layers); cross-attention fuses in the middle (frozen-LLM friendly); late fusion fuses at the output (retrieval, not generation). 2024-2026 consensus = unified-concat with a trained decoder; cross-attention persists where a frozen base LLM matters.

4. Native any-to-any & image tokenization (Chameleon, VQ-VAE/VQGAN, Fuyu)

A radical design drops the separate encoder + connector by turning images into discrete tokens from a vocabulary, like text BPE — one transformer, one vocabulary, can generate images too:

When it matters: if you need ONE model to understand and generate images, the discrete-token/native path is the only single-model option; understanding-only is simpler + higher-fidelity via encoder+MLP.

5. High-resolution & dynamic tiling (AnyRes, InternVL tiles, NaViT)

A vanilla CLIP/SigLIP ViT runs at fixed low resolution (224/336) — fails on documents, dense text, charts. Three solutions:

Arc: fixed-336 CLIP → tile a fixed encoder (AnyRes) → train a native-resolution ViT.

6. Audio, video, speech (Whisper encoders, audio tokens, frame sampling, omni)

The encode→connect→fuse pipeline generalizes:

7. Multimodal position encoding (2-D RoPE, M-RoPE)

A text RoPE (→ transformer-architecture for the base mechanism) encodes a 1-D position — wrong for an image (row, column) and video (+ time):

Why: get this wrong and the model reads an image but can’t reason about where (“is the cat left of the dog?”, “top-right table cell?”). M-RoPE is the cheap fix for spatial grounding.

8. VLM training stages (projector-align → visual instruction tuning → multimodal preference/DPO)

The canonical multi-stage recipe (LLaVA) — about which component is frozen/trained per stage, not LoRA mechanics (→ llm-fine-tuning-peft) or preference-loss math (→ llm-alignment-post-training):

  1. Stage 1 — projector / feature alignment. Freeze encoder + LLM, train only the connector on image-caption pairs (LLaVA: CC3M subset). Teaches the projector to map visual features into the LLM’s space. Cheap, fast.
  2. Stage 2 — visual instruction tuning (the “SFT” of VLMs). Unfreeze the LLM (often projector; sometimes encoder) and train on multimodal instruction data — (image, instruction, response) triples (VQA, OCR, reasoning, grounding). LLaVA generated this data by prompting text-only GPT-4 with captions/boxes. Turns a captioner into an instruction-follower. Modern recipes add an encoder high-res stage; “native multimodal pretraining” folds multimodal data into base pretraining.
  3. Stage 3 — multimodal preference / alignment (hallucination reduction). RLHF or DPO with multimodal preference data to cut hallucination (#1 VLM failure) + improve helpfulness. LLaVA-RLHF / Fact-RLHF (arXiv 2309.14525): ~10k human prefs over which response is more hallucinated, Factually-Augmented RLHF feeds the reward model ground-truth (captions/boxes) so it isn’t fooled by fluent-but-wrong answers; improves MMHal-Bench. Trend → mDPO + self-rewarding (M3PO). The multimodal wrinkle: a naive text-only DPO can ignore the image — mDPO adds image-contrastive terms to force visual conditioning.

Why staged: Stage 1 protects pretrained weights while the random projector finds its footing; Stage 2 builds capability; Stage 3 buys trustworthiness. Skip Stage 1 → destabilize; skip Stage 3 → capable but hallucination-prone.

9. The VLM landscape (architectural map, mid-2026)

Read as what front-end + connector + fusion + resolution each uses (→ llm-models for selection/pricing):

Model Vision front-end Connector Fusion Resolution Notable
CLIP / SigLIP / SigLIP 2 (these are encoders) late (retrieval) fixed (SigLIP2 NaFlex native) SigLIP now preferred over CLIP for VLMs
Flamingo (2022) frozen CLIP-style Perceiver Resampler gated cross-attention fixed Originated tanh(α)-gated cross-attn
BLIP-2 (2023) frozen ViT Q-Former (32→32) unified-concat (frozen LLM) fixed Frozen-encoder + frozen-LLM bridge
LLaVA / 1.5 / NeXT CLIP ViT-L/14 linear → 2-layer MLP unified-concat 336 → AnyRes tiling Defined the dominant recipe + instruction tuning
Qwen2-VL / 2.5-VL / 3-VL native-res ViT from scratch (2-D RoPE, window attn) MLP merger unified-concat + M-RoPE native dynamic Variable res, hour-long video + absolute time
InternVL (1.5/2.5/3) InternViT (large) MLP after pixel-shuffle (¼) unified-concat dynamic tiling (1–12 → ~40, 4K) “ViT-MLP-LLM”; v3 native MM pretraining
Llama-3.2-Vision (2024) ViT-H/14 MLP/adapter gated cross-attention into frozen Llama-3.1 tiling Cross-attn to preserve text-only quality
Pixtral 12B (2024) new encoder from scratch, native MLP unified-concat native Beats larger models; OCR strength
Chameleon (2024) none (VQ-VAE tokens) none (shared vocab) early-fusion, single tokenizer fixed (512→1024 tok) True any-to-any image+text generation
Fuyu (Adept) none (linear patch proj) linear unified-concat (patches as tokens) arbitrary No encoder; decoder does all vision
Qwen2.5-Omni Whisper-v3 audio + ViT projectors unified-concat + Thinker-Talker dynamic Audio in + streaming speech out
GPT-4o / Gemini undisclosed, natively multimodal native native Reference points for “native”

Arc: Flamingo (cross-attn, frozen) → BLIP-2 (Q-Former, frozen everything) → LLaVA (MLP-concat, the recipe that won) → tiling for high-res → native-resolution from-scratch encoders (Qwen2.5-VL, Pixtral) for understanding, and Chameleon/native-omni for any-to-any generation.

10. Multimodal evaluation & hallucination (MMMU, MMBench, DocVQA, MathVista, POPE/MMHal)

Standard 2024-2026 suite (OpenVLM Leaderboard, run via VLMEvalKit, arXiv 2407.11691):