Multimodal Models·Question 29 of 67Advanced

Compare projector/adapter designs - MLP vs resampler vs cross-attention. How does the choice interact with the training recipe?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Three families:

  • Linear/MLP projection (LLaVA line): map every patch embedding into the LLM's embedding space, splice inline. Lossless - all visual detail reaches the LLM - and trivially simple, but token cost scales with resolution: with tiling, a single high-res image can be 2-3k tokens. The pragmatic modern compromise adds light pooling (e.g. 2×2 average of adjacent patch tokens) to cut tokens ~4× with modest loss.
  • Resampler / Q-Former (Flamingo's Perceiver Resampler, BLIP-2): a small transformer with N learned query vectors (~32-64) cross-attends into the patch features and outputs exactly N tokens regardless of input size. Constant, cheap token budget - great for interleaved many-image contexts and video - but it's a lossy information bottleneck: fixed capacity regardless of content is precisely wrong for dense documents, which is why resampler-based models historically lagged on OCR/document benchmarks and why the field swung back to MLP+tiling as document use cases became dominant.
  • Cross-attention insertion (Flamingo's gated cross-attn layers): vision never enters the token sequence; instead, new cross-attention layers interleaved into the frozen LLM read visual features directly. Zero context consumed, and gating (initialized to zero) provably preserves the base LLM at initialization - but you're modifying the LLM's architecture, adding parameters per layer, and complicating serving; it has largely lost to the inline-token approaches in open models (Llama 3.2 Vision was the notable 2024 exception, and Meta moved to an early-fusion design for Llama 4).
Full worked answer

Three families:

  • Linear/MLP projection (LLaVA line): map every patch embedding into the LLM's embedding space, splice inline. Lossless - all visual detail reaches the LLM - and trivially simple, but token cost scales with resolution: with tiling, a single high-res image can be 2-3k tokens. The pragmatic modern compromise adds light pooling (e.g. 2×2 average of adjacent patch tokens) to cut tokens ~4× with modest loss.
  • Resampler / Q-Former (Flamingo's Perceiver Resampler, BLIP-2): a small transformer with N learned query vectors (~32-64) cross-attends into the patch features and outputs exactly N tokens regardless of input size. Constant, cheap token budget - great for interleaved many-image contexts and video - but it's a lossy information bottleneck: fixed capacity regardless of content is precisely wrong for dense documents, which is why resampler-based models historically lagged on OCR/document benchmarks and why the field swung back to MLP+tiling as document use cases became dominant.
  • Cross-attention insertion (Flamingo's gated cross-attn layers): vision never enters the token sequence; instead, new cross-attention layers interleaved into the frozen LLM read visual features directly. Zero context consumed, and gating (initialized to zero) provably preserves the base LLM at initialization - but you're modifying the LLM's architecture, adding parameters per layer, and complicating serving; it has largely lost to the inline-token approaches in open models (Llama 3.2 Vision was the notable 2024 exception, and Meta moved to an early-fusion design for Llama 4).

Interaction with training: MLP projectors enable the cheap staged recipe - stage 1 trains only the projector (millions of caption pairs, both towers frozen), stage 2 unfreezes the LLM for instruction tuning; whether to unfreeze the vision encoder is a real decision (unfreezing helps at scale with enough data, but degrades the encoder on small budgets). Resamplers have more trainable capacity in the adapter itself, needing more stage-1 data. High-resolution support is its own late stage - you extend tiling after basic alignment. And the projector choice sets the KV-cache and prefill economics of every future inference: fixed-64-token images are 20-30× cheaper to serve than 2k-token images.

What a good answer covers

  • Linear/MLP projection (LLaVA line): map every patch embedding into the LLM's embedding space, splice inline
  • Resampler / Q-Former (Flamingo's Perceiver Resampler, BLIP-2)
  • Cross-attention insertion (Flamingo's gated cross-attn layers)
  • Interaction with training
  • Resamplers have more trainable capacity in the adapter itself, needing more stage-1 data

Key terms: Linear/MLP projection · Resampler / Q-Former · Cross-attention insertion

Interviewer follow-ups to expect

  1. Why did resampler-based models underperform on DocVQA?

  2. When would you unfreeze the vision encoder and what can go wrong?

  3. How does token-per-image count change multi-image and video capability?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep