Large Language-and-Vision Assistant
Haotian Liu, Chunyuan Li, Qingyang Wu, Yong Jae Lee
Read the Paper on arXivLLaVA (Large Language-and-Vision Assistant) introduced a surprisingly simple yet powerful recipe for building multimodal AI: connect a pre-trained vision encoder (CLIP ViT-L/14) to a large language model (Vicuna/LLaMA) through a lightweight projection layer, then train in two stages — first align visual and language representations, then instruction-tune for general-purpose visual understanding.
The core insight: You don't need complex cross-attention modules, Q-Formers, or perceiver architectures to build a strong vision-language model. A simple linear projection (LLaVA 1.0) or 2-layer MLP (LLaVA 1.5) connecting frozen CLIP features to the LLM's embedding space is sufficient — when combined with high-quality instruction-following data.
A second key contribution: Using language-only GPT-4 to generate multimodal instruction-following data from image captions and bounding boxes. This produced 158K high-quality training samples (conversations, detailed descriptions, complex reasoning) without any human annotation of visual instruction data.
LLaVA 1.5 improved on the original with three targeted changes — an MLP projection, higher-resolution CLIP (336px), and academic VQA data — achieving state-of-the-art on 11 benchmarks while training on a single 8-A100 node in ~1 day.
Model configurations:
| LLaVA 1.0 (13B) | LLaVA 1.5 (13B) | |
|---|---|---|
| Vision Encoder | CLIP ViT-L/14 (224px) | CLIP ViT-L/14 (336px) |
| Visual Tokens | 16 x 16 = 256 | 24 x 24 = 576 |
| Projection | Linear (1024 to 5120) | 2-layer MLP (1024 to 5120) |
| LLM | Vicuna-13B v1.3 | Vicuna-13B v1.5 |
| Stage 1 Data | 595K CC3M filtered | 558K LAION-CC-SBU |
| Stage 2 Data | 158K LLaVA-Instruct | 665K mixed |
| Training | 8x A100, ~14 hours | 8x A100, ~26 hours |
LLaVA demonstrated that the data and training recipe matter more than architectural complexity — a lesson that influenced subsequent multimodal models including LLaVA-NeXT, InternVL, and Qwen-VL.
Click any topic to jump in
CLIP ViT-L/14 encodes a 336-px image into 576 visual tokens — the raw substrate for multimodal reasoning.
A single MLP maps 1024-d CLIP features into the 4096-d LLM embedding space, the sole bridge between modalities.
Projected visual tokens are concatenated with text tokens — no architectural change to the transformer.
GPT-4 distills captions and bounding boxes into 158K multimodal conversations, descriptions, and reasoning samples.
Stage 1 aligns the projector on captions; Stage 2 jointly tunes projector + LLM on instruction data.
Higher resolution (336²), MLP projector, and VQA data push LLaVA to SOTA on 11 benchmarks with ~1.2M samples.
85.1% relative GPT-4 score shows data quality and a minimal architecture beat raw scale.
LLaVA converts images into a sequence of visual tokens using a frozen CLIP vision encoder. These tokens are then projected into the language model's embedding space, allowing the LLM to "see" images as naturally as it reads text.
Large language models process sequences of discrete text tokens, but images are continuous 2D grids of pixels. To build a multimodal model, we need to convert images into a format the LLM can process:
Previous approaches used complex bridging architectures:
LLaVA's approach is radically simple: use CLIP ViT-L/14 as a frozen feature extractor, take the grid features (not the [CLS] token), and project them into the LLM's word embedding space.
Step 1: Image to patches
The image is divided into non-overlapping patches:
LLaVA 1.0: Input image, patch size pixels
LLaVA 1.5: Input image, patch size pixels
Step 2: Patch embedding
Each patch is linearly embedded into a -dimensional vector:
A learnable [CLS] token is prepended, and positional embeddings are added.
Step 3: ViT Transformer processing
The patch tokens pass through 24 Transformer layers (ViT-L has 24 layers, 16 heads, ):
Critical choice: LLaVA uses features from the second-to-last layer (layer 23 of 24), not the final layer. The final layer of CLIP is trained with a contrastive loss that produces abstract, global features optimized for image-text matching. The penultimate layer retains more localized, spatial information — individual objects, textures, spatial relationships — which is more useful for visual question answering.
Step 4: Grid features output
The [CLS] token is discarded. The remaining grid features become the visual token sequence:
These visual tokens are now ready for projection into the LLM's embedding space. Each token represents a pixel region of the image and carries rich semantic features learned from CLIP's 400M image-text training pairs.
Why CLIP specifically?
CLIP's vision encoder is trained with a contrastive language-image objective, so its features are already aligned with language semantics. A dog patch produces features that are close (in CLIP space) to the word "dog" — this makes the projection layer's job much easier than starting from a vision-only encoder like ImageNet-trained ViTs.
CLIP ViT-L/14 is kept completely frozen during both training stages — no gradients flow back to the vision encoder. This preserves CLIP's robust visual representations learned from 400M image-text pairs
Grid features, not [CLS]: LLaVA uses all spatial tokens ( or ), discarding the global [CLS] token. This preserves spatial layout — the LLM knows where things are, not just what the image contains
Penultimate layer features (layer 23/24) retain localized spatial properties. The final layer is too abstract (optimized for global contrastive matching) — ablations showed a 0.96% accuracy drop using final-layer features on ScienceQA
Resolution matters: Moving from 224px (256 tokens) to 336px (576 tokens) in LLaVA 1.5 improved performance across all benchmarks by capturing finer details — especially for text-heavy and detail-oriented visual questions
Each visual token represents a pixel patch ( 4-6% of image width) — roughly the granularity of a single word in text. This makes the image-as-tokens metaphor surprisingly apt
Each 14×14×3 = 588-dimensional flattened patch is projected to 1024 dimensions. Positional embedding E_pos is added to encode spatial location in the grid.
ViT_{L-1} denotes the penultimate layer output. For 224px: n=256, for 336px: n=576. These 1024-dim features carry both semantic and spatial information from CLIP pre-training.
A image is cut into non-overlapping patches. Each patch is flattened to a vector in and linearly projected, yielding a grid of visual tokens that the frozen CLIP ViT-L/14 encoder refines into rich semantic features .