NeurIPS 2026

Retrieval Heads Meet Vision

Uncovering How VLMs Locate and Extract Visual Information

1 KAIST  ·  2 Independent Researcher
Poster #S3403· Wed, Dec 9, 10:00 AM – 1:00 PM AEDT· Hall 1-4, ICC Sydney· NeurIPS page
Teaser: On visual grounding (left) and visual question answering (right), masking the Visual Retrieval Heads redirects attention away from the ground-truth referent. The model still produces a fluent, well-formatted answer, but it is delocalized and visually unfaithful.

Figure 1. Visual Retrieval Heads mediate visual reference resolution in VLMs. We identify a sparse set of attention heads, Visual Retrieval Heads (VRHs), that route visual evidence from the image region named in the text prompt to the output. On visual grounding (left), masking the VRHs moves prediction-stage attention away from the ground-truth referent, and the predicted box no longer covers it. The same heads, found only from grounding data, also matter for visual question answering (right): with them masked, attention leaves the referred object and the answer is fluent but does not match the image. Yellow boxes mark ground-truth referents. Dashed ellipses mark where attention vanishes after VRH masking.

TL;DR
A sparse set of attention heads (1.7–2.6% of all heads) controls where a VLM retrieves visual evidence. Mask these Visual Retrieval Heads and grounding accuracy drops by up to 80 points. Mask the same number of random heads and accuracy barely changes.
1.7–2.6%
of all attention heads
the top-20 heads of each model
−80pts
grounding accuracy drop
with the top-20 VRHs masked
11
VLMs tested
5 grounding + 7 VQA benchmarks
5–10
examples to detect them
masking works as well as with 200
Video and poster

The paper in two minutes

A silent overview of the problem, the method and the main results. Come see the poster in Sydney on Wed, Dec 9 (10:00 AM – 1:00 PM AEDT, Hall 1-4, #S3403).

Abstract

Vision-language models (VLMs) can locate an image region referred to by a text prompt and route the corresponding visual evidence to the output, yet the internal mechanism behind this behavior is not understood. Inspired by retrieval heads in large language models, we ask whether VLMs contain an analogous mechanism for visual retrieval. We answer affirmatively by introducing Visual Retrieval Heads (VRHs), a small subset of attention heads (about 1.7–2.6%) that are causally responsible for grounding text descriptions to image regions.

To find them, we recast existing head-scoring methods under a unified design space over query tokens, key aggregation, and cross-sample aggregation. We then show that scoring attention from output prediction tokens with a sum over the ground-truth referent region most reliably identifies causal heads. Across four VLMs and five referring-expression benchmarks, masking only the top 20 VRHs reduces grounding accuracy by up to 80 percentage points, while masking the same number of random heads has little effect.

Beyond replicating the causal–sparse–universal triad established for text retrieval heads, VRHs exhibit several properties not previously reported: they generalize across visual reference tasks, remaining causal on attribute, spatial, counting, and visual-math benchmarks despite being discovered through bounding-box prediction; they are functionally specific, preserving output format while corrupting localization; and they are architecturally shared, transferring causally across VLMs that share an LLM backbone but differ in vision encoder, projector, and instruction tuning.

The Question

A needle-in-a-haystack, but for vision

In LLMs, a handful of retrieval heads route the right input token to the output during long-context recall. They are causal, sparse, and universal. Do VLMs have an analogue for finding the right image region?

Causal

Ablating them breaks retrieval and leaves the output fluent, so the model needs them for the task.

Sparse

A few percent of all heads carry the behavior. Perturbing the other heads has little effect.

Universal

They appear across model families and scales, which points to a shared internal mechanism.

OCR Heads and VERA study text rendered inside images. Localization Heads work on general images, but they select heads by the shape of their attention and do not test whether the heads are causally necessary. VRHs are the first heads shown to be causally responsible for visual retrieval from general images.

Specialized headsVisual retrieval sourceCausally validated?
Retrieval Heads (Wu et al.)Text (long context) yes
QRHeadText (long context) yes
OCR HeadsRendered text in images yes
VERAVisual documents yes
Localization HeadsGeneral images no
Visual Retrieval Heads OursGeneral images yes

Table 1. VRHs are the first attention heads shown to be causally responsible for visual retrieval from general images.

Method

How to find the heads that matter

We use referring-expression visual grounding as a probing task: given an image and an expression, the model must output a bounding box. The ground-truth box marks which visual tokens the model should read from.

One formula behind every head-scoring method

Prior methods all score a head by how strongly it attends from a set of query tokens to the key tokens in the evidence region. For grounding, we let the key tokens be the visual tokens overlapping the ground-truth box. Written in one form:

score (l,h) = Ωs∈S [ 1|Qs| Σt∈Qs Φj∈Ks αl,h (t,j) ]
Qs: query tokens Φ: key aggregation over the region Ω: cross-sample aggregation

Existing methods are different choices along these three axes. We build all 23 combinations, mask each variant's top heads, and keep the variant whose masking lowers grounding accuracy the most. Pick a setting below to see which method it corresponds to.

Query tokens  Qs
Key aggregation  Φ
Cross-sample  Ω
This setting corresponds to
VRH Ours · default
Scoring attention from output prediction tokens with a sum over the referent region, averaged across samples. This is the variant whose top heads are most causally important for grounding.
(Qout, Φsum, Ωavg)

Table 2 and the design space. The two aggregation axes change the result little. The query-token set matters most: scoring from output tokens, the tokens the model generates for its answer, gives the strongest causal signal.

Causal validation picks the winner

Bar charts across four VLMs. Masking the top-20 heads found by our default variant causes the largest accuracy drop relative to the unmasked model; flipping the query-token axis recovers the most accuracy, while flipping key or sample aggregation barely changes the result.

Figure 2. Causal validation of head-scoring variants (RefCOCO, four VLMs). We mask each variant's top-20 heads and report grounding accuracy (lower means the masked heads matter more). Our default (Qout, Φsum, Ωavg) gives the largest drop. The Qs, Φ and Ω bars each flip one axis, and Δ is the gap to Ours. Flipping the query-token set changes the result most.

How we mask a head

To test a head's causal contribution, we zero the attention output of head (l, h) before it is added to the residual stream. Every other head, MLP and layer norm is left unchanged. Text retrieval heads were tested with the same intervention, so the results are comparable. All experiments run on a single 48 GB GPU.

Results

Causal, sparse, and universal

Across four VLMs and five grounding benchmarks, masking a few VRHs lowers grounding accuracy far more than masking random heads or heads found by prior methods.

Masking VRHs hurts more than masking prior head sets

Line plots of grounding accuracy versus number of masked heads k, for four VLMs. Masking VRHs (Ours) drops accuracy far faster than masking Retrieval Heads, OCR Heads, VERA, Localization Heads, or random heads.

Figure 3. Comparison with existing specialized heads (RefCOCO). As k grows, masking the top-k VRHs lowers grounding accuracy much faster than masking the top-k heads of Retrieval Heads, OCR Heads, VERA or Localization Heads, or k random heads.

Universal across models and benchmarks

RefCOCO-average grounding accuracy after masking Visual Retrieval Heads or random heads across four VLMs. RefSpatialBench grounding accuracy after masking Visual Retrieval Heads or random heads across four VLMs. Toloka grounding accuracy after masking Visual Retrieval Heads or random heads across four VLMs.

Figure 4. Universality of VRHs. Grounding accuracy after masking the top-k VRHs in four VLMs on RefCOCO/+/g (average), RefSpatialBench and Toloka. Masking a few VRHs (red) causes large drops in every model and benchmark. Masking the same number of random heads (gray) barely changes accuracy.

The same holds in all 11 VLMs we tested

RefCOCO grounding accuracy of eleven VLMs with no masking, with 20 random heads masked, and with the top-20 Visual Retrieval Heads masked. Masking the VRHs drops accuracy to 5 to 32 percent in every model.

Figure 6. Eleven VLMs (RefCOCO, k=20). No masking vs. 20 random heads masked vs. the top-20 VRHs masked. Besides the four main VLMs, the figure covers Magma-8B, LLaVA-NeXT-Llama3-8B, PaliGemma2-10B, DeepSeek-VL2-Small, InternVL2.5-8B, GLM-4.6V-Flash and Phi-4-Reasoning-Vision (Llama-3, Gemma 2, DeepSeekMoE, InternLM2.5, GLM and Phi backbones). Masking the VRHs drops accuracy to 5.0–32.1% in every model.

Concentrated in a sparse few

Fewer than 15% of heads score above 10−3, and 0–4% score above 5×10−3, depending on the model. Masking these few heads is enough to break grounding. Retrieval heads in LLMs are sparse in the same way.

Stacked horizontal bars for four VLMs showing the fraction of heads with score in (0,1e-3], (1e-3,5e-3], and greater than 5e-3. The vast majority of heads have negligible scores.

Figure 5. Sparsity of VRH scores (RefCOCO). Distribution of head scores across the four VLMs; only a small fraction of heads score above 10⁻³.

Try it

Toggle the heads, trace the visual evidence

An interactive version of Figure 1. Switch between all heads, the top-20 VRHs alone and all heads except the VRHs. The map shows where the model looks, and the box shows whether it stays on target.

Attention map overlaid on the input image for the selected set of attention heads. Attention · all heads click to step
RefCOCO
Example
Attention from

RefCOCO grounding accuracy 86.2%
All heads active (the full model).
Ground truth Prediction Attention

Attention overlays are qualitative examples from the paper (Qwen2.5-VL-7B). Accuracies are dataset-level numbers from the appendix (RefCOCO, Toloka). Masking the top-20 VRHs (2.6% of heads) breaks grounding, and masking the same number of random heads barely changes it.

Steer it

Point at an object to redirect the visual evidence

Each object has its own color. Move the cursor over one to highlight it. We then force the top-20 Visual Retrieval Heads to attend only to that segment, and the precomputed output shows how the predicted box (red) changes.

Input image; move the cursor over an object to steer the VRHs to it. move the cursor over an object
Task
Color-coded object segments Steered predicted box

Each object segment is an automatic mask; steering forces the top-20 VRHs’ attention uniformly onto the pointed segment (decode-only, matching how VRHs were detected). Boxes are precomputed object-locate outputs from Qwen3-VL-8B. The showcase omits incomplete or unusable segment outputs; steering can redirect a prediction, but is not guaranteed to match every selected segment.

Where they live

The Visual Retrieval Head map

Every cell is one attention head, arranged by layer (rows) and head index (columns). The top-20 VRHs are highlighted. They sit in the middle layers. Hover to inspect a head.

↑ early layersQwen2.5-VL-7B · RefCOCOlate layers ↓
head 0head index →head 27

Sparse & localized

For Qwen2.5-VL-7B, 20 of 784 heads (2.6%) form the VRH set, all in layers 14–19.

Hover a glowing cell …
rank 20
rank 1

Top-20 (layer, head) indices are taken verbatim from the paper's appendix.

What makes them special

Four properties beyond the triad

VRHs are causal, sparse and universal like text retrieval heads. They also have the four properties below.

01
Generalize

One set of heads, many tasks

The heads are detected from bounding-box grounding only. Masking them also lowers accuracy on attribute, spatial, counting, vision-centric and visual-math benchmarks.

02
Functionally specific

Well-formed but mislocated

With VRHs masked, the output keeps its format: the box still parses and the sentence still reads well. What breaks is where the model looks. Text retrieval heads show the same failure in LLMs.

03
Architecturally shared

Shared by same-backbone VLMs

Heads found in one VLM also break grounding when masked at the same indices in another VLM with the same LLM backbone, even though the vision encoder, projector and instruction tuning differ.

04
Stably detectable

A handful of examples suffice

The result does not depend on which output tokens are scored. Heads detected from only 5–10 annotated grounding examples break grounding as much as heads detected from 200.

① Generalization across visual reference tasks

Masking the top-20 VRHs detected on RefCOCO lowers accuracy on seven VQA benchmarks in all four VLMs. Masking 20 random heads changes accuracy by at most 4.6 points.

ModelCondition VAWSpatial457SpatialRGPTCV-BenchMMStarCountBenchQAMathVista

Table 3. Cross-task generalization. Red = drop under VRH masking (k=20). Random masking (k=20) stays near the baseline.

② Functional specificity and stable detection

Stacked bars decomposing grounding outcomes into correct predictions, mislocations, and parse failures under Visual Retrieval Head and random-head masking.
(a) Functional specificity
Grounding accuracy when Visual Retrieval Heads are detected from a random output token or all output tokens.
(b) Output-token robustness
Grounding accuracy after detecting Visual Retrieval Heads from five to two hundred examples.
(c) Sample-size robustness

Figure 8. Qwen2.5-VL-7B on RefCOCO, k=20. (a) With VRHs masked, most predictions are still valid boxes but mislocated. The control, random heads plus selected first-layer (L0) heads, breaks the output format instead (parse failures). (b) Heads detected from one random output token or from all output tokens both lower accuracy to about 7% when masked (random heads: 86.0%). (c) Heads detected from 5 to 200 samples all lower accuracy to 7–8% when masked.

Masking VRHs keeps the form of the output and breaks its visual evidence: a well-formed box around the wrong region.

Text retrieval heads show the same fluent-but-unfaithful failure in LLMs. Here the model keeps answering in the expected format after it stops looking at the referent.

“glass top left of table” RefCOCO

Input image for the glass grounding example.
Input
All-head attention for the glass grounding example.
All heads
Top Visual Retrieval Head attention for the glass grounding example.
Top-20 VRHs
Attention and prediction after masking Visual Retrieval Heads for the glass grounding example.
VRHs masked

“left orange” RefCOCO

Input image for the orange grounding example.
Input
All-head attention for the orange grounding example.
All heads
Top Visual Retrieval Head attention for the orange grounding example.
Top-20 VRHs
Attention and prediction after masking Visual Retrieval Heads for the orange grounding example.
VRHs masked

“part of sheep on the left” RefCOCO

Input image for the sheep grounding example.
Input
All-head attention for the sheep grounding example.
All heads
Top Visual Retrieval Head attention for the sheep grounding example.
Top-20 VRHs
Attention and prediction after masking Visual Retrieval Heads for the sheep grounding example.
VRHs masked

“What will I need to play tennis?” Toloka

Input image for the tennis grounding example.
Input
All-head attention for the tennis grounding example.
All heads
Top Visual Retrieval Head attention for the tennis grounding example.
Top-20 VRHs
Attention and prediction after masking Visual Retrieval Heads for the tennis grounding example.
VRHs masked

“Where do we drink water?” Toloka

Input image for the drinking-water grounding example.
Input
All-head attention for the drinking-water grounding example.
All heads
Top Visual Retrieval Head attention for the drinking-water grounding example.
Top-20 VRHs
Attention and prediction after masking Visual Retrieval Heads for the drinking-water grounding example.
VRHs masked

Attention maps on visual grounding. Left to right: input, all heads, the top-20 VRHs only, and the model with the VRHs masked. Attention concentrates on the referent with all heads, and the top-20 VRHs alone show the same pattern. With the VRHs masked, attention spreads out and the predicted box (red) misses the ground truth (green).

Ground-truth box Predicted box Attention mass
Input image for the bicycle-color question.
Input
Top Visual Retrieval Head attention for the bicycle-color question.
Top-20 VRHs
All-head attention for the bicycle-color question.
All heads
Attention after masking Visual Retrieval Heads for the bicycle-color question.
VRHs masked

“The bicycle has what color?”

All heads: blue · correct   VRHs masked: gray · wrong

Input image for the small-truck-color question.
Input
Top Visual Retrieval Head attention for the small-truck-color question.
Top-20 VRHs
All-head attention for the small-truck-color question.
All heads
Attention after masking Visual Retrieval Heads for the small-truck-color question.
VRHs masked

“What color is the small truck?”

All heads: yellow · correct   VRHs masked: purple · wrong

Input image for the line-color question.
Input
Top Visual Retrieval Head attention for the line-color question.
Top-20 VRHs
All-head attention for the line-color question.
All heads
Attention after masking Visual Retrieval Heads for the line-color question.
VRHs masked

“What color is the line?”

All heads: yellow · correct   VRHs masked: green · wrong

Input image for the bear-color question.
Input
Top Visual Retrieval Head attention for the bear-color question.
Top-20 VRHs
All-head attention for the bear-color question.
All heads
Attention after masking Visual Retrieval Heads for the bear-color question.
VRHs masked

“What color is the bear?”

All heads: tan · correct   VRHs masked: brown · wrong

Attention maps on visual question answering. Each panel shows the input (green = ground-truth region), the top-20 VRH attention, all-heads attention, and attention after masking the VRHs. With VRHs intact the answer is correct. With VRHs masked, attention leaves the evidence and the answer is still fluent but no longer matches the image.

③ Shared across same-backbone VLMs

Top row: layer-head score maps for same-backbone VLM pairs look strikingly similar, with high top-20 overlap and Spearman correlation. Bottom row: masking the VRHs found in one model, at the same indices in its same-backbone sibling, causes a large accuracy drop.

Figure 7. Same-backbone VLM pairs (RefCOCO). Pairs: Qwen2.5-VL-7B / InternVL3-8B (Qwen2.5-7B), Qwen3-VL-8B / InternVL3.5-8B (Qwen3-8B), Magma-8B / LLaVA-NeXT-8B (Llama-3-8B). Top: the layer-head score maps of each pair look alike (top-20 overlap 14–18 of 20, Spearman ρ 0.89–0.91). Bottom: masking one model's top-k VRHs at the same indices in its partner also breaks grounding. For the Llama-3 pair, Magma-8B drops from 68.8% to 0.0% and LLaVA-NeXT-8B from 85.8% to 5.8%.

Applications

Reusing the heads

The heads detected on RefCOCO can be reused as they are. The first two results below are new and not in the paper. They use no training and no head re-detection.

KV-cache compression and multi-image QA Not in the paper

Left: grounding accuracy versus visual KV budget for SnapKV, AdaKV, SparseMM and VRH scores; VRH scores give the highest accuracy at every budget. Right: on Visual Haystacks with 10 images, top-20 VRH attention selects the referenced image in 86.0 percent of cases and raises answer accuracy to 82.4 percent.

Left: visual KV-cache compression (Qwen2.5-VL-7B, RefCOCOg). We keep SparseMM's rule for splitting the visual KV budget across heads and only replace its head scores with VRH scores. Right: multi-image QA (Qwen3-VL-8B, Visual Haystacks, 10 images). All images and the question go through one prefill, each image is scored by the attention of the top-20 VRHs on its visual tokens, and the same VLM answers from the highest-scoring image.

81.0% vs. 73.2%

Grounding accuracy at a 2% visual KV budget with VRH scores vs. SparseMM's head scores. The full cache gives 85.7%.

86.0% vs. 57.6%

How often the referenced image is ranked first, with VRH attention vs. the MIRAGE retriever (CLIP: 54.2%). Answer accuracy rises from 72.6% with MIRAGE's selection to 82.4%.

Preference optimization (paper appendix)

Following Ma et al.'s recipe for text retrieval heads, we use a VRH-masked model as the negative policy for direct preference optimization (DPO). The rejected responses then carry the failure we want to remove: answers produced without the VRHs.

The gains are small but consistent: +0.78 points on average across three grounding benchmarks, and larger than with a random-head-masked negative policy.

DPO accuracy comparison across three benchmarks: using VRH-dropping to build negative responses yields stronger gains than random-head dropping.

Figure A3. DPO with VRH-based negatives. Perturbing causally relevant heads gives a more informative preference signal than random-head dropping.

Summary

What we learned

A few heads carry the visual evidence

A sparse set of attention heads carries visual evidence from the region named in the text to the output. Masking only these heads breaks grounding.

The same heads serve other tasks and models

Masking them also lowers accuracy on attribute, spatial, counting and visual-math questions. Heads found in one VLM transfer to VLMs with the same LLM backbone.

Cheap to find and reuse

5–10 annotated examples are enough to find them. The same heads can guide KV-cache compression, image selection and DPO training.

Limitations and next steps. Attention shows where evidence comes from, not what is read out. The paper studies single-image inputs. Next steps are activation patching and causal mediation analysis, and video and interleaved image-text inputs. The KV-cache and multi-image results above are a first look at applications.

Citation

BibTeX

@inproceedings{park2026retrievalheads,
  title     = {Retrieval Heads Meet Vision: Uncovering How VLMs
               Locate and Extract Visual Information},
  author    = {Park, Chanho and Choi, Daehyeon and Lee, Jihyun
               and Sung, Minhyuk},
  booktitle = {Advances in Neural Information Processing Systems},
  year      = {2026}
}