Attention (as Discrete-Time Markov) Chains

Christian Theobalt (MPI Informatik) · Vladislav Golyanik (Saarland Informatics Campus, Max-Planck Institute for Informatics) · Yotam Erel (Tel Aviv University) · Olaf Dünkel (Max-Planck Institute for Informatics) · Rishabh Dabral (Saarland Informatics Campus, Max-Planck Institute) · Amit Bermano (Tel Aviv University)
attention matrixattention scoresdiscrete-time markov chaineigenanalysisfréchet inception distance (fid)global token importanceinception score (is)indirect attentionmatrix multiplicationmetastable statessegmentation techniquessteady state vectortokenrankunconditional image generationvisual transformerszero-shot segmentation

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