acceptodds
Under review as a conference paper at ICLR 2027

ViT Attention Weight as a Hierarchical Tree

Abstract

While attention weights in Vision Transformers (ViTs) have become a central signal for tasks such as object localization, segmentation, and attribution, they still remain noisy and difficult to interpret. To address this, we analyze attention at the level of individual query-key pairs rather than aggregated attention weights. By defining the concatenation of query and key vectors as a *QK feature*, we first show that QK features exhibit structured patterns rather than forming a single homogeneous cluster. Based on this observation, we organize QK features into a hierarchical structure via recursive clustering, yielding a *QK tree* for each attention head. We verify that each node in the QK tree encodes a consistent semantic role, showing that distinct QK feature patterns capture distinct semantics. To interpret these roles, we introduce the *role card*, a diagnostic tool that visualizes the functional behavior of each node. Using this decomposition, we further identify *position-indicator nodes*, which show that spatial selectivity is localized within specific nodes rather than distributed across the entire head. Finally, we demonstrate that selecting a single *object-centric node* yields a simple and effective object localization method.

Primary area:
interpretability and explainable AI
Keywords:
Vision models, Interpretability, Attention

Reviews

Among:
Shape:
1234this paper, Top 30%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.67 over 3 reviews, above 70% of the others.
Reviewer_Le7SOpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
2
Read review
Paper summary

The paper argues that a ViT attention head should not be treated as a single homogeneous attention map. Instead, the authors analyze the joint query–key (QK) feature, i.e., the concatenation of a query vector and a key vector, and organize it into a hierarchy. The pipeline is: (1) record QK features from above-threshold attention pairs, (2) recursively cluster them with UMAP + HDBSCAN to build a per-head "QK tree", and (3) interpret each node via a "role card" that visualizes Q-side/K-side frequency maps, prototype images, and spatial displacement statistics.

The paper supports this with four sets of evidence: (i) QK features are multi-modal rather than a single cloud, validated against shuffled / covariance-matched / dimension-permuted / random nulls (Table 1); (ii) nodes at greater tree depth show higher semantic agreement, measured with a DINO-probe weighted-mean-direction statistic against a parent-matched null (Figure 3); (iii) role cards expose interpretable behaviors, including position-indicator nodes concentrated in early layers; (iv) selecting a single object-relevant node yields better saliency IoU than best-head or best-layer baselines on ECSSD / DUT-OMRON / DUTS-TE (Table 2). A causal knockout experiment (Appendix G) shows node removal perturbs the output more than size-matched random controls.

Critical strengths
  1. The QK-feature framing and the hierarchical decomposition are a genuine methodological contribution. Prior head-level work either aggregates attention maps or projects head contributions into an external embedding space. Directly partitioning the joint (q, k)distribution and validating multi-modality against several structured nulls (Table 1, Table 4) is a cleaner and more falsifiable approach. This matters because it makes the "attention head is not one thing" claim testable rather than rhetorical.

  2. The depth-dependent semantic coherence result is the strongest empirical finding. The monotonic increase of r with depth, replicated across four backbones, both Q and K sides, four layer groups (Figure 13), and two prototype counts k=10 and k=50 (Figure 14), and with the parent-matched null strictly dominated in all 24 cells, is a well-controlled result. It supports the central claim that deeper nodes are more semantically specific.

Critical weaknesses
  1. The localization result is the paper's main "actionable" claim, and it is the least clean part. Node selection uses 500 labeled DUTS-TR masks, while the method is presented as exposing structure that coarser aggregation obscures. The gains over best-head/best-layer are large and consistent (Table 2), so the empirical result stands, but the paper should either (a) present a label-free selection criterion, e.g., using the §5.2 semantic-consistency statistic or the position-indicator score, and report how much of the gain survives, or (b) explicitly reframe the contribution as "node-level selection given a small calibration set" rather than as a training-free localization method. As written, the abstract and introduction oversell the degree of supervision-freeness.

  2. The semantic-consistency evidence and the localization evidence are not connected. The paper argues that nodes carry consistent semantic roles and separately that one node localizes objects well, but it never checks whether the node selected by IoU is also the node with high r ̅_v^Q or a coherent role card. If the two criteria selected different nodes, the "semantic role" interpretation of the localization node would be undermined. A single correlation or case study linking the two would substantially strengthen the internal coherence of the paper.

Questions for authors
  1. In Table 2, the node-level method uses a fixed threshold of 0.5 while the head and layer baselines are allowed to choose among seven binarization rules. Could the authors report node-level results under the same rule-selection protocol, or alternatively report head/layer baselines at the fixed 0.5 threshold, to confirm the comparison is not driven by threshold flexibility?

  2. For the localization experiment, what happens if node selection uses only unlabeled criteria, e.g., ranking nodes by r ̅_v^Qor by position-indicator MI, on the same 500 DUTS-TR images without ground-truth masks? How much of the IoU gain over best-head is retained?

  3. Is the node chosen for localization in each backbone also among the nodes with the highest semantic agreement or the most coherent role card? A brief case study would clarify whether the two analyses identify the same structure.

  4. How many heads actually produce a tree of depth ≥ 2 under the main-paper configuration (s_"gate" =0.5, d_max=3)? The Dip-means splittable fractions in Table 1 are computed with a different procedure than the main pipeline, so the reader cannot directly tell what fraction of heads contribute non-trivial hierarchies to Figures 3 and 4.

    1. In Appendix G, the depth-2 ViT result loses significance when restricted to nodes covering at least 0.1% of the attention matrix. Does the paper's claim that deeper nodes are more functionally specific survive this restriction in the other backbones, or is the causal evidence effectively limited to depth-1 nodes?
7 comments
AuthorsOpenReview ↗

Weakness 1

W1. Label-based node selection vs. training-free framing

The localization result is the paper's main "actionable" claim, and it is the least clean part. Node selection uses 500 labeled DUTS-TR masks, while the method is presented as exposing structure that coarser aggregation obscures. The gains over best-head/best-layer are large and consistent (Table 2), so the empirical result stands, but the paper should either (a) present a label-free selection criterion, e.g., using the §5.2 semantic-consistency statistic or the position-indicator score, and report how much of the gain survives, or (b) explicitly reframe the contribution as "node-level selection given a small calibration set" rather than as a training-free localization method. As written, the abstract and introduction oversell the degree of supervision-freeness.

We understand the reviewer's point. We answer (a) and (b) in turn.

(a) Label-free selection criterion

First, we would like to clarify the purpose of §7. §7 does not propose a label-free localization method; rather, it shows that, under the same frozen attention and calibration set, selecting QK nodes, a finer-grained unit than heads or layers, is more effective than selecting entire heads or layers. For this reason, rather than devising a label-free selection criterion for each of the three methods (layer, head, node), we compare them under the same calibration setting.

The two criteria suggested by the reviewer are difficult to use as label-free selection criteria. (1) rˉQ\bar{r}^{Q} measures whether a node lands at the same place across images, not whether that place is an object. (We discuss this in more detail in W2.) (2) The position-indicator MI, as shown in App. I, is concentrated in layers 0–2, and almost all leaves beyond layer 2 fall below the threshold, so it cannot distinguish nodes in layers 6–11; moreover, selecting nodes that respond to fixed positions would favor spatial consistency rather than object localization, which must follow the object.

Therefore, designing and validating a label-free selection pipeline is beyond the scope of the present work. That said, we consider the direction the reviewer points to, namely finding object-centric nodes using only the statistics of the QK tree, to be very promising future work, and we see it as our next task. Accordingly, we have chosen the reframing of (b) for this revision.

(b) Reframing our contribution

We would like to clarify that the paper does not claim that our localization method is label-free, and that our use of "training-free" refers only to the absence of backbone parameter updates. Of the five occurrences of the term training-free in the paper, four refer to prior work (e.g., object discovery based on DINO attention), and the remaining one, in App. A (Limitations), already states explicitly that our method is "training-free in the sense that no backbone parameters are updated, but not label-free, since the node is selected with 500 ground-truth saliency masks."

However, we agree that explicitly mentioning the "small calibration set" helps clarify the scope of our work. We have appended "with a small calibration set" to "By simply identifying and selecting these nodes" in the Introduction, and in the Results part of Section 7 we have revised "Node-level selection performs best in nearly all settings, ..." to "Given a small calibration set, node-level selection performs best in nearly all settings, ...".

AuthorsOpenReview ↗

Weakness 2

W2. Linking semantic consistency to the localization node

The semantic-consistency evidence and the localization evidence are not connected. The paper argues that nodes carry consistent semantic roles and separately that one node localizes objects well, but it never checks whether the node selected by IoU is also the node with high \bar{r}^Q_v or a coherent role card. If the two criteria selected different nodes, the "semantic role" interpretation of the localization node would be undermined. A single correlation or case study linking the two would substantially strengthen the internal coherence of the paper.

Thank you for the comment. First, we clarify that the localization mask used in §7 is the Q-frequency map hI,vQh^{Q}_{I,v} of each node v, and that rˉvQ\bar{r}^{Q}_{v} in §5 is computed from the same frequency map. That is, the two analyses concern the same underlying map but evaluate different properties of it: (a) whether the map lands on the same semantic part across images (rˉvQ\bar{r}^{Q}_{v}), and (b) whether that part overlaps with the entire salient object (IoU).

Therefore, the two criteria need not select the same node, as they measure different properties of the same frequency map. rˉvQ\bar{r}^{Q}_{v} measures part-level consistency. For example, a node that focuses on a narrow part, such as the "from the animal's head to its ear" node in Figure 4, has a high rˉ\bar{r}, but since that part is a small portion of the saliency mask, its IoU is low. Conversely, a node that covers the entire object can achieve a high IoU without necessarily having the highest rˉ\bar{r}. The claims of the paper are that "the nodes of the QK tree have (statistically) consistent semantic roles" (§5) and that "selecting just one node among them with an object-level role already localizes better than heads and layers" (§7), not that "the most consistent node is the best for localization."

Nevertheless, we agree that a case study is useful, and we have added to Appendix H, for each backbone, the role cards of the two nodes side by side (Figs. 64–67): the node with the highest rˉQ\bar{r}^{Q}, as in Section 5 (top), and the node selected in Table 2, as in Section 7 (bottom). The top-rˉQ\bar{r}^{Q} nodes respond to the sky (ViT), the background surrounding the object (CLIP), or the image border (DINOv2, DINOv3); they land at the same place in every image but are unrelated to the object. In contrast, the selected nodes are object-level nodes whose frequency maps cover the foreground object across all four backbones, with query–key displacements concentrated at (0, 0). Both nodes have consistent role cards; the difference is "what" they respond to consistently. This explains why rˉQ\bar{r}^{Q} and IoU select different nodes, while the role cards provide qualitative evidence that the IoU-selected nodes also exhibit coherent semantic roles.

AuthorsOpenReview ↗

Questions 1, 2, and 3

Q1. Same binarization protocol for nodes and head/layer baselines

In Table 2, the node-level method uses a fixed threshold of 0.5 while the head and layer baselines are allowed to choose among seven binarization rules. Could the authors report node-level results under the same rule-selection protocol, or alternatively report head/layer baselines at the fixed 0.5 threshold, to confirm the comparison is not driven by threshold flexibility?

First, we would like to clarify that this asymmetric protocol was a deliberate design choice. The [CLS]-to-patch attention map used by the head/layer baselines is a probability distribution that sums to 1, whereas the node's hQh^{Q} is a frequency map with values in [0, 1] that is not normalized to sum to 1. Because the two maps have different normalization properties, applying the same numerical threshold would not yield an equivalent binarization criterion. We therefore deliberately made the head/layer baselines stronger by letting them choose the best of seven binarization rules, while fixing the node to the single value of 0.5, to test whether node-level selection still outperforms head- and layer-level selection under this less favorable condition. In fact, the map-mean rule was selected in 7 of the 8 baseline settings (App. J), so the baselines in Table 2 already use the rule selected as optimal on the calibration set.

Nevertheless, for reference, as the reviewer suggested, we present below the results obtained by removing the calibration-based rule selection for the head/layer baselines and fixing them to a single rule, cumulative-mass 0.5. Everything else is identical to the paper. As the table shows, removing this additional flexibility lowers the best head/layer by .07–.21, and the node's advantage becomes larger.

ECSSD IoUViTCLIPDINOv2DINOv3
Best head, fixed mass 0.5 (Table 2: best of 7 rules).370 (.451).287 (.373).429 (.535).357 (.472)
Best layer, fixed mass 0.5 (Table 2: best of 7 rules).366 (.438).164 (.375).421 (.500).373 (.485)
Ours (one node), fixed 0.5 (i.e., Table 2).469.569.647.682

Q2. Label-free node selection (rˉQ\bar{r}^{Q} or position-indicator MI)

For the localization experiment, what happens if node selection uses only unlabeled criteria, e.g., ranking nodes by \bar{r}_v^Q or by position-indicator MI, on the same 500 DUTS-TR images without ground-truth masks? How much of the IoU gain over best-head is retained?

Thank you for the question. Selecting nodes by rˉQ\bar{r}^{Q} yields the sky, background, and image-border nodes shown in Figs. 64–67 of W2. Their calibration IoU is already below 0.02, far below that of the best head, so none of the gain over the best head would be retained. The position-indicator MI falls below the threshold for almost all nodes beyond layer 2, making it unsuitable for reliably distinguishing nodes in layers 6–11 (App. I). For further discussion, please see our responses to W1(a) and W2.

Q3. Overlap between the localization node and high-consistency / coherent role-card nodes

Is the node chosen for localization in each backbone also among the nodes with the highest semantic agreement or the most coherent role card? A brief case study would clarify whether the two analyses identify the same structure.

Please see our response to W2 for a detailed discussion.

Reviewer_hnS5OpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
3
Read review
Paper summary

This paper proposes to analyze attention in ViTs at the level of individual query(q)-key(k) pairs and shows that the concatenated q and k vectors (QK feature) exhibit structured patterns, which are later organized into QK trees. The authors then introduce the concept of “role cards” to study the consistent semantic roles observed at each node by visualizing the functional behavior, and the selection of a single object-centric node yields an object localization method.

Critical strengths
  1. Studying ViT weights at the query and key level is well motivated, as the author pointed out that the same weight can arise from many distinct query-key patterns and may have different roles, and that the current analysis methods are too coarse to capture this kind of information. Distinction between close literature is discussed.

  2. Experiment results with different ViT backbones and different training objectives show that QK features contain multiple distinct patterns, and most backbone-dataset pairs of the node-level selection achieved the best performance in the object localization task.

  3. Results are presented with certain levels of control experiments as null/contrast.

Critical weaknesses
  1. More experiments are needed to show the isolated qk pairing’s contribution and whether the pairing adds information beyond q and k distributions. In Table 1, the Real and Shuffled control yields very similar results (for example, ViT silhouette 0.804 vs 0.796, HDBSCAN noise 0.026 vs 0.028, etc..). The authors also noted in their interpretation that the shuffled baseline still achieves relatively high scores because the query and key representations themselves remain preserved. Since the claimed contribution is to analyze at the level of query-key pairs, more experiments are needed to show that the pairing is contributing, rather than just the q and k distributions.

  2. The authors mentioned using concatenated qk as a natural and straightforward way to directly analyze these underlying patterns. However, the ablation experiment of the concatenation operation is not shown and adding numerical results would further back up this claim. As discussed in the introduction and related work, [1,2] proposed different decomposition methods of qk with similar motivations, including a comparison between the proposed method and these baselines are needed to separate the contribution of the qk concatenation and the analysis pipeline.

  3. The stability of the qk tree is not evaluated. It seems that the same sub-sets of ImageNet validation images are used for most experiments and a fixed seed is used. More experiments are needed to show that the trees are consistent across image subsets or across different seed selections. Also, the human study does not test whether role cards help people understand or predict model behavior, expanding the volunteers’ sample size and testing could further benefit the claims of the paper.

  4. In Figure 3, the differences between real and parent-matched null are quite small (around 0.04 at the d with the largest difference). The significance of this difference should be studied more.

[1] Pan, X., Philip, A., Xie, Z., & Schwartz, O. (2024). Dissecting query-key interaction in vision transformers. arXiv preprint arXiv:2405.14880.

[2] Doshi, F. R., Fel, T., Konkle, T., & Alvarez, G. (2026). Bi-Orthogonal Factor Decomposition for Vision Transformers. arXiv preprint arXiv:2601.05328.

Questions for authors
  1. How is the image subset selected, and will this selection affect any existing results?
  2. Node selection is evaluated on 500 DUTS-TR images, but only the best result is reported. Could the authors report the test IoU of the top-k individually ranked nodes?
7 comments
AuthorsOpenReview ↗

Weaknesses 1 and 2

W1. Contribution of QK pairing

More experiments are needed to show the isolated qk pairing’s contribution and whether the pairing adds information beyond q and k distributions. In Table 1, the Real and Shuffled control yields very similar results (for example, ViT silhouette 0.804 vs 0.796, HDBSCAN noise 0.026 vs 0.028, etc..). The authors also noted in their interpretation that the shuffled baseline still achieves relatively high scores because the query and key representations themselves remain preserved. Since the claimed contribution is to analyze at the level of query-key pairs, more experiments are needed to show that the pairing is contributing, rather than just the q and k distributions.

First, we would like to clarify why we use the QK feature, the concatenation of q and k, rather than q or k alone as our unit of analysis. Our motivation is to propose a unit of analysis that lets us examine an individual attention weight at a finer level than the weight itself. The QK feature contains all the information needed to reconstruct the attention logit q⋅kq \cdot k exactly, whereas neither q nor k alone does. In other words, our motivation for using QK features does not rely on the pairing being more informative than the individual Q and K distributions.

Nevertheless, as the reviewer mentions, checking whether the pairing of q and k is itself meaningful provides additional support for the usefulness of the QK feature. To check this, we clustered Q and K separately in each head (k-means, k=10k = 10) and measured the adjusted mutual information (AMI) between the q cluster and the k cluster over the actual query-key pairs. The AMI of the real pairs is 0.269 for ViT, 0.277 for CLIP, and 0.262 for DINOv2, whereas shuffled pairs, in which only the pairing is permuted, are close to 0.000 (144 heads each, Wilcoxon p<10−24p < 10^{-24}). This indicates that Q and K patterns are not paired independently, revealing information that cannot be captured by their marginal distributions alone. Although the marginal distributions explain much of the clustering structure in Table 1, the AMI results show that the actual Q–K pairing carries additional information beyond these marginals.

BackboneReal q-k pairs (AMI)Shuffled pairs (AMI)# heads
ViT0.269≈ 0.000144
CLIP0.277≈ 0.000144
DINOv20.262≈ 0.000144

Q and K are clustered separately per head with k-means (k=10k = 10). Real vs. shuffled: Wilcoxon p<10−24p < 10^{-24} (all three backbones).

W2. Concatenation ablations

The authors mentioned using concatenated qk as a natural and straightforward way to directly analyze these underlying patterns. However, the ablation experiment of the concatenation operation is not shown and adding numerical results would further back up this claim. As discussed in the introduction and related work, [1,2] proposed different decomposition methods of qk with similar motivations, including a comparison between the proposed method and these baselines are needed to separate the contribution of the qk concatenation and the analysis pipeline.

Why we use concatenation. The goal of our work is not to look at the attention weight itself, but to analyze the underlying patterns that produce its value. Since the attention score is computed from the query and key vectors, we build the hierarchical tree directly from these representations. Concatenation preserves both representations without introducing an additional transformation. Nevertheless, we would be happy to evaluate additional representations suggested by the reviewer.

Comparison with [1,2]. [1] and [2] decompose a head into continuous modes (directions) via the SVD of the weight matrix WQ⊤WKW_Q^{\top} W_K. In contrast, the QK tree partitions the (q,k)(q, k) pairs that actually occur in the data into discrete groups. It is precisely this focus on observed query-key interactions that enables analyses such as the role cards (§6). To our knowledge, we are the first to organize observed query-key pairs into hierarchical clusters, interpret their functional roles at the node level, and demonstrate their utility through object localization.

AuthorsOpenReview ↗

Weakness 3

W3. Tree stability (image subsets, seeds) and scope of the human study

The stability of the qk tree is not evaluated. It seems that the same sub-sets of ImageNet validation images are used for most experiments and a fixed seed is used. More experiments are needed to show that the trees are consistent across image subsets or across different seed selections. Also, the human study does not test whether role cards help people understand or predict model behavior, expanding the volunteers’ sample size and testing could further benefit the claims of the paper.

Tree stability. As suggested, we additionally evaluated two settings. (i) Using the same QK feature pool as in the paper, we rebuilt the trees while changing only the random seed (UMAP initialization, the subsample drawn at each node, and the per-node classifiers); (ii) on a new random sample of 2,000 ImageNet-val images (65 of which, 3%, overlap with the 2,000 images used in the paper), we re-ran the entire pipeline from Q/K extraction to tree construction. Experiments 1–2 check the agreement of the tree structure, and Experiment 3 checks whether the trend in Fig. 3 is reproduced. These results have been added to Appendix L of the paper.

Experiment 1: agreement of trees across different seeds. The partition agreement (ARI) with the paper's tree when the seed is changed from 0 to 1 or 2 is shown below. For all three backbones, the ARI of the first-level split is above 0.92, so it is reproduced almost exactly. The ARI remains high at the second level (0.84–0.88) and decreases somewhat only at the leaf level (0.74–0.84).

BackboneSeedDepth-1 ARI (median)Depth-2 ARI (median)Leaf ARI (median)
ViT10.9950.8760.836
ViT20.9940.8690.840
CLIP10.9920.8360.754
DINOv210.9240.8520.744

Experiment 2: agreement of tree statistics on a new image subset. Since the trees built from the new images are based on different QK pairs, ARI cannot be compared directly, so we compared tree statistics instead. For ViT, the split/no-split decision agrees for 138 of 144 heads (96%), and the mean number of nodes (13.7 vs. 14.3) and mean depth (2.33 vs. 2.32) are also close. For CLIP and DINOv2, the split/no-split decision agrees for 135/144 heads (94%) each. In other words, the upper-level structure of the trees is stable across seeds, and tree-level statistics are preserved even when the image set is changed.

Experiment 3: reproduction of the Fig. 3 trend on the rebuilt trees (K=10K = 10). We repeated the rˉ\bar{r} analysis of §5 on the trees from Experiments 1–2. For all three backbones and all rebuilt trees, the mean rˉQ\bar{r}^{Q} increases monotonically with depth and exceeds the parent-matched null at every depth. The per-head mean gap over nodes is positive in 93–100% of heads, and the values agree with the paper to within 0.02 for rˉQ\bar{r}^{Q} and 0.03 for rˉK\bar{r}^{K}. The trend in §5 therefore does not depend on any single tree.

RunrˉQ\bar{r}^{Q} d1 / d2 / d3 (real)real − nullreal > null (fraction of heads)rˉK\bar{r}^{K} d1 / d2 / d3 (real)
ViT · Paper (seed 0).570 / .584 / .599+.015 / +.015 / +.01696%.593 / .596 / .625
ViT · Seed 1.574 / .584 / .599+.019 / +.009 / +.01697%.591 / .597 / .626
ViT · New image subset.570 / .582 / .603+.013 / +.013 / +.01697%.597 / .619 / .629
CLIP · Paper (seed 0).573 / .584 / .606+.012 / +.012 / +.021100%.591 / .607 / .613
CLIP · Seed 1.573 / .582 / .605+.012 / +.011 / +.02295%.593 / .596 / .625
CLIP · New image subset.572 / .589 / .614+.011 / +.016 / +.022100%.594 / .608 / .635
DINOv2 · Paper (seed 0).591 / .601 / .625+.010 / +.013 / +.02494%.619 / .632 / .635
DINOv2 · Seed 1.592 / .600 / .626+.009 / +.012 / +.02993%.646 / .643 / .652
DINOv2 · New image subset.589 / .598 / .617+.008 / +.012 / +.019100%.613 / .629 / .647

Human study. First, we would like to clarify that the user study in App. E does not measure whether the role card method itself directly helps people understand or predict model behavior. Rather, it is a small auxiliary experiment for deciding a single design choice of the role card (the all vs. high-only attention regime). We would like to emphasize that the main claim that role cards capture meaningful functional units rests on the quantitative analyses, not on the user study: the increase in semantic consistency with depth and the parent-matched null (§5), the causal analysis via node knockout (App. G), and the usefulness in localization (§7).

AuthorsOpenReview ↗

Weakness 4

W4. Significance of the real vs. null gap in Figure 3

In Figure 3, the differences between real and parent-matched null are quite small (around 0.04 at the d with the largest difference). The significance of this difference should be studied more.

We thank the reviewer for the constructive comment. Following the reviewer's suggestion, we quantitatively tested the statistical significance of the gap (K=10K = 10). Since nodes are grouped within the same head and are therefore not independent, we averaged the real − null gap per head and then tested at the head level. The table below reports these head-level tests; it includes only heads with a depth-3 lineage, as in Fig. 3. As a complementary check at the node level, a Wilcoxon test over nodes also finds real significantly larger than null in all 24 combinations of 4 backbones × Q/K × depths 1–3 (all p<1.8×10−3p < 1.8 \times 10^{-3}, which also passes the Bonferroni threshold of 0.05/24≈2.1×10−30.05/24 \approx 2.1 \times 10^{-3}).

BackboneSide# headsFraction of heads with real > nullMean gapWilcoxon p
ViTQ7996%+0.0141.9e-14
ViTK6691%+0.0261.2e-11
CLIPQ81100%+0.0155.4e-15
CLIPK7094%+0.0211.0e-12
DINOv2Q6994%+0.0179.6e-13
DINOv2K5884%+0.0359.0e-10
DINOv3Q83100%+0.0292.5e-15
DINOv3K5689%+0.0416.6e-10

In addition, the absolute gap is small because the null is designed conservatively. Since the parent node's map includes the child's map (memv≤memu\text{mem}_v \le \text{mem}_u), the null shares part of the child's signal and is evaluated on the same prototype images. The key point is that the real nodes outperform this strict control in 84–100% of heads.

Reviewer_q6sVOpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
2
Read review
Paper summary

This paper investigates the internal structure of attention heads in Vision Transformers by analyzing query-key (QK) features. The authors propose a hierarchical QK tree constructed through recursive clustering and introduce role cards to visualize the semantic functions of individual nodes. Experiments across multiple ViT backbones demonstrate structured QK representations, semantic consistency, and position-specific patterns. The authors further show that selecting object-centric nodes improves object localization compared with conventional head- and layer-level attention maps.

Critical strengths
  1. Interesting perspective on attention interpretation. The paper investigates attention at the query-key interaction level rather than relying on aggregated attention maps, providing useful insights into the internal structure of attention heads.

  2. Comprehensive experimental analysis. The authors evaluate multiple ViT backbones and provide quantitative evidence of clustering structure, semantic consistency, and causal relevance, supported by informative visualizations.

  3. Practical application to object localization. The proposed node-level selection achieves consistent improvements over head- and layer-level attention baselines, demonstrating the usefulness of the hierarchical decomposition.

Critical weaknesses
  1. Limited methodological novelty. The QK tree mainly relies on existing dimensionality reduction and clustering techniques. The technical contribution beyond applying these methods to QK representations is relatively limited.

  2. Insufficient validation of hierarchical structure. Although deeper nodes exhibit stronger semantic consistency, it remains unclear whether the discovered hierarchy reflects intrinsic attention structure or is influenced by the recursive clustering procedure and its hyperparameters.

  3. Limited practical applicability. Object localization requires labeled masks for node selection, and the comparisons mainly focus on attention aggregation baselines rather than stronger object discovery methods. This limits the demonstrated practical advantages.

Questions for authors
  1. How sensitive are the discovered QK trees and semantic interpretations to clustering algorithms, hyperparameters, and random initialization?

  2. Can the authors compare the proposed hierarchical clustering with simpler alternatives, such as flat clustering or direct feature decomposition, to establish the necessity of the tree structure?

  3. How does the proposed object localization approach compare with established unsupervised object discovery methods under comparable supervision settings?

7 comments
AuthorsOpenReview ↗

Weaknesses 1, 2, and 3

W1. Limited methodological novelty

The QK tree mainly relies on existing dimensionality reduction and clustering techniques. The technical contribution beyond applying these methods to QK representations is relatively limited.

Our use of existing dimensionality-reduction and clustering techniques is a deliberate design choice. The goal of this work is not to build a better QK tree, but to show that the QK tree emerges clearly even with a widely used, standard pipeline (the UMAP–HDBSCAN pipeline of BERTopic and Top2Vec). Had we used a more powerful technique, it would have been hard to rule out the objection that the discovered structure is an artifact of the method itself.

Indeed, Dip-means, an algorithm entirely different from UMAP–HDBSCAN (recursive splitting based on Hartigan's dip test, with no UMAP and no silhouette gate), also detects recursive structure only in real QK features (Table 1, App. D). In other words, the QK tree is consistently detected across different clustering methods.

W2. Insufficient validation of hierarchical structure

Although deeper nodes exhibit stronger semantic consistency, it remains unclear whether the discovered hierarchy reflects intrinsic attention structure or is influenced by the recursive clustering procedure and its hyperparameters.

Confirming that the discovered hierarchy reflects intrinsic attention structure rather than an artifact of the clustering procedure is one of the most central parts of our work. To this end, we provide several complementary validations:

  • In §4, we apply the same pipeline to several null distributions (Shuffled, Cov-matched, Dim-permuted, Random). If the procedure itself created structure, similar structure would have to appear under the nulls as well, but the silhouette drops sharply.
  • Moreover, to prevent recursive splitting from creating structure that does not exist, we designed the procedure so that a recursive split is performed only when it passes the silhouette gate (sgates_{\text{gate}} = 0.5). As a result, the tree does not grow unless the resulting clusters are sufficiently well separated.
  • In addition, the parent-matched null in Fig. 3 evaluates the parent node on the same prototype images, which shows that the increase in consistency with depth comes from node splitting rather than from image selection.
  • Finally, Dip-means, an independent method based on recursive splitting using the dip test, detects hierarchical structure only in real QK features (Table 1, App. D).
  • We discuss hyperparameter sensitivity in detail in our response to Q1.

W3. Limited practical applicability

Object localization requires labeled masks for node selection, and the comparisons mainly focus on attention aggregation baselines rather than stronger object discovery methods. This limits the demonstrated practical advantages.

We would like to clarify that the purpose of §7 is not to achieve state-of-the-art localization. Rather, we aim to show that the finer granularity of QK nodes carries a more useful signal than heads or layers, and the experiment is designed to compare these units of selection in a simple, intuitive, and controlled setting.

Regarding the use of labels, the same 500 DUTS-TR masks are used to select the best heads and layers for the baselines, as well as the best QK nodes (Table 2 caption). Table 2 is therefore a controlled comparison under the same supervision in which only the unit of selection differs, and the need for labels is also stated explicitly in App. A (Limitations).

For a detailed comparison with stronger object discovery methods, please see our response to Q3.

AuthorsOpenReview ↗

Question 1

Q1. Sensitivity to clustering algorithm, hyperparameters, and seeds

How sensitive are the discovered QK trees and semantic interpretations to clustering algorithms, hyperparameters, and random initialization?

We provide several ablations of the clustering pipeline. The results are summarized below.

  • Clustering algorithm: Dip-means, which is independent of UMAP–HDBSCAN, also detects recursive structure only in real data (depth 1.70–3.30 vs. null ≈ 0; App. D).
  • Silhouette gate: lowering sgates_{\text{gate}} from 0.5 to 0.3 also reveals weak spatial splits in early layers (App. I). The value of 0.5 in the main text is a conservative setting that keeps only clearly separated structure.
  • Pair sampling: sampling uniformly from the full attention distribution instead of the L-method pool substantially weakens the structure (App. E).
  • Number of prototypes k: increasing k from 10 to 50 preserves both the increase in rˉ\bar{r} with depth and the advantage over the null (App. F).

However, we did not include an experiment on random seeds in the original paper, and we thank the reviewer for pointing this out.

Random seeds and image subsets. As suggested, we additionally evaluated two settings. (i) Using the same QK feature pool as in the paper, we rebuilt the trees while changing only the random seed (UMAP initialization, the subsample drawn at each node, and the per-node classifiers); (ii) on a new random sample of 2,000 ImageNet-val images (65 of which, 3%, overlap with the 2,000 images used in the paper), we re-ran the entire pipeline from Q/K extraction to tree construction. Experiments 1–2 check the agreement of the tree structure, and Experiment 3 checks whether the trend in Fig. 3 is reproduced. These results have been added to Appendix L of the paper.

Experiment 1: agreement of trees across different seeds. The partition agreement (ARI) with the paper's tree when the seed is changed from 0 to 1 or 2 is shown below. For all three backbones, the ARI of the first-level split is above 0.92, so it is reproduced almost exactly. The ARI remains high at the second level (0.84–0.88) and decreases somewhat only at the leaf level (0.74–0.84).

BackboneSeedDepth-1 ARI (median)Depth-2 ARI (median)Leaf ARI (median)
ViT10.9950.8760.836
ViT20.9940.8690.840
CLIP10.9920.8360.754
DINOv210.9240.8520.744

Experiment 2: agreement of tree statistics on a new image subset. Since the trees built from the new images are based on different QK pairs, ARI cannot be compared directly, so we compared tree statistics instead. For ViT, the split/no-split decision agrees for 138 of 144 heads (96%), and the mean number of nodes (13.7 vs. 14.3) and mean depth (2.33 vs. 2.32) are also close. For CLIP and DINOv2, the split/no-split decision agrees for 135/144 heads (94%) each. In other words, the upper-level structure of the trees is stable across seeds, and tree-level statistics are preserved even when the image set is changed.

Experiment 3: reproduction of the Fig. 3 trend on the rebuilt trees (K=10K = 10). We repeated the rˉ\bar{r} analysis of §5 on the trees from Experiments 1–2. For all three backbones and all rebuilt trees, the mean rˉQ\bar{r}^{Q} increases monotonically with depth and exceeds the parent-matched null at every depth. The per-head mean gap over nodes is positive in 93–100% of heads, and the values agree with the paper to within 0.02 for rˉQ\bar{r}^{Q} and 0.03 for rˉK\bar{r}^{K}. The trend in §5 therefore does not depend on any single tree.

RunrˉQ\bar{r}^{Q} d1 / d2 / d3 (real)real − nullreal > null (fraction of heads)rˉK\bar{r}^{K} d1 / d2 / d3 (real)
ViT · Paper (seed 0).570 / .584 / .599+.015 / +.015 / +.01696%.593 / .596 / .625
ViT · Seed 1.574 / .584 / .599+.019 / +.009 / +.01697%.591 / .597 / .626
ViT · New image subset.570 / .582 / .603+.013 / +.013 / +.01697%.597 / .619 / .629
CLIP · Paper (seed 0).573 / .584 / .606+.012 / +.012 / +.021100%.591 / .607 / .613
CLIP · Seed 1.573 / .582 / .605+.012 / +.011 / +.02295%.593 / .596 / .625
CLIP · New image subset.572 / .589 / .614+.011 / +.016 / +.022100%.594 / .608 / .635
DINOv2 · Paper (seed 0).591 / .601 / .625+.010 / +.013 / +.02494%.619 / .632 / .635
DINOv2 · Seed 1.592 / .600 / .626+.009 / +.012 / +.02993%.646 / .643 / .652
DINOv2 · New image subset.589 / .598 / .617+.008 / +.012 / +.019100%.613 / .629 / .647
AuthorsOpenReview ↗

Question 2

Q2. Necessity of the hierarchy vs. flat clustering or direct decomposition

Can the authors compare the proposed hierarchical clustering with simpler alternatives, such as flat clustering or direct feature decomposition, to establish the necessity of the tree structure?

Thank you for the question. We answer in three parts: (1) the relationship between the tree and flat clustering, (2) an experimental comparison with flat clustering, and (3) the purpose of the tree structure.

1. Definition. By definition, the QK tree subsumes flat clustering. At each node, we apply the same UMAP–HDBSCAN pipeline and recurse only when the silhouette exceeds 0.5, so under the same pipeline, flat clustering is the special case dmax⁡d_{\max} = 1, and the depth-1 nodes of the tree are exactly the flat clusters. The tree therefore does not replace flat clustering; it is an extension that further subdivides its result only where structure remains.

2. Experimental results. Following (1), the benefit of hierarchical splitting can be tested directly by asking whether depth-1 nodes (flat clusters) alone suffice. Below is the IoU obtained in the setting of §7 when the candidates are restricted to depth-1 nodes and the node is selected with the same calibration set (ECSSD / DUT-OMRON / DUTS-TE). For all four backbones, a single flat cluster falls short of the tree node; in particular, for ViT and CLIP, the best depth-1 node even underperforms the best head, highlighting the benefit of further hierarchical splitting.

BackboneBest headFlat clustering (depth-1 node)Ours (tree node)
ViT.451 / .283 / .340.325 / .210 / .226.469 / .336 / .349
CLIP.373 / .187 / .295.275 / .174 / .272.569 / .400 / .435
DINOv2.535 / .248 / .390.571 / .327 / .430.647 / .448 / .481
DINOv3.472 / .248 / .399.625 / .380 / .479.682 / .449 / .521

3. Purpose. The purpose of the tree structure is not merely to partition QK features, but to observe how QK patterns become more specific with depth. The increase in rˉ\bar{r} with depth in §5 (Fig. 3), the depth-2 knockout in App. G (the split within a parent node is functionally more meaningful than a random split), and the narrowing of roles from parent to child in the role cards (§6) are all observations enabled by the hierarchical organization of QK features. Indeed, the nodes selected in Table 2 are at depth 2–3 for all four backbones, which further demonstrates the benefit of hierarchical splitting.

Comments on the paper

2 comments

Dear Reviewers,

Please carefully review the authors’ rebuttal and engage in further discussion with the authors to clarify any remaining concerns and questions. Your active participation during the discussion period is greatly appreciated.

Best, AC

We sincerely thank Reviewers q6sV, hnS5, Le7S and Area Chair kKWE for their careful reading and constructive feedback. We greatly appreciate these insightful reviews, which have helped us strengthen the empirical evidence for the QK tree and clarify the scope of our claims. Given the length of our rebuttal responses, we summarize the changes made in the revised manuscript below.

The revised PDF contains the following changes.

  • New Appendix L (Tables 14–15). We evaluated the stability of the QK tree structures and the depth-wise semantic-consistency trend in §5 across random seeds and image subsets (q6sV [Q1], hnS5 [W3/Q1]).
  • Extended Appendix H.2 (Figures 64–67). We compared the most semantically consistent node (highest rˉ\bar{r} in §5) and the best-localizing node (highest IoU in §7) within each attention head (Le7S [W2]).
  • Main-text revisions. We explicitly clarify in the Introduction and §7 (Results) that node selection relies on a small calibration set (Le7S [W1]).

To preserve the references in the reviews, we added the new appendix at the end of the paper and kept all section and table numbers unchanged from the original submission. However, the insertion of four figures (role card examples) in Appendix H.2 shifts the numbering of subsequent appendix figures by four (the original Figures 64–91 in Appendices I–J are now Figures 68–95). Please keep this numbering change in mind if any further discussion is needed.

We have made substantial efforts to provide detailed responses to all weaknesses and questions raised by the reviewers. If any questions or concerns remain after reviewing our responses, please let us know. We would be glad to provide further clarification.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.