attention-mechanisms-and-non-attention-paradigms

Attention mechanisms and non-attention paradigms share a mathematical foundation based on kernel smoothing, graph theory, and random walks Verified Answer #1. These systems use normalized matrix operations to route information according to similarity Verified Answer #2. While standard Transformer attention is widely used, its computational cost grows quadratically with sequence length, which limits its efficiency for very long contexts Verified Answer #3.

Mathematical Foundations

The self-attention mechanism is a parameterized variant of Nadaraya-Watson kernel regression, a non-parametric statistical technique Verified Answer #1. Transformers apply an exponential kernel to the dot product of Query and Key representations to produce a weighted sum of Values Verified Answer #1. This process is mathematically analogous to social media recommendation algorithms that use dot-product similarity between user and item embeddings Verified Answer #1 Verified Answer #2.

Graph Theory and Markov Chains

Attention can be modeled as information flow across a graph Verified Answer #2. In a Transformer, tokens are treated as nodes in a fully connected graph where edge weights represent semantic relevance Verified Answer #2. Applying a Softmax function to the attention matrix creates a row-stochastic matrix, making a single forward pass mathematically identical to a single-step transition of a Markov chain random walk Verified Answer #1.

Infinite Self-Attention (InfSA) unifies self-attention, Katz Centrality, and PageRank under a single graph-diffusion equation Verified Answer #4. InfSA models multi-hop token interactions through a discounted Neumann series, where the converged matrix acts as an infinite-path kernel Verified Answer #4.

Non-Attention Paradigms and Long-Context Mechanisms

To address the quadratic cost of vanilla Transformers, several alternative mechanisms have been developed for processing long sequences Verified Answer #3: