Attention (as Discrete-Time Markov) Chains
Authors: Yotam Erel
Olaf Dünkel
Rishabh Dabral
Vladislav Golyanik
Christian Theobalt
Amit Haim Bermano
Venue: NeurIPS 2025 poster ()
Keywords: attention
transformers
Markov chain
Primary area: deep_learning
TL;DR: We interpret attention as discrete-time markov chains and show its effectiveness on various downstream tasks.

Abstract: We introduce a new interpretation of the attention matrix as a discrete-time Markov chain. Our interpretation sheds light on common operations involving attention scores such as selection, summation, and averaging in a unified framework. It further extends them by considering indirect attention, propagated through the Markov chain, as opposed to previous studies that only model immediate effects. Our key observation is that tokens linked to semantically similar regions form metastable states, i.e., regions where attention tends to concentrate, while noisy attention scores dissipate. Metastable states and their prevalence can be easily computed through simple matrix multiplication and eigenanalysis, respectively. Using these lightweight tools, we demonstrate state-of-the-art zero-shot segmentation. Lastly, we define TokenRank---the steady state vector of the Markov chain, which measures global token importance. We show that TokenRank enhances unconditional image generation, improving both quality (IS) and diversity (FID), and can also be incorporated into existing segmentation techniques to improve their performance over existing benchmarks. We believe our framework offers a fresh view of how tokens are being attended in modern visual transformers.

Attention (as Discrete- Time Markov) Chains
Yotam Erel
Olaf Dünkel
Rishabh Dabral
Vladislav Golyanik²
Christian Theobalt Amit H. Bermano
TTll Aviv University MPI for Informatics, SIC
httpa://yoterel github 1 att.ntionennnnnnn catatiiiiinccnns/////ooo
Abstract
We introduce new interpretation of the attention matrix as discrete-time Markov chain. Our interpretation sheds light common operations involving attention scores such as selection, summation, and averaging in a unified framework. further extends them by considering indirect attention, propagated through the Markov chain, as opposed to previous studies that only model immediate effects. Our key observation is that tokens linked semantically similar regions form metastable states, i.c., regions where attention tends to concentrate, while noisy attention scores dissipate. Metastable states and their prevalence be easily computed through simple matrix multiplication and eigenanalysis, respectively. Using these lightweight tools, demonstrate state-of-the-arr zero-shot segmenta- tion. Lastly, we define TokenRank the steady state vector of the Markov chain, which measures global token importance. We show that TokenRank enhances unconditional image generation, improving both quality (IS) and diversity (FID), and also be incorporated into existing segmentation techniques to improve their performance over existing benchmarks. We believe our framework offers a fresh view of how tokens are being attended in modern visual transformers.
Token Select
Cat
TokenRank
72
72
72
Tie
Figure Attention Chains interprets attention matrices as Markov chains. The 1 order bounce (n 1) corresponds to a common row-select operation from an attention matrix (top: the token "cat", bottom: "tie"). Iteratively computing the th order attention bounce models higher-order attention effects, eventually yielding stationary vector (n - oo) that globally captures the flow of attention into each token (TokenRank). Intermediate iterations result in sharper segmentation maps.
Introduction
The attention mechanism (Vaswani al. 2017) is arguably the most dominant computational primitive in modern deep learning, particularly in the image domain. It has sparked widespread
Equal contribution.
39th Conference on Neural Information Processing Systems (NcurIPS 2025).

---

research interests and industry adoption. and is extensively leveraged in the literature for anything
from segmentation (Khan et al. 2022), through interpretability (Chefer et al. 202Tb), to controllable
generation (Hertz et al. 2023). in various domains including images (Rombach et al. 2022 I Labs
2024). 3D (Siddiqui et al. 2024 Wu et al., 2024), motion (Dabral et al., [023] Raab et al. 2024).
and more. In the image domain, attention scores play a crucial role: prior studies have leveraged
these scores for numerous downstream tasks such as identifying important features (Caron ct al.
202I), improved and controlled generation (Hong et al. 2023; Alaluf et al. [2024] Hertz et al. 2023
Tumanyan et al., 2023), visualization and segmentation (Helbling et al.] 2025] Dosovitskiy ct al.
2021) and analysis of image video generation models (Hatamizadeh et al., 20224] Wen et al. 2025).
All these examples, however, only examine either partial slices of the attention matrices, or their first few principled components: the most common operations are to select a specific row or column, or to sum up one of the dimensions of the attention matrix that of quadratic size in sequence length. These operations yield an image-sized map that can be further utilized for the task at hand (e.g., segmentation, generation). Some works integrate information across layers, through direct multiplication (Abnar and Zuidemal 2020 Chefer et al. 202Ib), gradient propagation (Selvaraju ct al. 2017 Mehri et al., 2024] Binder et al. 2016). but they still employ the attention operator directly, restricted to capturing only its immediate effects. In contrast, we examine the role of single attention matrix more holistically, accounting for indirect attention paths via intermediate tokens.
We introduce the interpretation of individual attention matrices as discrete time Markov chains (DTMC) F.. where the non-negative attention weights indicate transition probabilities between states that correspond to tokens. This framework, dubbed as Attention Chains, allows analyzing token importance through multiple chain transitions, even though the attention operation models only direct relationships. This is analogous to Google's seminal paper on DTMC, PageRank (Page et al., 1999), stating that simple counting of incoming hyperlinks does not generally correspond to page importance. Similarly, simply using direct attention to measure global relevance of token under performs compared to propagating it through the chain, as we show in various experiments.
We begin by adopting tools from the DTMC literature to explain existing operations commonly applied to attention matrices in a unified framework. These include averaging over heads, selection of rows or columns, and the summation over columns for computing the overall incoming attention for a specific token. Further building on the DTMC interpretation, we extend these operations to new ones. In this regard, our main observation is that tokens in semantically similar regions attend each other, forming set of metastable states (Landim 2019), where the chain tends to remain for long time before transitioning elsewhere. In contrast, noisy attention scores tend to disperse rather than cluster.
Based on this insight, we propose simple yet powerful operation several transitions, or bounces, of the Markov Chain. This consolidates metastable states and helps filter out noise in the attention signal. As we demonstrate, using multiple bounces yields state-of-the of-the-art results for zero-shot segmentation on commonly used benchmark. Metastable states can also be identified via eigenanalysis, and their presence relates to higher 2nd largest eigenvalues. We use this characteristic to weigh attention heads and improve image segmentation.
Lastly, we define TokenRank-4 concise indicator of the global importance of each token via the steady state vector of the attention Markov chain. TokenRank lends itself well to extracting knowledge encoded in the transformer's attention and improves unconditional image generation, resulting in higher quality and diversity.
We believe that this interpretation is useful for reasoning about the inner workings of modern visual transformers, and can potentially provide a strong foundation for novel applications employing the powerful and widely used attention mechanism.
2 Related Work
Interpretations of Transformer Attention. Due the importance of the attention operation in transformers, studies have proposed modeling them using various mathematical frameworks, For example, |Ramsauer et al. (2020) relate attention to classic Hopfield networks. Tsai et al. (2019) frame attention kernel smoother, |Shhaag et al. (202T) find its relation to classic fast weight controllers, or |Rahuu et al. (202T) compare vision transformers to CNNs. EEl et al. (2025) discuss the mathematical equivalence between message passing in graph neural networks and the self-attention operation in

---

transformers. Iidiz et al. (2024) consider modeling a I-layer transformer as a Markov chain. In contrast, we focus on large pretrained transformers and model each individual self-attention matrix as Markov chain. While their approach allows explaining some typical behaviors of transformers, we explicitly show how our framework allows for the interpretation of existing, pretrained large transformers and for better performance in various downstream tasks. Secondly, we leverage more of the machinery of the Markov chain theory, including multiple transitions and steady state analysis, which was not considered previously.
Visualization of Attention Maps. Understanding the attention mechanism of transformers requires probing attention maps across various heads, layers, or timesteps for diffusion models. However, there is no de facto standard for visualizing attention maps. While visualizing cross-attention maps or attention with respect the class token common practice (Hertz et al. 2023] Caron al., (02T). there is no common approach for self-attention due to its many-to-many characteristic. Wen et al. (2025), for example, analyze raw attention maps whereas [Hatamizadeh et al. (2024) visualize where attention is flowing into with respect to an image token in the center. Alternatively, several studies visualized the principle components using SVD decomposition (Liu et al. 2024; Tumanyan et al.) 2023). On the other hand, we propose extracting a unique steady-state vector of the attention matrix that allows to more holistically visualize where attention is flowing to, or where it is flowing from.
Explainability for Transformers. One important branch of explainability research for convolu- tional and ferw-fo networks are gradient- gradient-based methods that compute model's explanation taking into account the gradient of a model prediction with respect to the input pixels (Erhan et al..
2009. Selvaraju et al. 2017 Simonyan et al. 2013). Layer-wise Relevance Propagation (LRP) (Binder et al. 2016) propagates relevance scores backward through the neural network, which has been extended to transformers (Chefer et al. 202 Achtibat et al. [024). A different line of work makes use of the attention mechanism to propagate where attention is flowing through the network (Abnar and Zuidema (220)) or combines it with gradient-based strategy (Bousselham et al. (2024). Our framework focuses on individual attention matrices, and naturally allows to better explain each attention matrix by considering indirect interaction effects. This is perpendicular to studies that attempt to explain the input using the output in an end-to-end fashion.
Extracting Knowledge Encoded in Foundational Models. Recently, larger interest was raised in how to extract knowledge encoded in foundational models (e.g. DINO (Caron et al. 2021 Oquab
jtt al. 2024). CLIP (Radford et al., 202T), or generative models such as FLUX (Labs 2024) and to better understand their inner workings. Caron et al. (2021): Chefer et al. (2021b): Hao et al. (202)
Tang et al. (2023) use raw attention maps for computing attribution scores, while Gandelsman et al. (2024) investigate the CLIP image encoder by decomposing the image representation and relating to CL.PP's text representation. Helbling et al. (2025) propose the usage of concept tokens that allow higher quality extraction of text-token specific attention maps even if they do not appear in the prompt. Other recent works focus on extracting noise-free diffusion features (Stracke et al. 2025),, reducing massive attention activations (Gan et al. 2025), refining features with light- weight adapter (Dünkel et al. 2025). Nguyen et al. (2023) perform self-attention exponentiation for refining semantic segmentation maps. We explore how propagating indirect attention effects through Markov chain helps in extracting more informative signals for various downstream tasks.
3 Preliminaries
3.1 Discrete-Time Markov Chains (DTMC)
right-stochastic square matrix e guxa where all rows sum up to one A,, Vi, and with non-negative entries A,, 2 0, Vi, is a transition probability matrix of time-homogeneous DTMC with states, where A j.j P(jlt) is the probability of transitioning from state to state j. If the directed weighted graph represented by the transition matrix is irreducible and aperiodic, then there exists unique eigenvector Vas corresponding to the eigenvalue 1: A V.s = 1 Vas- This eigenvector stationary and describes the steady state that any given initial state of the system evolves into over time. Another useful property of the transition matrix A is that the size of its second largest eigenvalue |Δa] indicates how slowly the chain converges into V or alternatively, the number of metastable states in the chain.
3

---

Attention Matrix A
Markov Chain
Attention Propagation
One-Hiot
Uniform
0.01
0.04
0.02
0.85
0.08
2
0.82
0.04
0.07
0.01
0.06
0.82
0
0.80
Row Select
Column Sum
6.33
600
8:20
3.M
OCS
9.28
027
0.07
0.05
0.85
6:31
5:34
0:27
5:21
0.12
3
3-
0.06
0.06
0.03
0.04
0.81
0.35
0.81
Steady State
0.06
4
55
Figure 2: Illustration of higher order effects. Left: Attention matrix A with sequence length Middle: A DTMC with transition probabilities defined by matrix A, where only strong connections are shown. Right (One-Hot): To evaluate where state-4 attends to, we can iterate using the power method once starting from a one-hot vector (n 0), which results in the row-select operation (n 1). However, this first-order approximation is insufficient since state-0 mostly transitions to state- and, therefore, state-4 indirectly attends state-3. This becomes evident as we iterate further (n = 2). Right (Uniform): To compute global token ranking, we can iterate starting from a uniform state = 0), resulting in per-column sum operation (n = 1). This indicates state-O as most important because many states have high probability of transitioning into state-O. However, state-O maps state-3 with high probability, and state-3 maps to state-4 with high probability. Therefore, the importance of state-4 should be elevated. When considering the second bounce (n = 2), more probability mass is directed into state-3, and with sufficient number of iterations the steady state (u ranks state-4 as the most important state globally, which aligns with the intuition above.
Power Method. The most straightforward way to obtain the steady-state vector Vss is using the power method that iteratively computes
(I)
where v is initial state summing up The computation is usually terminated the norm falls below a specific threshold ||v v < or after some fixed number of iterations.
3.2 PageRank Algorithm
As we rely on their formulation throughout this paper, we briefly discuss Google's PageRank (Page al. 1999) algorithm. PageRank models the hyperlink structure the web as stochastic process P where states are web pages, and outgoing links are used to define transition probabilities. Here, the matrix P is row normalized and pages with no outgoing links are replaced with uniform vectors. To ensure unique steady state vector, the considered matrix needs to be irreducible and primitive. For this purpose, revised transition matrix P' with only positive entries is computed from P:
P' P'= oP (1 a1 CCT.
(2)
where < a < 1 a hyper parameter controlling the transitioning probability of "teleportation" into random state, and is column vector of all ones. Applying the power method on P' results in unique vector म, the global PageRank vector, inducing the order J - म. S T..
Attention as a Discrete- Time Markov Chain
After softmax, the attention matrix becomes right-stochastic matrix with non-negative entries:
QKT
A softmax
dh
where h is the number of heads, 81,2 are the token sequence lengths, and d, sub-space of the full embedding dimension d. Consequently, interpret the attention matrix as a DTMC, going

---

beyond the conventional attention mechanism in transformers, which only models direct interaction between queries and keys. Our discussion limited to attention blocks of equal sequence size (e.g. self-attention, or hybrid attention blocks), unless otherwise stated. We start by formalizing some common operations performed on attention matrices using the DTMC formalism (Section[4]) (.1) While the previously proposed attention operations can be formulated with a single bounce of the Markov chain, we go beyond this and iterate through the Markov chain. Specifically, we describe three new operations enabled by this framework: multi-bounce attention (Section 4.2): where higher-order
attention effects are taken into account, TokenRank (Section 4.3); the token-space equivalent of PageRank, and A2 weighting: an improved attention head weighting scheme that is based on the second largest eigenvalue the chain.
4.1 Interpretation of Existing Attention Operations
In this section, we show that common operations on attention matrices- for purposes of visualization, explainability, and information extraction- can be interpreted within the DTMC framework. We use A to denote an attention matrix after the softmax operation.
Multiplying attention matrices of subsequent blocks of transformer is performed by previous explainability studies (Dosovitskiy et al. 2021 Abnar and Zuidema, 2020 Chefer et al. (021b) that propagate information from the output to the input. This operation is is equivalent to chaining several Markov chains in the DTMC framework. Another way to view this is a time-dependent Markov chain, where in each time step the next matrix in the multiplication order represents transition probabilities.
Adding an identity matrix to an attention matrix and re- ne-normalizing it was used previous studies to mitigate the effects of skip connections (Abnar and Zuidema 2020 Chefer et al. 2021b). This is equivalent to computing a new chain A' = =0.5[I+ + A). Then, the following holds:
A'v es = 0.5(I + V.... = 0.5(v + Av..) - 0.5(v + Av..) 0.5(1 + A)v.s Vass
where as is the steady-state vector of A and the last transition is because the eigenvalue associated with the steady state is À= = Evidently, this operation does not change the system's 's steady state, preserving its global nature. Instead, the chain converges more slowly since each state has higher transition probability to itself.
Selecting specific row v." = =AA,)) 3= corresponding to single token i results in a row-vector of attention given by token to all other tokens, a one-to-many relationship. In our framework, v! can be obtained by performing a single state transition v?" = u? A, where u? is a one-hot row
vector on index i.
Selecting a specific column V, = -AA,)) corresponding to a single token j. encodes which other tokens find j important. This operation commonly used to visualize many-to-one relationship, such as image tokens attending specific text tokens in a cross-attention matrix (Dosovitskiy et al.) [2021] Hertz al. 2023). Since column-select operates in column-space (as opposed rew-select), which is not a valid probability distribution, we first normalize the columns to acquire a left-stochastic matrix A, This allows us to equate a column-select operation up some constant scale as: Vy x Auu, where uj is a one-hot column vector for index j.
Thus, our formulation allows
reinterpret the selection operation the first bounce transition from a one-hot vector, a view that we will further motivate in Section 4.2]
Summing each column of A results in a row vector vz that aggregates attention given to each token from other tokens. our formulation, v," can be obtained by performing a single state transition: v _ee" A, where ef is row vector of ones. This operation can be useful first-order approximation in ranking tokens' importance globally, as it equates to starting from an equilibrium state and transitioning through the DTMC process once. However, we show this straihhtfoorwad approach under-perfori compared to the global TokenRank vector (Section 4.3) that takes into 2 for illustrative example.
account indirect attention being given to all tokens. See Figure
Averaging multiple attention matrices over different attention heads is common approach to process or visualize the information contained in attention layers of transformers. This is despite numerous studies indicating that some heads are not informative for large transformers (Voita et al. 2019 Chefer et al. 20211), suggesting that simple averaging might dilute the signal under observation. In the DTMC framework, averaging yields a new process where, at each step, the transitioning probabilities are the mean of those from the original chains "mixture" of the chains with equal
5

---

weighting. This operation can be reasonable if the chains are not very different. As an alternative, we propose a weighting scheme that considers the convergence rate of the chains in Section 4.4
4.2 Multi-Bounce Attention
When the subject of interest is a specific token i, the core shortcoming with row- and column-select from a Markovian perspective is that they do not take into account higher order effects: As illustrated in Figure 2] the tokens that token i attends to are also attending other tokens, indirectly affecting token i. While it is evident that the attention mechanism only implements direct influence between tokens, we show that considering indirect paths allows for a deeper understanding of attention flow within individual attention heads. For brevity, we will now extend the row-select operation using framework, which can be analogously applied to column-select after normalizing the columns of A and transposing.
The crucial observation enabled by the DTMC interpretation is that iterating on the selection operation times for token i yields
T A, T (i,+1)) (i,n)
(s.n=o) being a one hot row vector. Such an iterative process is mathematically equivalent to the power method (Fquation (1). In other words, we wish to take into account the nh order attention bounce, we can simply apply this formula n times. For single bounce, v ((.n=1) captures incoming attention for tokens that i attends to directly (row-select) or outgoing attention for tokens that attend directly ccolumn-select) For any v (1,n21))
with v
higher order bounces are considered. See
Figure T for an illustration.
4.3 TokenRank
In many cases, more complete understanding of token importance is required. Observe that applying attention (Section 4.2) will converge into a stationary vector for any initial state specific conditions are met (Section 3.1p. In the context of attention matrices, we name this vector TokenRank, inspired by Google's 's webpage stationary vector PageRank (Page al. 1999). We argue that TokenRank is a better tool to measure the global importance of tokens in a single attention head, compared to more localized and naïve attempts probe the attention matrix (e.g. by selecting a specific column, or summing up each of the columns).
One caveat is that attention weight matrices might still be reducible, or have cycles of fixed length. This means they do not necessarily hold the properties that guarantee the existence and uniqueness of a steady-state vector. A sufficient way to guarantee this, is adjust A using the PageRank formulation (Equation 2 prior to iterating.
While this formulation allows to immediately acquire authoritative tokens (those for which attention is flowing into), we can also normalize the columns followed by transposing of A. Then, iterating obtains important hub tokens (those which attention is flowing out from), obtaining two TokenRanks: one for incoming and one for outgoing attention.
We show that TokenRank extracts cleaner signal of the attention (Section 5.2 can be used to improve downstream tasks (Section 5.3), and is better for determining the importance of tokens the sequence compared to other approaches (Section 5.5).
4.4 Xa Weighting
The mixing time of a DTMC into its steady state is mathematically tied with its 2nd largest eigenvalue X2 (Langville and Meyer 2004). Intuitively, larger X2 values correspond to more stable metastable states, indicating that more important information captured by the attention matrix. Indeed, DTMCs with randomly sampled transition probabilities tend to have very small d2 (see Appendix F)
To this end, instead of simply averaging attention matrices over the head dimension (Section 4.1 we instead propose to perform weighted averaging over the heads using their Xa values. We show this weighting scheme results in better downstream task performance (see Section 5.1 and Appendix E.2

---

Orig. Img.
Colum Select
ConceptAttention
Ours
GT Mask
Figure 3: ImageNet segmentation. Considering higher order attention effects improves results. We visualize the raw attention output (colored) and the binary segmentation masks. We present more qualitative comparisons in Appendix C.2
5 Experiments
This section provides extensive evidence that our framework and the extended operations over the attention matrices are useful for variety of downstream tasks. We start with improving zero-shot segmentation over standard benchmark using multi-bounce attention (Section 5.1). followed by showing that TokenRank extracts a more informative signal than existing baselines (Section 5.2).
useful for visualization purposes. Then, we demonstrate that applying TokenRank to existing techniques improves unconditional generation images (Section (533 and segmentation (Section (54). This is supplemented with token masking experiment (Section where deliberately mask tokens according to their TokenRank importance and measure downstream accuracy for image classification.
5.1 ImageNet Zero-Shot Segmentation
straightforward way to evaluate the usefulness of taking into account higher-order attention effects is to measure the performance on a downstream task such as zero-shot segmentation. We evaluate on the ImageNet Segmentation benchmark (Chefer et al. 2021b) consisting of 4276 images with 445 categories and we employ FLUX-Schres model, to denoise the images and extract the attention maps. We then average the maps over heads using Å weighting (Section
(Labs) 2024). pretrained transformer-basee generative
4.4 and compute the multi-bounce attention when considering outgoing links with n (Section 4.2 We refer to the Appendix A for further implementation
details and to Appendix C for further results.
We report the results for the current sate-of-the-ar method (Helbling al. 2025 and additionally provide the row- and column-select operations as baselines using their implementation. The results are reported in Table and example qualitative segmentation masks are presented Figure indicating that our method is better than the previous -fate-of-the-and as the threshold- -agnostic metric mAP shows a large gap performance. We hypothesize that this is because semantically similar regions form sets of metastable states, and iterating consolidates them, which results in cleaner segmentation maps. Our proposed A2 weighting further improves the segmentation performance, as we show in statistical tests in Appendix E.1
7

---

Table ImageNet segmentation. Our method yields state-of srre-of-the-aae results. Error bars and further results are reported in Appendix
Method
Architecture
Acc 1
mloU 1
mAP 1
LRP (Binder et al.
2016
VIT-B/16
51.09
32.89
55.68
Partial-LRP (Binder et a.. 2016)
ViT-B/16
76.31
57.94
84.67
Rollout (Abnar and Zuidema 2020)
VIT-B/16
73.54
55.42
84.76
VIT Attention (Dosovitskiy et al.
2021
ViT-B/16
67.84
46.37
80.24
GradCam (Selvaraju et al. 2017)
VIT-B/16
64.44
40.82
71.60
DiftSeg Tian et al. (2024)
SDL.4
65.41
52.12
TextSpan (Gandelsman al. 2024
ViT-H/14
75.21
54.50
81.61
TransInterp (Cheter et al. 2021b)
ViT-B/16
79.70
61.95
86.03
DINO Attention (Caron
2021
ViT-S/8
81.97
69.44
86.12
DAAM (Tang et al. (023)
SDXL UNet
78.47
64.56
88.79
FLUX Cross Attention (Helbling et
2025
FLUX DiT
74.92
59.90
87.23
FLUX row-select
FLUX DiT
73.96
54.65
82.64
FLUX column-seles
FLUX DìT
80.55
64.02
87.20
Concept Attention (Helbling et al.
2025
FLUX DIT
83.07
71.04
90.45
Ours w/o )2
FLUX DIT 84.00
70.02
94.28
Ours
FLUX DIT
84.12
70.20
94.29
TokenRank
Col. Sum
TokenRank
Col. Sum
12i0 BS
Center
CLS
Center
CLS
Layer
Layer
TokenRank
Col. Sum
TokenRank
Col.
Sun
Center
CI.S
Center
CL.S
Layer
Layer
Figure 4: Global incoming attention. Visualizations are computed after averaging over heads for four different layers of DINOvI. While the center token only attends the local neighborhood for earlier layers, column sum results in noisy attention visualizations. In contrast, TokenRank captures global incoming attention on par with the CLS token that was explicitly trained capture global attention for D.NOv1. We show per-head visualizations in Appendix H
5.2 TokenRank for Visualizing Attention Maps
Previous typical approaches for visualizing global incoming attention consider the attention with respect to Center Token, that is, row-select for that token (Hatamizadeh et al. 2024). or compute per-Colunn Sum (Hong et al.) (023). These methods share the common characteristic that they can each be expressed as a single power-method iteration (Section In other words, they only take into account direct attention effects. On the other hand, TokenRank considers indirect attention paths to evaluate where attention is flowing into. This results in attention maps that are sharper and less noisy than with column sum and more complete than using single token (Figure 4h. We provide quantitative comparison through linear probing experiment Appendix B

---

5.3 Improving Self-Attention Guidance (SAG)
To evaluate TokenRank on a downstream task, we integrate it in SAG (Hong et al. ) an approach that improves the fidelity and the quality of unconditional image generation with denoising diffusion models. SAG uses the self-attention weight matrices to form a mask that indicates important spatial tokens. It then adversarially blurs the masked regions and drives the denoising process away from it, creating better images as a result. To find out where important features exist, HHnng et al. (2023) average over the head dimension for specific attention layer, followed by summing each of the columns (Section 4.1). We compare the quality and diversity of generated images when using the TokenRank instead of their proposed Column-sum strategy. We compute the IS (Salimans et al. 2016), FID (Heusel et al. 2017), and KID [Binkowski et al. 2018) metrics over 50K generated images. The selected metrics offer complementary information in terms of quality, diversity, and resemblance to ground-trum truth distribution. Results are reported in Table 2 and Figure We refer to the supplementary material for further details and results. Using TokenRank improves the generated images significantly in both quality and diversity compared to the original SAG, showcasing TokenRank 's ability to rank globally important tokens in the sequence, and improve downstream generative task.
SAG+ Take
SAG
Table 2: Quantitative results for SAG, Comparisons between SD1.5 (Rombach al. 2022). SAG (Hong et al., (023) and
SAG+ TokenRank. Metrics were computed
over 50K examples.
Method
IS
FID J
KID L
SD1.5
16.32
45.77
0,018
SAG
17.69
52.48
0.023
SAG+TokenRank
18.37
50.14
0.021
Qualitative results for SAG. Im- ages generated using TokenRank have less artifacts and are more structured.
Figure 5:
5.4 Improving DiffSeg with TokenRank
We incorporate TokenRank into DiffSeg Tian al., 2024), existing segmentation approach that merges self-attention matrices using KL- divergence to measure similarity between up- sampled attention maps. Specifically, in the original study the authors used uniform grid to initialize the anchors used as seeds for their proposal algorithm. Instead, we sample anchors according to their TokenRank importance, with suppression avoid repeatedly selecting the same location. This better grid strategy leads to substantial improvements over the original approach using the COCO-Stuf's S-OO-Stuff-2 benchmark as can be seen in Table 3 This experiment further shows our framework is orthogonal to other solutions leveraging self-attention for solving downstream tasks.
Table COCO-Stuff227 benchmark. Using To- kenRank to sample anchors for initial proposals in DiffSeg (Tian al. 2024) results in significant improvements over the benchmark.
Method
mACC 1
mloU 1
Uniform Grid
72.50
43.60
TokenRank Grid
84.97
44.87
5.5 Masking Most Influential Tokens
Inspired by standard faithfulness experiments Mehri al. 2024), where changes in the performance of downstream classifier are observed through progressively occluding input features, we designed a new experiment that targets evaluating strategies that measure the global importance of tokens per individual attention head. Specifically, the most influential tokens in the sequence are masked out progressively by zeroing the corresponding columns in the attention matrices and the resulting classification accuracy drop is measured. We evaluate the accuracy degradation of several vision transformer-baser classifiers over 5000 randomly selected images from ImageNet with a fixed seed. To determine the order of tokens to be masked, we use the TokenRank vector and compare it to the

---

following baselines: randomly selecting a token ("Rand. Token"), using the column of the token corresponding the center patch of the image ("Center Token"), the per column-sum sum ("Column Sum"), and using the CLS Token. Note that we do not mask global tokens, i.e., the CLS token and the registers for DINOv2, as this results in a massive drop in performance rendering the comparisons less useful. We refer to Appendix for further details.
Results are reported in Table 4 illus- trating that classification accuracy de- grades faster using TokenRank than other baselines for several pre-trained transformers. This validates the hy- pothesis that TokenRank captures im- portant global information more faith- fully since it also models higher-order effects. Another interesting observa- tion is that transformers with a more structured features (e.g. DINOv2 with registers (Darcet et al. 2024 tend to benefit more from Token which suggests it can also be potentially used for quantifying this aspect a trained transformer. We hypothesize that this due to TokenRank's ss tendency to sharpen the input signal (Figure 4. potentially reinforcing the effect of noise or artifacts for unstructured feature space.
Table 4: Results for masking most influential tokens. We present the area under curve (AUC) metric for the accu- racy normalized by the original model accuracy and average over various models of selected model family with model- specific results presented in Appendix [ Using TokenRank to mask out important tokens consistently results in larger accuracy drops than other strategies.
AUC +
ViT
CLIP
DINOv1
DINOv2
Rand. Token
0.79
0.80
0.88
0.89
Center Token
0.33
0.47
0.45
0.70
Column Sum
0.27
0.49
0.47
0.71
CLS Token 0.33
0.53
0.56
0.70
TokenRank
0.26
0.46
0.44
0.64
6 Conclusion
In this paper, we proposed a novel interpretation of the attention map as DTMC. By treating such maps as stochastic matrices, we showed that taking into account higher-order interactions between tokens results in better performance on various downstream tasks. We further showed the stationary vector TokenRank can help depict global incoming and outgoing attention within single head.
Limitations and future work. Our approach is limited to square matrices (e.g. self-attention/ / hybrid-attention blocks). Therefore, cross-attention blocks do not naturally fit into our Markov chain formulation due to the existence of non-accessible states. There could potentially be way to resolve this by introducing dummy states with uniformly distributed transition probability. Additionally, computing the second eigenvalues λ2 is computationally heavy. Computing multiple bounces or the TokenRank on the other hand is quite performant, and converges typically after 10 to 20 iterations. Finally, we observe that the performance gains with TokenRank are larger for transformers where the attention map more structured. We envision that this framework opens up new possibilities for analyzing, understanding, and modeling the attention operation, and may be used in conjunction with other end-to-end explainability tools to enhance understanding of visual transformers. This can also serve various other domains such video, audio, motion, as well as natural language processing.
Acknowledgments
This research was supported in part by the Len Blavatnik and the Blavatnik family foundation and ISF number 1337/22. We would like to thank Hila Chefer and Jonas Fischer for the valuable feedback. We further thank Siddhartha Gairola, Amin Parchami, and Wanyue Zhang for fruitful discussions.
10

---

References
Samira Abnar and Willem H. Zuidema. Quantifying attention flow in transformers. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020. Association for Computational Linguistics, 2020.
Reduan Achtibat, Sayed Mohammad Vakilzadeh Hatefi, Maximilian Dreyer, Aakriti Jain, Thomas Wiegand, Sebastian Lapuschkin, and Wojeiech Samek. AttLRRP: Attention-awen aware layer- wise relevance propagation for transformers. In Proceedings of the s International Conference on Machine Learning. PMLR, 2024.
Yuval Alaluf, Daniel Garibi, Or Patashnik, Hadar Averbuch-Eloo and Daniel Cohen-Or. Cross- image attention for zero-shot appearance transfer. In ACM SIGGRAPH 2024 Conference Papers, pages 1 1-12, 2024.
Alexander Binder, Gnégoire Montavon, Sebastian Lapuschkin, Klaus- nouu--Roertt Müller, and Wojciech Samek. Layer-wise relevance propagation for neural networks with local renormalization layers. In Artificial Neural Networks and Machine Learning- ICANN 2016: 25th International Conference on Artificial Neural Networks, Barcelona, Spain, September 6-9, 2016, Proceedings, Part II 25, 2016.
Mikotaj Binkkwski, Dougal J. Sutherland. Michael Arbel, and Arthur Gretton. Demystifying MMD GANs. In International Conference on Learning Representations, 2018.
Walid Bousselham, Angic Boggust, Sofian Chaybouti, Hendrik Strobelt, and Hilde Kuchne. Legrad: An explain- ability method for vision transformers via feature formation sensitivity, arXiv preprint (xXxx22444.032144 2024.
Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties self-super vision transformers, In Proceedings of the IEEE/CVF international conference on computer vision, 2021.
Hila Chefer, Shir Gur, and Lior Wolf. Generic attention explainability for interpreting bi- -odmoll and encoder-decnder transformers. In Proceedings of the IEEE/CVF international conference on computer vision, 2021a.
Hila Chefer, Shir Gur, and Lior Wolf. Transformer interpretability beyond attention visualization. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2021b.
Rishabh Dabral, Muhammad Hamza Mughal, Vladislav Golyanik, and Christian Thcobalt. Mofusion: A wireiiinnnifffiio---r diffusion-based motion synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pottern recognition, 2023.
framework for denoising-
Timothée Darcet, Maxime Oquah, Julien Mairal, and Piotr Bojanowski. Vision transformers need registers. In The Twelfth International Conference on Leaminng Representations, 2024.
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hicrarchical image database. 2009 IEEE conference on computer vision and pattern recognition. Icce, 2009.
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenbom. Xiaohua Zhai, Thomas Unterthiner. Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image worth 16x words: Transformers for image recognition scale. In International Conference on Learning Representations, 2021.
Olaf Dünkel, Thomas Wimmer, Christian Theohalt, Christian Rupprecht, and Adam Kortylewski. Do it yourself: Learning semantic correspondence from pscudo-labels. arXiv preprint arXiv:2506.05312, 2025.
Batu El, Decpro Choudhury, Pictro Liò, and Chaitanya K Joshi. Towards mechanistic intcrpretabilityy of graph transformers via attention graphs. arXiv preprint arXiv:2502.12352 2025.
Dumitru Erhan, Yoshua Bengio, Aaron Courville, and Pascal Vincent. Visualizing higher-layer features of a deep network. University of Montreal, 1341(3):1, 2009. 2009.
Chaofan Gan, Yuanpeng Tu, Xi Chen, Ticyuan Chen, Yuxi Li. Mchrtash Harandi, and Weiyao Lin. Unleash- ing diffusion transformers for visual correspondence by modulating massive activations. arXiv preprint arXhv:2505./8588 2025.
Yossi Gandelsman, Alexci A Efros, and Jacob Steinhardt. Interpreting CLIP's image representation via text-based dccomposition. In The Twelfth International Conference Learning Representations, 2024.
Yaru Hao, Li Dong, Furu Wei, and Ke Xu. Self attention attribution: Interpreting information interactions inside transformer. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 2021.
11

---

Ali Hatamizadeh, Jiaming Song, Guilin Liu, Jan Kautz, and Arash Vahdat. Diffit: Diffusion vision transformers for image generation. In European Conference on Computer Vision, pages 37-55. Springer, 2024.
Alec Helbling. Tuna Han Salih Meral, Ben Hoover, Pinar Yanardag, and Duen Horng Chau. Conceptattention: Diftusion transformers learn highly interpretable features. arXiv preprint arXiv:2502. 04320, 2025.
Amir Hertz, Ron Mokady, Jay Tenenbaum, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. Prompi-to-pronpl image editing with cross coss-attention control. In International Conference Learning Representations, 2023,
Martin Heusel. Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by scaee update rule converge local nash equilibrium. Advances in neural information processing systems, 30, 2017.
Susung Hong. Gyuseong Lee. Wooseok Jang. and Seungryong Kim. Improving sample quality of diffusion models using self-attention guidance. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7462-7471, 2023.
Jeremy Howard. Imagenette: smaller subset of 10 easily classified classes from imagenet. https://gitthb http//fasaaiimmmeeeeene 2019.
Muhammed Emrullah Ildiz, Yixiao Huang. Yingeong Li, Ankit Singh Rawat, and Samet Oymak. From self- attention to Markov models: Unveiling the dynamics of generative transformers. In Proceedings of the 4 International Conference on Machine Learning, pages 20955-20988 PMLR, 2024.
Salman Khan, Muzammal Naseer, Munawar Hayat, Syed Waqas Zamir, Fahad Shahbaz Khan, and Mubarak Shah. Transformers in vision: A survey. ACM computing surveys (CSUR), 54(10s):1-41, 2022.
Black Forest Labs. Flux. https::/github.ccom www.e///oococccccoooeeeee-eeeeee fabs--far-r------lra---a 2024.
Claudio Landim. Metastable Markov chains. Probability Surveys, 16, 2019.
Amy N Langville and Carl D Meyer. Deeper inside pagerank. Internet Mathematics, 133:3355-880, 2004.
Bingyan Liu, Chengyu Wang, Tingfeng Cao, Kui Jia, and Jun Huang. Towards understanding cross and self- attention in stable diffusion for text-guided image editing. In Proceedings of the IEEE/CVF conference on computer vision and puttern recognition, pages 7817-7826, 2024.
Faridoun Mehri, Mahdieh Soleymani Baghshah, and Mohammad Taher Pilehvar. Libragrad: Balancing gradient flow for universally better vision transformer attributions. arXiv preprint arX6v:2411.16660, 2024.
Quang Nguyen, Truong Vu, Anh Tran, and Khoi Nguyen. Dataset diffusion: Diffusion-based synthetic data generation for pixel-level semantic segmentation. Advances Neural Information Processing Systems, 36: 76872-76892, 2023.
Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy V. Vo. Mare Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel HAZIZA, Francisco Massa, Alaaeldin El-Nouby. Mido Assran, Nicolas Ballas, Wojeiech Galuba, Russell Howes, Po-Yan Yao Huang, Shang- Wen Li, Ishan Misra, Michael Rabbat, Vasu Sharma, Gabriel Synnaeve, Hu Xu, Herve Jegou, Julien Mairal, Patrick Labatut, Armand Joulin, and Piotr Bojanowski. DINOv2: Learning robust visual features without supervision. Transactions on Machine Learning Research, 2024.
Seang-Wen!ie
Lawrence Page, Sergey Brin, Rajeev Motwani, and Terry Winograd. The pagerank citation ranking: Bringing order the web. Technical report, Stanford infolab, 1999.
Sigal Raab, Inbar Gat, Nathan Sala, Guy Tevet, Rotem Shalev-Arkushin, Ohad Fried, Amit Haim Bermano, and Daniel Cohen-Or. Monkey see, monkey do: Harnessing self-attention in motion diffusion for zero-shot motion transfer. In SIGGRAPH Asia 2024 Conference Papers, pages 1-13, 2024.
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pages 8748-8763. PmLR, 2021.
Maithra Raghu, Thomas Unterthiner, Simon Korblith. Chiyuan Zhang, and Alexey Dosovitskiy, Do vision transformers see like convolutional neural networks? Advances in neural information processing systems. 2021.
Hubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl, Michael Widrich, Thomas Adler, Lukas Gruber, Markus Holzleitner, Milena Pavlović, Geir Kjetil Sandve, et al. Hoptield networks is all you need. arXiv preprint htt.:22000.02211111 2020.
12

---

Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjöön Ommer. High-resolution image synthesis with latent diffusion models. In Proceedings the IEEE/CVF conference computer vision and pattern recognition, 2022.
Tim Salimans, Ian Goodfellow, Wojeiech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans, Advances in neural information processing systems, 29, 2016.
Imanol Schlag, Kazuki Irie, and Jürgen Schmidhuber. Linear transformers secretly fast weight programmers. In International conference on machine learning. PMLR, 2021.
Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman. Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion-5b: An open large-scale dataset for training next generation image-text models. Advances in neural information processing systems, 35: 25278-25299 2022.
Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-basee localization. In Proceedings of the IEFE international conference computer vision, pages 618 618-626, 2017.
Yawar Siddiqui, Antonio Alliegro, Alexey Artemov, Tatiana Tommasi, Daniele Sirigatti, Vladislav Rosov, Angela Dai, and Matthias Nießner. Meshgpt: Generating triangle meshes with decoder-only transformers. In Proceedings of IEEE/CVF conference on computer vision and pattern recognition, pages 19615-19625, 2024.
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv: 1312.6034, 2013.
Nick Stracke, Stefan Andreas Baumann, Kolja Bauer, Frank Fundel, and Bjöm Ommer. Cleandift: Diffussin features without noise. In Proceedings of the Computer Vision and Pattern Recognition Conference, pages 117-127, 2025.
Raphael Tang, Linqing Liu, Akshat Pandey, Zhiying Jiang. Gefei Yang. Karun Kumar, Pontus Stenetorp, Jimmy Lin, and Ferhan Türe. What the daam: Interpreting stable diffusion using cross attention. In Proceedings of the st Annual Meeting of the Association for Computational Linguistics (Volume I: Long Papers), pages 5644-5659, 2023.
Junjiao Tian, Lavisha Aggarwal, Andrea Colaco, Zsolt Kira, and Mar Fonzalez-Franco. Diffuse attend and segment: Unsupervised zero-shot segmentation using stable diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Puttern Recognition, pages 3554-3563, 2024.
Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philiipe Moreney, and Ruslan Salakhutdinov. Trans- former dissection: An unified understanding for transformer's attention via lens kernel. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing JEMNLP-IJCNLL Association for Computational Linguistics. 2019.
Narek Tumanyan, Michal Geyer, Shai Bagon, and Tali Dekel. Plug-and- play diffusion features for text-driven image-to-ing -maaea translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1921-1930, 2023.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
Elena Voita. David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. Analyzing multi-head self-attention: Specialized heads the heavy lifting, the rest can be pruned. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. Association for Computational Linguistics, 2019.
Yuxin Wen, Jim Wu, Ajay Jain, Tom Goldstein, and Ashwinee Panda. Analysis of attention in video diffusion transforeers arXiv preprint arXiv:2504.10317, 2025.
Xiaoyang Wu, Li Jiang, Peng-Shual Wang. Zhijian Liu, Xihui Liu, Yu Qiao, Wanli Ouyang, Tong He, and Hengshuang Zhao. Point transformer v3: Simpler faster stronger. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1840-4851 2024.
13

---

NeurIPS Paper Checklist
1. Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification: Our contributions are mentioned the abstract and the introduction, formalized in the method chapter and supported through extensive experiments in the main paper and additional experiments in the supplementary.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should clearly state the claims made, including the contributions made the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
It is fine to include aspirational goals as motivation long it is clear that these goals are not attained by the paper.
2. Limitations
Question:
Does the paper discuss the limitations the work performed by the authors?
Answer: [Yes]
Justification: We propose new interpretation the attention operation used in transformers. We specifically point out the (constraining) assumptions we make for this interpretation Sections B.I and and we list limitations in section 6
Guidelines:
The answer NA means that the paper has limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create separate "Limitations" section in their paper.
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g.. independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should articulated.
The authors should reflect on the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or speech-to-text system might not be used reliably provide closed captions for online lectures because it fails handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairesss.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, worse outcome might be that reviewers discover limitations that aren't acknowledged
the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory assumptions and proofs
14

---

Question: For each theoretical result, does the paper provide the full set of assumptions and complete (and correct) proof?
Answer: [NA]
Justification: Our paper does not propose new theoretical results.
Guidelines:
The answer NA means that the paper does not include theoretical results.
All the theorems, formulas, and proof' in the paper should be numbered and cross- referenced.
All assumptions should be clearly stated or referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but they appear in the suppiemental material, the authors are encouraged to provide short proof sketch provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental result reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main ex- perimental results the paper to the extent that affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided not)?
Answer: [Yes]
Justification: The main paper includes the most relevant details to understand the performed experiments, while the supplementary provides more implementation details that allow reproducing the main experimental results of the paper.
Guidelines:
The answer NA means that the paper does not include experiments.
If the paper includes experiments, a No answer to this question will not perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution a novel architecture, describing the architecture fully might suffice, or if the contribution is specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how replicate the results, access hosted model (e.g.. in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
While NeurIPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily new algorithm, the paper should make it clear how to reproduce that algorithm.
(b) the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.
(c) the contribution is a new model (e.g., a large language model), then there should either be way access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (c.g., to registered users), but it should be possible for other researchers to have some path to reproducing verifying the results.
15

---

5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instruc- tions faithfully reproduce the main experimental results, described in supplemental material?
Answer: [Yes]
Justification: We open-source the code at hitcges//ggtab...mm//oteeerrrrrp chains code to reproduce the results.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurlPS code and data submission guidelines (https://nips.ccm
for more details.
While we encourage the release of code and data, we understand that this might not be possible, so "No" an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https
Codeeubmii ssi criionPooiccy for more details.
The authors should provide instructions on data access and preparation, including how access the raw data, preprocessed data, intermediate data, and generated data,
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments are reproducible, they should state which ones are omitted from the script and why.
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
Providing as much information possible in supplemental material (appended to the paper) recommended, but including URLs to data and code permitted.
6. Experimental setting/details
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
Answer: [Yes]
Justification: The main paper includes the most relevant training and test details necessary appreciate the results and make sense of them in the experiments section and it is supplemented with further implementation details in the supplementary material.
Guidelines:
The answer NA means that the paper does not include experiments.
The experimental setting should be presented in the of the paper to level of detail that is necessary to appreciate the results and make sense of them.
The full details can be provided either with the code, in appendix, or as supplemental material.
7. Experiment statistical significance
Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Answer: [Yes]
Justification: material.
We provide error bars and performed statistical tests in the supplementary
Guidelines:
The answer NA means that the paper does not include experiments.
The authors should answer "Yes" if the results are accompanied by emoor bars, confi- dence intervals, or statistical significance tests, least for the experiments that support the main claims of the paper.
16

---

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
The assumptions made should be given (e.g., Normally distributed errors).
should be clear whether the error bar is the standard deviation the standard error of the mean.
It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out range (e.g. negative error rates).
If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments compute resources
For each experiment, does the paper provide sufficient information on the com- puter resources (type of compute workers, memory, time of execution) needed reproduce the experiments?
Question:
Answer: [Yes]
Justification: The supplementary material includes details the compute budget for the experiments presented in the paper.
Guidelines:
The answer NA means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.
The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported the paper (e.g., preliminary or failed experiments that didn't it make it into the paper).
9. Code of ethics
Question: Does the research conducted in the paper conform, in every respect, with the NeurlPS Code of Ethics
Answer: [Yes]
Justification: After careful review of the ethics guidelines, we believe that our paper confirms to them.
Guidelines:
The answer NA means that the authors have not reviewed the NeurlPS Code of Ethics.
If the authors answer No, they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g., if there special consid- eration due to laws or regulations in their jurisdiction).
Broader impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [NA]
Justification: In this work, we propose a new interpretation of the attention operation, which improves downstream task performance. While, for example, better image segmentation can have positive and negative societal impacts, we do not think it is necessary to explicitly discuss our specific societal impact since the societal impact of transformers and computer vision systems in general have already been discussed in previous papers.
17

---

Guidelines:
The answer NA means that there is no societal impact of the work performed.
If the authors answer NA No, they should explain why their work has societal impact or why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious unintended uses (c.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deploymemt of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology being used intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
If there negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms monitor how system learns from feedback over time, improving the efficiency and accessibility ML).
11. Safeguards
Question:
Does the paper describe safeguards that have been put in place for responsible release of data models that have high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Answer: [NA]
Justification: In this work, we propose new interpretation of the attention operation. We believe that our work does not have a high risk for misuse that is more specific than the mere application of transformers.
Guidelines:
The answer NA means that the paper poses such risks.
Released models that have high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Licenses for existing assets
Question: Are the creators or original owners of assets (c.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [Yes]
Justification: All assets that have been used in this work were correctly cited following the best practice.
Guidelines:
The answer NA means that the paper does not use existing assets.
The authors should cite the original paper that produced the code package dataset.
18

---

The authors should state which version of the asset is used and, if possible, include URL.
The name of the license (e.g., CC-BY 4.0) should be included for each asset. For scraped data from a particular source (e.g.. website), the copyright and terms of service of that source should be provided.
If assets released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswi thcode com/ datasets has curated licenses for some datasets. Their licensing guide can help determine the license of dataset.
For existing datasets that are re-packaged, both the original license and the license of the derived asset (if has changed) should be provided. this information not available online, the authors are encouraged to reach out to the asset's s creators.
13. New assets
Question: Are new assets introduced in the paper well documented and the documentation provided alongside the assets?
Answer: [Yes]
Justification: We release new assets together with our published code at htttps://githtt httpo//rreeeattteeiiooo..aaaaaaa
Guidelines:
The answer NA means that the paper does not release new assets.
Researchers should communicate the details the dataset/code/moodl as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset used.
At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
14. Crowdsourcing and research with human subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification:
The paper does not involve crowdsourcing nor research with human subjects.
Guidelines:
The answer NA means that the paper does not involve crowdsoureing nor research with human subjects.
Including this information in the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included in the main paper.
According the NeurIPS Code of Ethies, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional review board (IRB) approvals or equivalent for research with human subjects
Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or equivalent approval/review based the requirements of your country or institution) were obtained?
Answer: [NA]
Justification: The paper does not involve crowdsoureing nor research with human subjects.
Guidelines:
19

---

The answer NA means that the paper does not involve crowdsoureing nor research with
human subjects.
Depending on the country in which research is conducted, IRB approval (or equivalent)
may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and expect authors adhere the NeurIPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
16. Declaration of LLM usage
Question:
Does the paper describe the usage of LLMs if it is important, original, or non-standard component of the core methods in this research? Note that if the LLM is used only for writing, editing, formatting purposes and does not impact the core methodology, scientific rigorousness, or originality of the research, declaration is not required.
Answer: [NA]
Justification: The core method development in this research does involve LLMs as any important, original, or non-standard components.
Guidelines:
The answer NA means that the core method development in this research does not involve LLMs as any important, original, non-standard components.
Please refer to LLM for what should or should not be described.
20

---

Attention (as Discrete-Time Markov) Chains
Supplementary Material
A Implementation Details
A.1 ImageNet Zero-Shot Segmentation
To establish fair comparisons, we followed the exact procedure described by Helbling et al. (2025) using the code from https://githubb. hton://pp///ggihbb..o////bbbbbbe categories single word, allowing methods conditioned on text to select the corresponding token. We use the timestep-distilled Flux-Schnell DiT (Labs) 2024) and add Gaussian noise to each of the images to the normalized timestep t = 0.5, resulting in two backward steps for denoising the image. We use the last 10 layers of the multi-stream attention blocks. The attention matrices from averaged. For the heads,
We simplity all
all aforementioned layers and timesteps averaging. For multi-bounce attention, we use the column-select formulation, i.e. we normalize the columns and transpose A as described in Section 4.2 of the paper.
the X2 weighting for
A.2 Improving Self Attention Guidance (SAG)
For the SAG experiments, we build on top of the code of (Hong al. 2023) provided in https
7/gi //github. cthmb.cco////...c SusungHong/ Self-llfffll Ael--Atteniiio Gui dance We use SDI.5 (Rombach et al. [0022) as the foundational model and use the second last decoder block's last self-attention layer for masking. We empirically observed it consistently resulted in the best results for both SAG and RoG+TokenRank, as opposed to the usage of the bottleneck layer in the comparison experiments in the original SAG, which is in line with the observation by Hong et al. (0023).
We compute the IS (Salimans al. 2016), FID (Heusel al. 2017), and KID (Binkowski al. 2018) metrics over 50K generated images, where the ground truth dataset is the LAION-Aesthetic V2 dataset (Schuhmann al.) 2022) originally used train SD1.5. We used the score 6.5 subset consisting of 625K images, and filtered it for score >> 6.65 and images with width and height larger than 512, resulting 72495 raw links, out of which roughly 50K were valid. After truncating to 50K, these images were used for computing the metrics. The selected metrics offer complementary information terms of quality (IS) and diversity and resemblance ground-truth distribution (FID/ KID). We use the unconditional branch only, and allow up to 40% of the attention matrix to be masked, following the original implementation.
A.3 Improving DiffSeg with TokenRank
We used the official code of Tian et al. (2024) provided in httttt::s/:gtttii com/ com/google/diffeee DiffSeg aggregates attention weights from all layers, where deeper layers are up-sampled. The aggregation is also Markov Chain (see Section and, therefore, TokenRank can be computed once per image. To create the TokenRank grid, we simply compute TokenRank and sort it by descending order, and greedily select the highest ranked token that is at least 5 units away from all currently selected tokens to act as suppression which avoid oversampling the same region. If not enough anchors can be selected in this way, remove the suppression and select the rest of the tokens by only considering their TokenRank. We use the same total amount of anchors as the baseline for faimess.
A.4 Masking Most Influential Tokens
For all transformers, we do not allow masking the CLS token in our evaluations, as it consistently ranks as the top most important token for almost all heads and layers, and discarding it yields an extreme drop accuracy, which does not allow for comparisons of the alternative approaches. For the same reason, we also only use the first half of the available attention layers for each model. This allows for not disturbing the output space too much and as a result accuracy performance degrades gracefully. Refer to Appendix D.2 for further justification of this choice. Moreover, mask out

---

Table 5: Linear probing. TokenRank extracts more informative signal that captures global incoming attention and results in a larger classification accuracy on the Imagenette dataset.
Accuracy
DINOv1
DINOv2
CLIP
Rand. Token
67.33 + 3.12
63.32 6.04
57.65 + 2.66
Center Token
66.32 3.08
75.34 1.85
68.42 - 2.66
Column Sum
75.64 + 2.74
90.76
73.73 2.98
TokenRank
77.31 + 2.50
92.73 = 1.51
73.88 + 2.86
CLS Token
81.53 + 2.44
94.07 + 0.97
72.46
3.40
the same number of tokens for all heads simultaneously. For DINO family type, results in the main paper are averaged over the ViT-B/16, ViT-B/32, ViT-S/16, and ViT-S/32 architectures. For DINOv2 family type, we use the w/ registers variation, and average over the ViT-B/14, ViT-S/14 and VIT-L/14 architectures. For both DINO and DINOv2 family types, we use pretrained linear classifier heads provided with the original publications. We average ViT/B and ViT/L for the transformer models trained in supervised way. For CLIP family type, average and ViT-L/14/336 architectures. We use the template prompt "A photo a <class>" to compute per-class text features. Then, compute dot- dot-product with the image features and these per-class features to determine the classification result. Masking is performed by setting the entire column corresponding token -00 prior to softmax. For a more in-depth view of individual model accuracy degradation, see Appendix[]
the ViT-B/32, ViT-L/14
B Linear Probing of TokenRank
To quantitatively evaluate that TokenRank produces sharper maps and captures the global information contained in the attention matrices, we train a linear classifier on top of all proposed attention visualizations, inspired by previous similar analysis (Liu et al. 2024). For this purpose, we extract attention visualizations for all layers, heads, and images for the ImageNet (Deng al.. (2099) subset Imagenette (Howard, 2019) for three foundation models without considering the CLS token. The results Table show that TokenRank visualizations result in a cleaner signal for image classification than previous approaches that only consider one bounce of attention. It is on par with row-selecting the CLS token, which is an upper bound because was specifically trained to capture class concepts for the DINO model family. Note error bars are reported over 5 different runs each with different seed. We performed a Wilcoxon test with the null hypothesis that the competing column sum operation results in the same accuracy TokenRank and the one-sided alternative hypothesis that the accuracy is lower. We reject the null hypothesis for DINOv1 with p=0.03 and for DINOv2 with p=0.03.
We generate attention maps for all layers, heads, and images for the ImageNet (Deng et al., 2009) subset Imagenette (Howard) 2019) for DINOv1, DINOv2, and CLIP with a VIT/B model. Then, we compute attention visualizations with column sum, TokenRank, row-selecting the center token, and row-selecting the CLS token. Finally, we train a linear classifier with the commonly used train and test split and with the attention visualizations all layers and heads as input, optimized with the SGD optimizer with set of learning rates ([le - 5, 2e - 5, 5e - 5, 1e - 4, 2e 4. 5e 4, 1e - 3))) for 20 epochs, and we choose the best performing model, similar to Oquab et al. (2024). We resize and center crop the images to get 905 905 (901 x 901) attention maps for DINOv2 with registers (other models). We exclude the CLS token column for classification.
Linear Probing of Weightet Aggregated Heads Additionally, also train linear classifiers on top of the TokenRank vectors (incoming attention) per layer, where we use different weighting schemes for the head dimension. For this, we first compute the weighting coefficients per head and perform weighted average of the heads. Then, we compute TokenRank for the aggregated results. We compare uniform weighting (simple average), random weighting, and A2 weighting. Results are presented in Table 6 While random weighting is significantly worse, X2 weighting performs better than simple averaging, particularly for transformers with well-structured latent space, such as DINOv2 with registers.

---

Table Linear probing steady state vectors after aggregating heads. 22 weighting is better than uniform weighting.
Method
uniform
random
A
CLIP 49.07
44.07
49.07
DINOvI
53.50
47.21
53.55
DINOv2
71.62
50.29
72.36
Table 7: ImageNet segmentation. Ablation and
choice.
Method
Acc
mIoU
mAP
row-select (n = 1)
73.96
54.65
82.64
column-select (n
80.55
64.02
87.20
single-channel
69.63
51.73
80.50
incoming (n
83.73
69.58
93.68
incoming (n = 3)
82.93
68.81
94.01
outgoing (n
79.25
63.32
89.80
outgoing (n 2)**
84.12
70.20
94.29
C Additional Segmentation Results
C.1 Ablation and Hyperparameters
See Table 7 for zero-shot ImageNet segmentation results using the same experimental setup in the main paper, with different hyper parameter choices. The bottom of Table 7 shows "outgoing (n 2)**, corresponding to the result shown in the main paper, leveraging the second bounce from one-hot column vector and utilizing À weighting. "row-select (n = 1)" and "column-select (n = 1)" the naive first bounce operation also shown in the main paper. "single-channel" uses the single channel attention blocks in FLUX rather than the dual-channel blocks. "incoming (n = 2)" uses the incoming attention formulation of multi- wwwnce-attentneeeeee row vector). "incoming (n 3)" is the same but with bounces. "outgoing (n = 3)" uses a one-hot column vector with 3 bounces. "w/o '2" does
(i.e. second bounce from one-hot
the weighted X2 scheme. Notice the performance for outgoing attention degrades rapidly with more bounces ("outgoiig (n = 2)*", "outgoing (n 3)") compared to incoming attention ("incoming (n = 2)", "incoming (n 3)"). This is because for outgoing attention, the steady-state eventually converges into emphasizing important "hubs", which usually tends be background information. However, in early bounces (n 1, 2) out-performs the incoming attention, and we speculate this is because it captures better the target of this task: we are interested in finding which image tokens "attend-to" the text token of interest (i.e. a many-to-one relationship).
We additionally report error bars in Table 8 that computed standard deviations over 5 runs with different seeds.
C.2 Further Qualitative Results
See Figures 13 and [4 for more zero-shot segmentation results on ImageNet with comparisons to row- and column select and state-of-the-art results using ConceptAttention (Helbling al.) 2025).
We argue that our raw segmentation masks are cleaner and more precise, which can be qualitatively measured by the threshold-agnostic mAP metric presented the main paper. Additionally, in Figure 6 we show our multi- moutt--bunce attention can be used for segmenting different parts of an image by setting initial one-hot vector to the corresponding text token. The text prompt used to create the image was "cute black cat standing up wearing red boots and a bow tie, photorealistic, masterpiece, macro wildlife photography, dewy grass, closeup low angle, wildflowers, sun, shadows, depth of field, desaturated, film grain, low quality".

---

Table 8: ImageNet segmentation. Error bars for selected runs.
Method
Acc
mloU
mAP
Concept Attention
81.06 + 0.01
66.02 = 0.01
88.43 + 0.00
Ours no A2
84.00 + 0.02
69.99 = 0.05
94.26 = 0.04
Ours
84.11 + 0.03
70.19 = 0.02
94.32 + 0.03
Boots
Cat
Tie
Figure 6: Part segmentation. We segment different parts of the image by setting the initial one-hot vector to the corresponding text token.
D Additional Results for Masking Most Influential Tokens
D.1 Per-Model Results
In Figure 7 show the results of performing the most-influential token masking experiment deseribed in the main paper for individual models. The area-under-curve (AUC) metric in the main paper computed over the curves.
D.2 Per-Layer Results
In Figure we show the result of choosing progressively more number of layers mask for the most- most-influential token masking experiment conducted in the main paper. "6 (Ours)" indicates what we used in the paper. Layers are selected starting from the furthest from the output. The results are shown for DINOv2 (ViT-S/14) w/ registers over the same dataset used in the main paper. However, similar trends were observed for all architectures. We opted for masking tokens from only the first 50% of the layers to avoid distorting the output space and too steep performance drop (which happens for > 6), while still having an effect on the classification results for higher token mask percentage (which does not occur for < 6).

---

ViT-B/16
VIT-L/16
CLIP (VIT-8/32)
CLIP (ViT-L/14)
100
50
% from Max Accuracy
0
50
100
50 DINO (VIT-S/8)
100
50
100
100
CLIP (VIT-L/14/336)
DINO (VIT-S/16)
DINO (VIT-B/8)
100
50
100
50
1.00
50
100
100
DINO (VIT-B/16)
DINOv2 (VIT-S/14)
DINOv2 (VIT-//14)
DINOv2 (ViT-L/14)
100
50
0
50
100
0
50
100
50
100
100
% of Masked Tokens
TakenRank
- Column Sum
-+-
Rand. Token
CLS Token
Center Token
Figure 7: Token masking. Using TokenRank to mask out tokens better degrades performance on average across multiple architectures and training types.
Table 9: Statistical test for 22 weighting. The results of the Wilcoxon test show that X2 weighting significantly better than uniform weighting.
Semantic Segmentation
Linear Probing
Metric
Statistic
p-value
Model
Statistic
p-value
Ace
15.0
0.031
DINOv1
45.0
0.002
mloU
15.0
0.031
DINOv2
42.0
0.010
mAP
15.0
0.031
CLIP
45.0
0.002
E
Additional Results for X2 Weighting
F.1
Statistical Tests for X2 Weighting
In this section we provide more evidence that the magnitude of the second largest eigenvalue of the attention matrix correlates with the performance in both zero-shot segmentation (Section 5.1 and linear probing (Appendix B). as presented in the main paper. We illustrated this effect via weighted averaging of heads. To test the significance of our observation, we perform paired data statistical test (Wilcoxon test) for both tasks. For this purpose, we define the null hypothesis: Uniform and X2 weighting have the same performance. And the one-sided alternative hypothesis: Weighting results in a better performance. Results of can be seen in Table 9 Rejecting the null hypothesis with p < 0.05 supports statements.
5

---

100
% from Max Accuracy
(Ours)
7
50
10
11
12
50
100
% of Masked Tokens
Figure 8: Layer selection for DINOv2 (ViT-S/14). Numbers indicate the number of attention layers being masked starting from the closest the input. Masking fewer layers introduces noise into measurements, while masking more of them results in a faster drop accuracy allowing less room for comparisons. We chose mask 50% of the layers for all experiments; in this case "6 (Ours)" variation was used.
100
% from Max Accuracy
Uniform
Random
A2
50
50
100
% of Masked Tokens
Figure 9: Aggregating heads. We used TokenRank mask tokens while using different weighting schemes for the head dimension. X2 yields a larger drop in accuracy compared to uniform or random weighting.
E.2 A2 Weighting for Masking Most Influential Tokens Experiment
We performed another token masking experiment similar to the one conducted in of the paper, only using TokenRank for determining the masking order. this experiment, we compare using uniform weights per head (as in main paper), random head weights, and using A weighting. Results can be seen in Figure 9 Perhaps unsurprisingly. randomly weighting the heads performs better than uniform weights, as the transformer is more sensitive to individual heads being fully or almost fully masked out, rather than gradually masking out all heads together. Importantly, results indicate that X2 weighting can be used for increasing the degradation in accuracy, suggesting it can serve as a useful tool for determining importance of heads. This was also observed improve zero-shot segmentation results (see Appendix C

---

Input
n=2 n=
n
Figure 10: Illustration of multi-bounce attention. We visualize the first bounces and the steady state (TokenRank) when propagating through the Markov chain, defined by two attention matrices of two exemplary layers and heads DINOv2. The initial state (n 0) is defined by a one-hot vector.
Image
n
n
71 +
Figure 11: Illustration of bouncing for image and random input. Bouncing the attention signal sharpens the DINOv1 attention map for realistic input image, supporting the existence of meta- stable states. On the contrary. random input image results in a fast converging Markov chain, where intermediate bounces not differ clearly from the first bounce and disperse rather than cluster. This observation is also reflected in the second eigenvalues: X2 0.44 for the real image and ) 0.16 for the random image, where smaller second eigenvalue corresponds to faster convergence.
Illustration of Bouncing as Consolidation Mechanism
Figure visualizes the first bounces and the steady state two example images, heads and layers.
Figure II also illustrates that iterating over the Markov chain results in an iterative refinement of the map, consolidating meta-stable states. The steady state eventually visualizes the global incoming attention. This effect cannot be observed for an input image with random pixels (Figure [T] bottom). Instead, the Markov chain converges very quickly to a dispersed visualization after one step for noisy input, as the attention matrix is not structured. We compute the visualizations by passing the images through DINOv1 and extracting the attention map in the 9th layer and 3rd head. Then, we compute the first bounce (n. 1) with uniform initial vector, the 2nd bounce, and the steady state. The same effect can be seen in Figure [ where second bounce (Ours) is significantly cleaner and better adheres to the object boundaries compared to the first bounce (Column Select).
7

---

G
More SAG Results
In Figure show more results comparing vanilla SD1.5 (Rombach al. 2022). SAG (Hong
et al. 2023 and SAG+TokenRank.
H
Per-Head TokenRank Visualizations
We show more visualizations for TokenRank, column sum, Center Patch, and CLS token for various heads and layers in Figure 15 and Figure 16
I Visualization Across Generation Timesteps
In Figure 17 We show generated image results of using FLUX-Dev with 50 timesteps. We computed the TokenRank (incoming attention) and average over every 5 consecutive timesteps shown in every column (first entries correspond to noisier timesteps, while last entries are more noise-free). The TokenRank visualizations remain stable through the timestep dimension. It can be observed how attention maps are getting sharper during the denoising process, illustrating that TokenRank can serve visualize and analyze generative models.
Used Compute
The image segmentation experiments with FLUX required around 1500 GPU hours, where one experiments takes around 50 GPU hours. Extracting all attention map visualizations for the linear probing experiment and training the linear classifier took around 300 GPU hours. We performed around 40 experiments for the masking experiment, where each experiment required around 30 GPU hours, resulting in around 1200 GPU hours in total. Finally, the SAG experiment took around 1000 GPU hours. total, we estimate the use of around 4000 GPU hours for the whole study. For all computations, used internal GPU cluster consisting of NVIDIA A40, A A100, H100, and RTX 8000 GPUs

---

SAG+
SD1.5
SAG
TokenRank
VIDEI
Figure 12: Improvement of SAG. Using TokenRank produces less artifacts and more structured images.

---

Orig. Img.
Colum Select
ConceptAttention
Ours
GT Mask
Figure 13: ImageNet segmentation. Our results are par with state of the art ConceptAttention Hellling al. 2025).
Orig. Image
Row Select
Column Select
Ours
GT
Figure 14: ImageNet segmentation. We visualize the raw attention output (colored) and the binary segmentation masks for the row- and column- select operations compared to utilizing multi-bounce attention.
10

---

TokenRank
Col.-Sum
CenterPatch
CLS
TokenRank
Col.-Sum
CenterPatch
CLS
Heads for layer 2
Heads for layer 2
TokenRank
Col,-Sum
CenterPatch
CLS
TokenRank
Col.-Sum
CenterPatch
CLS
Heads layer 6
Heads for layer 6
TokenRank
Col.-Sum
CenterPatch
CLS
TokenRank
Col.-Sum
CenterPatch
CLS
Heads for layer 10
Heads for layer 10
Figure 15: Per-head visualizations of global incoming attention. We plot with different visualiza- tion strategies for various layers and the first four heads for DINOv1 (ViT-B/8), Images correspond to the lower row of Figure 4 in the main paper.

---

TokenRank
Col,-Sum
CenterPatch
CLS
TokenRank
Col.-Sum
CenterPatch
CLS
Heads for layer 2
Heads for layer 2
TokenRank
Col.-Sum
CenterPatch
CLS
TokenRank
Col.-Sum
CenterPatch
CLS
Heads for layer 6
Heads for layer 6
TokenRank
Col.-Sum
CenterPatch
CLS
TokenRank
Col.-Sum
CenterPatch
CLS
Heads for layer 10
Heads for layer 10
Figure 16: Per-head visualizations of global incoming attention. We plot with different visualiza- tion strategies for various layers and the first four heads for DINOv1 (ViT-B/8) Images correspond to the lower row of Figure 4 in the main paper.
12

---

Figure 17: Timestep stability. Top: generated images using FLUX-Dev with 50 timesteps. Each column depicts the TokenRank (incoming attention) for increasingly denoised images during the diffusion process. Rows correspond to decreasing timesteps.
13


Reviews:
[{"review_id": "yfwT2N4vlJ", "reviewer": "Reviewer_BdYW", "summary": "This paper presents a novel and theoretically grounded interpretation of attention matrices as discrete-time Markov chains (DTMCs), introducing operations like multi-bounce attention, TokenRank, and \\lambda_2-weighted head averaging. The approach demonstrates state-of-the-art performance in zero-shot segmentation and improves unconditional image generation. The work is well-motivated, methodologically sound, and empirically validated.", "questions": "See weaknesses.", "limitations": "More limitations should be discussed.", "rating": 4, "confidence": 2, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 3, "originality": 3, "strengths_and_weaknesses": "Strengths:\n\n1.\tFraming attention matrices as DTMCs is elegant and insightful. This allows modeling indirect attention paths (via Markov transitions), moving beyond prior work limited to direct interactions.\n\n2.\tExtensive experiments are conducted to show its SOTA performance on zero-shot segmentation and the effectiveness of TokenRank.\n\nWeaknesses:\n\n1. Experiments are limited to image tasks (image segmentation/generation). More validation in NLP or multimodal settings will be helpful to illustrate its effectiveness and domain generality.\n\n2.\tMore ablation studies to evaluate the contributions of individual components (e.g., \\lambda_2 vs. multi-bounce) are suggested.\n\n\n3.\tThe discussions about the limitations are insufficient.", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewers for their constructive feedback and ideas. We are happy that the reviewers like the elegant and insightful framework (BdYW) that is grounded in both theoretical insight and empirical validation (pbyL), its effectiveness (BdYW,YchT) and novelty (BdYW,mHJ9,pbyL,YchT), and the clear and well-structured description (mHJ9,pbyL). The provided feedback helps us to improve the paper and we will address the individual concerns raised by reviewer BdYW below. \n\n>More validation in NLP or multimodal settings will be helpful to illustrate its effectiveness and domain generality.\n\nThank you for this comment. While we fully appreciate our study's impact would have been stronger by validating with other modalities, we intentionally focused on extensive and rigorous experimentation on one specific domain for the purpose of anchoring this interpretation as useful and impactful. Exploring the usefulness of our framework for other domains such as NLP, human motion, or video would be an exciting future work prospect.\n\n> More ablation studies to evaluate the contributions of individual components are suggested.\n \nWe will move the ablation table (Tab. 1 in the supplementary, for semantic segmentation) to the main paper to make it easier for readers to assess the contribution of individual components. If there are specific ablations the reviewer is interested in that do not appear in the table, we commit to providing them.\n\n\n> The discussions about the limitations are insufficient.\n\nWe agree with the suggestion to discuss limitations in further detail. The main drawbacks of using our framework are:\n- Our formulation is limited to square matrices (e.g. self-attention / hybrid-attention blocks). Therefore, cross-attention blocks do not naturally fit into our Markov chain formulation due to the existence of non-accessible states. There could potentially be a way to resolve this by introducing dummy states with uniformly distributed transition probability.\n- The propagation of attention requires to process the attention maps post-process in an “offline” manner. We did not explore (and tend to be skeptical) that our framework can be leveraged to replace or improve a pre-trained transformer to perform its task better.\n- Computing the 2nd eigenvalues $\\lambda_2$ is very slow due to the inability to leverage rapid decomposition methods that rely on symmetry or PSD. Computing multiple bounces or the TokenRank on the other hand is quite performant, as it relies on vector matrix product operations, and convereges typically after 10 to 20 iterations.\n- We observe that the performance gains with TokenRank are smaller for transformers where the attention map is less structured. Consider, e.g., the masking experiment in Tab.4, where TokenRank brings a signficantly larger gain for DINOv2 than for a supervised ViT.\n\nThese limitations will be incorporated into the revised manuscript."}, {"review_id": "NC9gjH4htm", "reviewer": "Reviewer_mHJ9", "summary": "In this work, the authors present a new interpretation for the attention matrix by modeling it as a discrete-time Markov chain, providing fresh insights into the mechanism of attention. Specifically, this paper treats the attention matrix as a state transfer matrix and consider the stable state of it. In this way, the proposed method brings improvements in unconditional image generation and zero-shot image segmentation.", "questions": "See Weaknesses. If the authors are able to address all or some of the weaknesses, I would consider raising my score.", "limitations": "See Weaknesses.", "rating": 4, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 4, "significance": 3, "originality": 3, "strengths_and_weaknesses": "Strengths：\n\n1. This paper is easy to follow, with a clear description of the proposed method and the problem it aims to address. The solution presented by the authors is also reasonable.\n2. The results presented by the authors show that their method has clear advantages over other approaches.\n3. To my knowledge, this is the first work to consider about the stable state of attention matrix.\n\nWeaknesses：\n1. In Section 4.1, the authors describe existing interpretations of attention mechanisms. However, I find this description to be incomplete, as it does not mention [1], which merges attention maps using KL divergence. Moreover, the comparative experiments do not include a comparison with this method. If the authors believe that this method is not relevant to the present work, they may provide a rebuttal.\n\n2. The experimental results shown in Figure 6 of the supplementary material are convincing. However, I hope the authors can provide some visualizations of the feature maps or attention maps to further enhance the credibility of their results.\n\n3. In Figure 3, the authors only present some basic attention visualization methods, while most of the quantitative comparisons are provided in the supplementary material. Although this does not affect the review process, if the paper is accepted for publication, it would be necessary to include more qualitative results directly in Figure 3. Moreover, the comparative methods included in the supplementary material appear to be insufficient.\n\n4. In Figure 5, the authors demonstrate the effectiveness of the SAD method on the SD1.5 architecture. However, since SD1.5 is based on a UNet architecture, it would be valuable to include qualitative results on methods utilizing DiT-based architectures, such as PixArt or Flux.\n\n[1] Diffuse, Attend, and Segment: Unsupervised Zero‑Shot Segmentation using Stable Diffusion", "was_revised": true, "final_justification": "My main concerns have been addressed. The authors compare their method with [1] and show further improvements. So I raise my score from 3 to 4.", "rebuttal": "We thank the reviewers for their constructive feedback and ideas. We are happy that the reviewers like the elegant and insightful framework (BdYW) that is grounded in both theoretical insight and empirical validation (pbyL), its effectiveness (BdYW,YchT) and novelty (BdYW,mHJ9,pbyL,YchT), and the clear and well-structured description (mHJ9,pbyL). The provided feedback helps us to improve the paper and we will address the individual concerns raised by reviewer mHJ9 below. \n\n> In Section 4.1, the authors describe existing interpretations of attention mechanisms. However, I find this description to be incomplete, as it does not mention [1], which merges attention maps using KL divergence. Moreover, the comparative experiments do not include a comparison with this method.\n\nWe thank the reviewer for this reference. While this method does not provide any new interpretation of the attention maps per se (KL-divergence is used to measure similarity between upsampled attention maps), we agree it solves the same downstream task with partially similar toolkits (self-attention matrices, treating rows as probability distributions, aggregation of heads, etc.). We therefore evaluate [1] on our benchmark and found that our work outperforms [1] significantly:\n\n| Method | mAcc   | mIoU   | mAP    |\n|--------|--------|--------|--------|\n| [1]    | 65.41  | 52.12  | N/A    |\n| Ours   | 84.12  | 70.20  | 94.29  |\n\nFor [1], mAP cannot be computed since the method does not provide raw scores.\n\nNote: we acquired class-specific semantic segmentation labels from the predicted labels using the Hungarian algorithm, following the original author's implementation.\n\nAdditionally, inspired by the reviewer’s comment and in line with our goal of demonstrating the versatility of our framework, we incorporated TokenRank into the framework of [1]. Specifically, instead of sampling anchors from a uniform grid as in the original study the authors used a uniform grid to initialize the anchors used as seeds for their proposal algorithm. Instead, we sample anchors according to their TokenRank importance, with suppression to avoid repeatedly selecting the same location. This “smart” grid strategy leads to substantial improvements over the original approach, as demonstrated on COCO-Stuff-27 benchmark from [1]:\n\n| Method                     | mAcc   | mIoU   |\n|----------------------------|--------|--------|\n| Uniform Grid               | 72.50  | 43.60  |\n| \"Smart\" Grid (TokenRank)   | 84.97  | 44.87  |\n\n\nThis new experiment further strengthens our study by demonstrating the versatility of our framework. This experiment also shows our framework is orthogonal to other solutions leveraging self-attention for solving downstream tasks. We once again would like to thank the reviewer for introducing us to this study.\n\nWe will include the results in the updated manuscript.\n\n\n> The experimental results shown in Figure 6 of the supplementary material are convincing. However, I hope the authors can provide some visualizations of the feature maps or attention maps to further enhance the credibility of their results.\n\nThank you for the suggestion. While we did include additional visualizations in the supplementary (Fig. 7 for semantic segmentation and Fig. 8 for TokenRank), we will add further examples including more visualizations of the bouncing operation across different initial states, models, images, layers, and heads, as well as additional semantic segmentation examples.\n\n>it would be necessary to include more qualitative results directly in Figure 3. Moreover, the comparative methods included in the supplementary material appear to be insufficient.\n\nWe will add more qualitative results including comparisons to recent methods in Figure 3 and more results in the supplementary.\n\n> In Figure 5, the authors demonstrate the effectiveness of the SAD method on the SD1.5 architecture. However, since SD1.5 is based on a UNet architecture, it would be valuable to include qualitative results on methods utilizing DiT-based architectures, such as PixArt or Flux.\n\nWe agree that applying our approach to DiT-based architectures would strengthen the work. However, SAG was specifically designed and thoroughly tested for Stable Diffusion and is not readily compatible with models like PixArt, and certainly not FLUX (due to the lack of an unconditional branch). Our SAG experiment serves as a representative use case, demonstrating that TokenRank captures global importance more effectively than the column sum operation in a generative downstream task. We will mention the other models in the discussion."}, {"review_id": "vMmNapANdK", "reviewer": "Reviewer_pbyL", "summary": "This paper proposes a novel interpretation of attention matrices in transformers as discrete-time Markov chains (DTMCs), allowing for principled analysis of attention dynamics. By treating the attention matrix as a transition matrix, the authors are able to introduce concepts such as multi-bounce attention to capture higher-order token interactions, and TokenRank, a PageRank-inspired steady-state vector measuring global token importance. The framework leads to improved zero-shot segmentation performance, sharper visualizations of attention, and enhancements in generative tasks like diffusion-based image synthesis.", "questions": "The authors need to improve the readability of the work. My central concern is just how many results the authors are trying to show, but they end up falling short of satisfaction in each section.\n\n1. The work currently lacks a lot of details in the experiments section. Please pull all of this out of supplementary purgatory and put it into the main paper.\n2. No error bars are provided, therefore no claims about the significance of the results can be made. The authors claim in the checklist that experiments with error bars are **not** provided, but then justify this by saying that \"we run the segmentation results several times...\" So the authors have a way to provide error bars but choose not to? I don't agree with the \"computational expense\" excuse to not provide error bars. At least, discuss this in the main paper, not the checklist!\n\nIf the authors can address these two claims in their rebuttal (and therefore an edit of their paper), that will be satisfactory.", "limitations": "Yes", "rating": 5, "confidence": 5, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 3, "clarity": 3, "significance": 4, "originality": 4, "strengths_and_weaknesses": "I like this paper and found parts of it to be intuitive. However, there are areas in which I struggled to get sufficient detail. See below!\n\n# Strengths\n1.  The paper is clear, well-structured, and grounded in both theoretical insight and empirical validation.\n2. The interpretation of attention as a DTMC unifies many existing operations (row select, column sum, averaging) under a cohesive framework (L1-14, L36-43) and cleanly ties into the well-understood theory of PageRank.\n3. The proposed techniques yield state-of-the-art performance in zero-shot segmentation (Table 1), improved visualization fidelity (Figure 4), and boosts in generative tasks like SAG (Table 3).\n\n# Weaknesses\n1. L7-8: \"set of metastable states where the attention clusters while noisy attention scores tend to disperse.\" This phrasing is awkward and could benefit from clarification.\n2. L12-13: \"We demonstrate that using it brings improvements in unconditional image generation.\" It would be more informative to include specific quantitative results (e.g., improvement in FID/IS scores).\n3. L37: \"(non-negative)\". I'm not sure why this is in parentheses!\n4. L55/223: \"2nd\" should be spelled out\n5. L42-43: \"we argue that considering direct token relationships is not necessarily best for evaluating importance.\" This claim would benefit from a few more words. What characteristic should be considered instead/what is your method highlighting that these others are not?\n6. Section 3.1 discusses convergence to $v_{ss}$​, but it would be nice to tie this into the formalized equations where $v_{ss}$​ is explicitly shown as a left-hand side variable.\n7. L225-227: \"we hypothesize that larger values are statistically correlated with the amount of important information...\" No statistical test is presented to evaluate this hypothesis. Rephrase this as a nullable hypothesis, and then show the statistical significance of your findings to see if this hypothesis holds or does not hold.\n8. L255 + others: \"See supplementary for an illustrative example.\" So many critical details are offloaded to the supplement. The supplement is not even part of the main PDF, which drastically reduces the ease at which I can understand what's going on in the paper. Further, please reference specific sections in the supplement rather than vaguely referencing \"the supplementary\".\n9. L252-253: \"indicating that our method is on par and arguably better than the previous state-of-the-art...\" All of the comparisons in this paper lack error bars. Going back to weakness 7, how can anything be \"arguably\" better? It either is or isn't, and you can show that with error bars and a statistical test. These experiments results seem compelling but need significance to underline the claims.\n10. In general, the authors attempt to show too many use cases, which dilutes the focus. Section 5.3, which was highlighted in the abstract (!) gets minimal exposition. I would consider trimming less central experiments to allow for deeper analysis of key results. Right now the paper reads pretty thin.\n11. This work is not the first to relate attention and Markov Chains. It's worth citing Ildiz et. al [0] and discussing in the related works where this work differs.\n12. I'm not sure if I agree with an answer of \"NA\" to question 3 on the checklist. The authors are providing new theoretical results (tying attention to DTMC), but because they've left themselves no space, they are not able to clearly present this theory in the paper.\n13. Checklist question 4 is marked \"yes\", but even in the supplement, there is not enough detail about how the authors ran their experiments to redo them. Which experiments ran on which GPU (of the 4 types used)?\n\n\n[0] Ildiz, M. E., Huang, Y., Li, Y., Rawat, A. S., & Oymak, S. (2024). From self-attention to markov models: Unveiling the dynamics of generative transformers. arXiv preprint arXiv:2402.13512.", "was_revised": true, "final_justification": "The authors provided error bars and statistical tests for their results. This was my biggest gripe, and they addressed it!\n\nFurther, the authors were able to provide clarifications about their wording, and they have promised to trim the extraneous results and move the salient ones from the supplement to the main body.", "rebuttal": "We thank the reviewers for their constructive feedback and ideas. We are happy that the reviewers like the elegant and insightful framework (BdYW) that is grounded in both theoretical insight and empirical validation (pbyL), its effectiveness (BdYW,YchT) and novelty (BdYW,mHJ9,pbyL,YchT), and the clear and well-structured description (mHJ9,pbyL). The provided feedback helps us to improve the paper and we will address the individual concerns raised by reviewer pbyL below.\n\n\n> L7-8: \"set of metastable states where the attention clusters while noisy attention scores tend to disperse.\" This phrasing is awkward and could benefit from clarification.\n\nThis will be fixed to spell: “Our key observation is that tokens linked to semantically similar regions form \\textit{metastable} states, i.e., regions where attention tends to concentrate, while noisy attention scores dissipate.”\n\n> L12-13: \"We demonstrate that using it brings improvements in unconditional image generation.\" It would be more informative to include specific quantitative results.\n\nWe agree it is useful to mention in what aspects did the unconditional generation improve, but since this application is only one of many downstream tasks that our conceptual framework improves, we will fix this sentence to spell:\n“We show that TokenRank enhances unconditional image generation, improving both quality (IS) and diversity (FID)”.\n\n\n> L37: \"(non-negative)\". I'm not sure why this is in parentheses!\n\nWe will remove the parentheses.\n\n> L55/223: \"2nd\" should be spelled out\n\nWill be fixed.\n\n> L42-43: \"we argue that considering direct token relationships is not necessarily best for evaluating importance.\" This claim would benefit from a few more words.\n\nThanks. This paragraph draws an analogy between PageRank and our framework, where for webpages, simply counting incoming links will yield a bad metric of overall importance. Similarly, simply using direct attention (row- or column-select) to measure global relevance of a token underperforms compared to propagating it through the chain, as we show in various experiments. This considers indirect attention propagated through multiple bounces, eventually taking into account all indirect attention effects (steady-state). We will refine the paragraph to reflect this.\n\n> Section 3.1 discusses convergence to $v_{ss}$, but it would be nice to tie this into the formalized equations where $v_{ss}$ is explicitly shown as a left-hand side variable.\n\nWhile we can formulate $v_{ss}$ in closed form by taking the limit $v_{ss} = \\lim_{n\\rightarrow\\infty}([1 .. 0 .. 0]\\cdot A^n)$, this would be slightly less elegant since we wish for the readers to establish an intuition and familiarity with the power-method approach for later on. We believe it is quite straight forward to see why $v_{ss}$ is reached using the power method when $n\\rightarrow\\infty$.\n\n> L225-227: \"we hypothesize that larger values are statistically correlated with the amount of important information...\" No statistical test is presented to evaluate this hypothesis.\n\n\nWe appreciate this comment and agree with the suggestion.\nWe hypothesize that the magnitude of the second largest eigenvalue of the attention matrix correlates with the downstream task performance (zero-shot segmentation and linear probing). We illustrated this effect via weighted averaging of heads.\nTo test the significance of our observation, we perform a paired data statistical test, ie, the Wilcoxon test for semantic segmentation and linear probing. For this purpose, we define the null hypothesis: Uniform and $\\lambda_2$ weighting have the same performance. And the one-sided alternative hypothesis: $\\lambda_2$ weighting results in a better performance.\n\n\n**Semantic segmentation**\n\n| Metric               | statistic | p-value |\n|---------------------|------------|---------|\n| Acc  | 15.0       | 0.031   |\n| mIoU  | 15.0       | 0.031   |\n| mAP  | 15.0       | 0.031   |\n\n\n**Linear probing**\n\n| Model               | statistic | p-value |\n|---------------------|------------|---------|\n| DINOv1  | 45.0       | 0.002   |\n| DINOv2  | 42.0       | 0.010   |\n| CLIP    | 45.0       | 0.002   |\n\nRejecting the null hypothesis with $p<0.05$ supports our statements.\n\n>L255 + others: So many critical details are offloaded to the supplement.\n\nWe apologize for the inconvenience, and will use exact references to the supplementary.\n\n> L252-253: \"indicating that our method is on par and arguably better than the previous state-of-the-art...\" All of the comparisons in this paper lack error bars. Going back to weakness 7, how can anything be \"arguably\" better? \n\nThank you for pointing this out. We apologize for the unclear wording. The usage of \"arguably\" was not related to statistical significance. Instead, while Acc and mAP are largely better, we underperform ConceptAttention for mIOU. We argue that we are better than ConceptAttention (despite the drop in mIOU), as the threshold-agnostic metric mAP shows a large gap in performance. \nThe qualitative results in the supplementary (Fig.7) also illustrate how our attributions are smooth and intuitive, while the ones by ConceptAttention appear to be noisy and over-confident.\n\nHowever, following the comment about missing error bars, we computed mean and std for the following results:\n\n**Semantic segmentation**\n\n\n| Model                              | Acc             | mIoU             | mAP             |\n|------------------------------------|------------------|------------------|-----------------|\n| ConceptAttention                   | $81.06 \\pm 0.01$ | $66.02 \\pm 0.01$ | $88.43 \\pm 0.00$ |\n| Ours without $\\lambda_2$ weighting | $84.00 \\pm 0.02$     | $69.99 \\pm 0.05$    | $94.26 \\pm 0.04$  |\n| Ours | $84.11 \\pm 0.03$     | $70.19 \\pm 0.02$    | $94.32 \\pm 0.03$  |\n\n\nThe error bars (std) are computed over 5 runs with different seeds. We reproduced ConceptAttention using their implementation. The results are lower than the reported ones in their paper. However, the experiments show that different seeds do not have a significant influence on the computed results.\n\n\n**Linear probing** (Tab. 2)\n\n| Mode        | DINOv1   | DINOv2   | CLIP     |\n|-------------|---------------------|----------------------|---------------------|\n| Randompatch | $67.22 \\pm 3.12$    | $63.32 \\pm 6.04$     | $57.65 \\pm 2.66$    |\n| Centerpatch | $66.32 \\pm 3.08$    | $75.34 \\pm 1.85$     | $68.42 \\pm 2.66$    |\n| Colsum      | $75.64 \\pm 2.74$    | $90.76 \\pm 2.21$     | $73.73 \\pm 2.98$    |\n| TokenRank        | $77.31 \\pm 2.50$    | $92.73 \\pm 1.51$     | $73.88 \\pm 2.86$    |\n| CLS         | $81.53 \\pm 2.44$    | $94.07 \\pm 0.97$     | $72.46 \\pm 3.40$    |\n\nFurthermore, we performed a Wilcoxon test with the null hypothesis that the competing column sum operation results in the same accuracy as TokenRank and the one-sided alternative hypothesis that the accuracy is lower. We reject the null hypothesis with p=0.03 (DINOv1) and p=0.03 (DINOv2). \n\nWe believe the **masking results** (Sec. 5.4) are already stable since they were computed based on a set of models.\n\n\n>I would consider trimming less central experiments to allow for deeper analysis of key results.\n\nThank you for this suggestion. \nWe concur and we will move the probing experiments to the supplementary materials to allow a more elaborate discussion of the key results, particularly considering the effectivness of consdering additional bounces (semantic segmentation) and the evaluation of the global importance via TokenRank. \n\n\n>It's worth citing Ildiz et. al [0] and discussing in the related works where this work differs.\n\nThank you. Ildiz et. al [0] has slipped under our radar and considers modelling a 1-layer transformer as a Markov chain, and come to the significant conclusion that the *output* space is generated by transitioning through a recoverable matrix $A$ learned by the transformer, weighted by the frequency of tokens in the *input* prompt. This means that positional encoding for this case is not important, as the transformer merely assigns probability vectors for every token in the embedding and multiplies them by the frequency of the input prompt to generate a result. There are two main fundamental differences between our studies. First, we focus on large pretrained transformers and model each individual self-attention matrix as a Markov chain, while Ildiz et. al focus on a degenerate case of a single layer, and model the entire transformer pipeline as a Markov chain. While this allows Illdiz et. al to draw some conclusions and explanations regarding the behavior of larger transformers, we explicitly show how our framework allows for the interpretation of existing, pretrained large transformers and for a better performance in various tasks. Secondly, we leverage more of the machinery of the Markov chain theory, including multiple transitions and steady state analysis. This was not considered previously.\n\nWe will add this explanation to the related work section.\n\n>The authors are providing new theoretical results\n\nWe do not believe our study provides any new theoretical results. Our mathematical model and its application are well-understood and explored in other fields. Casting attention into these frameworks constitutes novelty, but not in terms of theory.\n\n>there is not enough detail about how the authors ran their experiments to redo them. Which experiments ran on which GPU (of the 4 types used)?\n\nWe politely disagree. We do believe the supplement provides details of how to reproduce our experiments, and do not think the GPU type has any effect on our results as long as the models fit into memory (other than the random seed, and performance speed). Furthermore, we are committed to publishing the full implementation of our framework, which will allow accurate reproduction of results. Please note we will also move substantial parts of the implementation details into the main paper, as suggested."}, {"review_id": "1YWhvUj7c2", "reviewer": "Reviewer_YchT", "summary": "This work proposes to interpret the attention matrix as the transition matrix of a markov chain. The multi-hop attention can then be computed to obtain a token importance measure of higher order. It then proposes TokenRank----the steady state vector of the markov chain that offers a better global token importance measure and can be used to improve several downstream tasks.", "questions": "See weakness 1.", "limitations": "See weakness 2 and weakness 3", "rating": 5, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": 4, "clarity": 4, "significance": 3, "originality": 4, "strengths_and_weaknesses": "Strength\n1. This method is novel in a sense that no one has interpreted the attention matrix as a transition matrix before. It attempts to provide a framework to unify previous interpretations and further improve the quality of the representation, using well-studied knowledge in the markov chain.\n2. The method is simple yet effective: By considering information from multiple hop of tokens, a better global representation can be built through simply multiplying the adjusted attention matrix iteratively. \n\nWeakness\n1. Efficiency: Although the operations seem simple, I would still like to know whether computing the TokenRank vector will have a cost in efficiency. I wonder how many iterations are needed on average to compute the steady state vector and how much time will they cost. When TokenRank is used in downstream tasks like zero-shot segmentation and unconditional image generation with SAG, how much time is added when using TokenRank?\n2. Minor point not affecting judgement: The work only demonstrates application on vision transformer models. It would be nice if we can see the application of TokenRank on natural language processing tasks like sentiment analysis etc to see if there is any caveat or new discovery. \n3. Exploration of TokenRank with multi-modal cross attention: I think this work itself is rather complete. Potential directions to explore would be seeing whether the representation generated by TokenRank can locate specific objects in local regions, instead of a global representation of the image presented in this work. Potential downstream tasks can be visual grounding or image and sentence matching with models like “Multi-Modality Cross Attention Network for Image and Sentence Matching”.", "was_revised": true, "final_justification": "I think the method is novel and offers a new perspective to view the attention matrix that provides a good global representation. It would open up a lot potential future applications in different domains and potentially have a lot of impact.", "rebuttal": "We thank the reviewers for their constructive feedback and ideas. We are happy that the reviewers like the elegant and insightful framework (BdYW) that is grounded in both theoretical insight and empirical validation (pbyL), its effectiveness (BdYW,YchT) and novelty (BdYW,mHJ9,pbyL,YchT), and the clear and well-structured description (mHJ9,pbyL). The provided feedback helps us to improve the paper and we will address the individual concerns raised by reviewer YchT below.\n\n> Efficiency: Although the operations seem simple, I would still like to know whether computing the TokenRank vector will have a cost in efficiency. I wonder how many iterations are needed on average to compute the steady state vector and how much time will they cost. When TokenRank is used in downstream tasks like zero-shot segmentation and unconditional image generation with SAG, how much time is added when using TokenRank?\n\nTokenRank converges typically within 20 iterations for SD1.5. The $\\lambda_2$ value can directly indicate how many iterations will be needed, though computing $\\lambda_2$ currently takes more time than computing TokenRank. As for computation, we profiled SAG and it takes roughly 1.2x times to perform with TokenRank (averaged over thousands of samples). This relatively mild extra computational effort is because it involves a very efficient (vector,matrix) product operation, which is performed on the GPU. We implemented a batched version as well. \nFor zero-shot segmentation, it takes 1.1x more times to perform 2 bounces compared with the baseline with 1 bounce (e.g. column- select.\n\n>It would be nice if we can see the application of TokenRank on natural language processing\n\nThanks for this comment. Similarly to our response to reviewer BdYW, while we appreciate the impact of our study might have been stronger by validating and experimentation with other modalities, we intentionally focused on extensive and rigorous experimentation on one specific domain for the purpose of anchoring this interpretation as useful and impactful. We consider exploring the usefulness of our framework for other domains such as NLP, motion or video would be an exciting future work prospect.\n\n> Exploration of TokenRank with multi-modal cross attention: I think this work itself is rather complete. Potential directions to explore would be seeing whether the representation generated by TokenRank can locate specific objects in local regions, instead of a global representation of the image presented in this work.\n\nThis is a great direction. While TokenRank is by nature a global indicator, we presented multi-bounce as its “counter-part” that allows for local probing. One interesting way of fully exploiting the Markov chain formulation and “localizing” TokenRank, is to introduce the famous “personalization” vector from Google’s PageRank paper. This vector was originally designed to allow ranking pages of the internet but take into account user preferences (e.g. if a user like sports -> rank sports related pages higher). In our case, such a vector could potentially be used to “personalize” TokenRank, such that specific semantic tokens / groups of tokens are ranked higher (e.g. “cat” related tokens). We have not validated this approach, but believe it could be used to solve more elaborate and localized downstream tasks."}]

Author rebuttal:

Meta-review: This paper proposes a discrete-time markov chain of attention matrix in transformers. The common operations in transformers are re-formulated from the markov chain perspective. This work initially received mixed ratings. The raised concerns by the reviewers are gradually solved by the authors and finally, all reviewers are positive towards the current form. The AC has checked all files, and stands on the reviewers' side. The authors shall incorporate related results and discussions in the camera-ready version.
Decision: Accept (poster)