LLaVA Architecture › Key Architectural Parameters

Michael BrenndoerferFebruary 11, 20262 min read
Language AI HandbookAll chapters
Part 50 of 67Multimodal Models
Chapter 385LLaVA Architecture › Key Architectural Parameters
Reading section 9 of 14 · Key Architectural Parameters · 2 minSection 9 of 14 · 2 min

Book contents

Section 9 of 14 · 2 min read

LLaVA Architecture › Key Architectural ParametersOne section · Sections in this chapter9 / 14 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The key architectural parameters for LLaVA determine the model's capacity, resolution capabilities, and computational requirements. Understanding these parameters helps calibrate expectations when adapting LLaVA for different applications or when choosing between model scales.

  • vision_hidden_size: Dimension of the vision encoder's output features (1024 for CLIP ViT-L/14). This determines the size of visual representations before projection. Higher dimensions capture more visual detail but require larger projection matrices. Smaller CLIP variants use 768-dimensional features, while larger models can use up to 1280 dimensions.
  • llm_hidden_size: Dimension of the language model's embedding space (4096 for LLaMA-7B). The projection layer maps vision features to this dimension. This is typically the largest dimension in the system and determines the width of all subsequent transformer layers. LLaMA-13B uses 5120 dimensions, and larger models scale further.
  • num_patches: Number of visual tokens extracted from the image (576 for 336px resolution with 14px patches). This controls the spatial resolution of visual input. The formula is (H/P)×(W/P)(H / P) \times (W / P) where HH and WW are the image height and width and PP is the patch size. Higher resolution images processed with tiling can generate thousands of tokens.
  • MLP connector: A two-layer projection network with GELU activation that transforms vision features to language space. The intermediate dimension typically matches dLLMd_{\text{LLM}} (4096), maintaining constant width through the projection and giving the network enough capacity for non-linear alignment.

The number of visual tokens per image has a particularly strong influence on inference latency. With 576 tokens for a single 336px image, adding an image to the context is equivalent to adding a paragraph of text in terms of sequence length. For a 2x2 tiled image at 672px resolution, this becomes 2304 tokens, comparable to a full page of text. This has direct implications for user-facing applications where inference speed matters: models serving high-resolution image queries face a materially higher compute burden than those handling text-only queries or lower-resolution images.