arXiv(opens in a new tab)cs.CVAug 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2608.27417

Retrieval Heads Meet Vision: Uncovering How VLMs Locate and Extract Visual Information

Chanho Park, Daehyeon Choi, Jihyun Lee, Minhyuk Sung

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Chanho Park 1^{1} Daehyeon Choi 1^{1} Jihyun Lee 2^{2} Minhyuk Sung 1^{1}

1^{1}KAIST 2^{2}Independent Researcher

{charlieppark, daehyeonchoi, mhsung}@kaist.ac.kr

jihyunlee1027@gmail.com

Visual Grounding

"Black guy in"

Unmasked

Figure

[463, 150, 552, 358] (Correct)

VRH Masked

[1, 10, 644, 443] (Wrong)

Visual Question Answering

"The tiny bicycle is what color?"

Unmasked

Figure

The tiny bicycle in the image is located at the center-left and has a purple frame. Answer: Purple (Correct)

The image does not contain any a bicycle, but only cars and buses. Answer: No (Wrong)

Figure 1: Visual Retrieval Heads mediate visual reference resolution in VLMs. We identify a sparse set of attention heads, Visual Retrieval Heads (VRHs), that are causally necessary for resolving the image region referred to by the text prompt. On visual grounding (left), masking the VRHs redirects prediction-stage attention away from the ground-truth referent and causes the model to output a delocalized bounding box. The same heads, discovered only from grounding, also transfer to visual question answering (right): masking them removes attention to the referred object and leads to a fluent but visually unfaithful answer. Yellow boxes denote ground-truth referents; dashed yellow ellipses indicate regions where attention vanishes after VRH masking.

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 eleven 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.

Preprint.

1 Introduction

How do foundation models locate a specific piece of information buried in a long input context? This “needle-in-a-haystack” question has recently been answered, at least partially, for large language models (LLMs): a small set of attention heads called retrieval heads [1] is largely responsible for routing relevant input tokens to the output. These heads exhibit three properties that together make them a meaningful unit of analysis. They are causal: ablating them collapses long-context retrieval while leaving fluency intact. They are sparse: fewer than 5% of all heads carry the behavior. And they are universal: they appear across model families and scales, suggesting that long-context retrieval converges onto a shared internal mechanism rather than an idiosyncratic implementation.

This observation motivates our key question: whether Vision-Language Models (VLMs) contain an analogous mechanism for visual retrieval—locating an image region referred to by a text prompt and routing it to the output. Existing extensions of retrieval-head analysis to VLMs do not yet answer it. OCR Heads [2] and VERA [3] identify heads that retrieve textual evidence from images, but only when the image is itself a rendering of text; the retrieval target is still a string of characters, not a general visual concept. Localization Heads [4] move beyond rendered text and aim to identify heads whose attention maps align with referred objects, but the analysis stops at attention shape: the heads are not characterized by causal necessity.

In this work we ask whether causal, universal, and sparse retrieval heads exist in VLMs for general image retrieval, and how to find them. We answer affirmatively by introducing Visual Retrieval Heads (VRHs), a small subset of attention heads that are causally responsible for grounding text descriptions to image regions. We show that these heads share the defining properties of their text-only counterparts.

We use referring-expression visual grounding [5] as our probing task: given an image and a referring expression, the model must output a bounding box for the referent. This task makes the retrieval target spatially explicit; the ground-truth bounding box defines exactly which visual tokens the model needs to consult. This lets us define a head's contribution to retrieval by how strongly it attends from the model's prediction-stage tokens to the visual tokens inside that box.

Beyond identifying VRHs, our contributions are three-fold. First, on the methodology side, we observe that existing head-scoring methods can all be written in a single form, with a per-head score obtained by aggregating attention weights over a set of key tokens (the tokens to be retrieved) for each query token, and then aggregating these per-query scores across all queries. Under this view, prior methods differ along three axes: the query token set (input prompt tokens vs. output prediction tokens), the key aggregation (an argmax indicator for whether the most-attended key lies in the retrieval region vs. a summation of attention weights over the region), and the cross-sample aggregation (averaging scores across samples vs. voting). For visual grounding, we let the key tokens be the visual tokens that overlap the ground-truth bounding box, and we search this design space directly, scoring each variant by the drop in grounding accuracy when its top-ranked heads are masked. We find that the choice of key aggregation and cross-sample aggregation matters little, but the choice of query tokens matters a great deal: scoring at the output prediction stage with a sum over the retrieval region consistently identifies the most causally important heads. We adopt it as our default scoring function.

Second, on the empirical side, we demonstrate the causality, sparsity, and universality of the VRHs identified by our scoring function through comprehensive experiments across eleven VLMs built on eight language-model backbones [6–9, 27–33] and five grounding benchmarks (RefCOCO+/g [5, 10], RefSpatialBench [11], Toloka [12]). Masking the top 20 VRHs—about 1.7–2.6% of all heads—reduces grounding accuracy by up to 80 percentage points, while masking the same number of random heads has negligible effect, demonstrating their causal role.

Third, most importantly, our characterization of VRHs reveals four properties that distinguish them from previously studied heads. (i) VRHs generalize across visual reference tasks: although we discover them through bounding-box prediction, they remain causal on attribute, spatial reasoning, counting, and visual math benchmarks (VAW, Spatial457, SpatialRGPT, CV-Bench, MMStar, Count-BenchQA, MathVista) [13–19], suggesting that the mechanism they implement is visual reference resolution in general, not object grounding in particular. (ii) VRHs are functionally specific: masking them preserves output-format validity but the predicted box is delocalized, the visual analogue of the “fluent-but-not-factual” failure mode reported for text retrieval heads. (iii) VRHs are architec-turally shared: VRHs found in one VLM remain causally critical when masked in another VLM that shares the same LLM backbone but differs in vision encoder, projector, and instruction-tuning recipe. (iv) VRHs are stably detectable: results are consistent across output-token choices and scoring samples, with as few as 5 to 10 grounding examples recovering nearly the same top-ranked set as the full 200-example set.

References (29)