Papers
Topics
Authors
Recent
Search
2000 character limit reached

Infinite Self-Attention (InfSA)

Updated 5 July 2026
  • Infinite Self-Attention is a family of methods that relax finite attention constraints by aggregating multi-hop token interactions and summing paths of arbitrary lengths.
  • Neumann-series formulations and graph diffusion techniques provide tractable approximations for infinite-hops, bridging single-hop attention with global token influence using eigenvector methods.
  • Variants like ReAttention and Infini-attention decouple candidate selection from positional encoding and employ compressed memory to efficiently handle unbounded contexts.

Infinite Self-Attention (InfSA) denotes several closely related extensions of self-attention that relax different finite constraints of the standard Transformer. In the cited literature, the label is used for a training-free scheme that supports an infinite context with a finite attention scope in LLMs, a Neumann-series operator that accumulates multi-hop interactions on a token graph, a compressed-memory mechanism studied under the name Infini-attention, and an infinite-width analysis in which multi-head attention converges to NNGP and NTK limits (Liu et al., 2024, Roffo et al., 26 Feb 2026, Huang et al., 29 Dec 2025, Hron et al., 2020, Roffo, 19 Jul 2025). Across these usages, the common theme is that standard one-hop, finite-window attention is replaced by a mechanism that either aggregates over arbitrarily long histories, sums paths of every length, or admits an infinite limit with a tractable kernel description.

1. Standard self-attention and the finite-regime bottleneck

Standard position-aware self-attention for a sequence of length NN is written as

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.

In the long-context setting, this requires O(N2)\mathcal O(N^2) time and memory and forces all key-value pairs to be stored in a single window. As NN\to\infty, this becomes infeasible both physically, because memory blows up, and statistically, because rotary or absolute position embeddings fall outside the training-time range, causing length-extrapolation failure and entropy explosion in the softmax (Liu et al., 2024).

Length extrapolation is the regime N>LmaxN>L_{\max}, where a Transformer trained up to a maximum context LmaxL_{\max} degrades at test time. The cited description characterizes this degradation by rising perplexity, vanishing retrieval accuracy, and collapse of generation quality once absolute-position embeddings go out of distribution or attention entropy saturates (Liu et al., 2024). In high-resolution vision, an analogous constraint appears as the quadratic cost of softmax attention, which limits Transformer scalability (Roffo et al., 26 Feb 2026).

A broader affinity-matrix view places standard self-attention inside a larger family of multi-hop propagation operators. Given a learned attention matrix

W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),

the Transformer output

Z=WVZ=W\,V

is the one-hop case of a more general series over powers of an affinity matrix AA. In this view, self-attention is a single-hop instance of a construction rooted in Infinite Feature Selection, while Infinite Self-Attention arises when all hop lengths are included rather than only k=1k=1 (Roffo, 19 Jul 2025).

2. Neumann-series formulations and infinite-hop propagation

A central mathematical formulation of InfSA is the Neumann series

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.0

where Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.1 is a nonnegative affinity matrix and Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.2 is its spectral radius. Discarding the zero-hop term yields

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.3

The Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.4-th power Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.5 encodes all Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.6-hop walks between pairs of nodes, so the series integrates information from paths of every length (Roffo, 19 Jul 2025).

In the spectral formulation introduced for vision Transformers, the usual attention matrix is

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.7

and a discount factor Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.8 is used to define the infinite-path kernel

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.9

with path-integral operator

O(N2)\mathcal O(N^2)0

For stacked layers with per-layer affinity O(N2)\mathcal O(N^2)1, the accumulated operator is

O(N2)\mathcal O(N^2)2

In the homogeneous case O(N2)\mathcal O(N^2)3, this converges to the Neumann series as O(N2)\mathcal O(N^2)4 (Roffo et al., 26 Feb 2026).

This formulation recasts self-attention as multi-hop propagation on a learned token graph. Standard single-layer attention captures one-hop interactions, while InfSA sums the contributions of all path lengths in closed form. The cited literature explicitly frames this as a generalization of self-attention rather than a separate computational principle (Roffo, 19 Jul 2025).

3. Diffusion, centrality, and absorbing Markov chains

The graph-theoretic interpretation of InfSA treats tokens as graph nodes and the attention-derived affinity matrix as a content-adaptive token graph. One concrete construction uses

O(N2)\mathcal O(N^2)5

A single layer

O(N2)\mathcal O(N^2)6

is then one diffusion step, and stacking layers with discount O(N2)\mathcal O(N^2)7 integrates all paths up to length O(N2)\mathcal O(N^2)8 (Roffo et al., 26 Feb 2026).

Under this view, InfSA is linked to classical graph centrality. Katz centrality is

O(N2)\mathcal O(N^2)9

PageRank arises if NN\to\infty0 is row-stochastic and NN\to\infty1 is the damping, and eigenvector centrality corresponds to the principal eigenvector of NN\to\infty2. The stated consequence is that InfSA weights tokens by their global structural importance, defined by participation in many high-weight walks, rather than only by one-hop affinities (Roffo et al., 26 Feb 2026).

The same paper gives an absorbing Markov chain interpretation. With

NN\to\infty3

the matrix

NN\to\infty4

is the fundamental matrix of the absorbing chain. Entry NN\to\infty5 is the expected number of visits to token NN\to\infty6 before absorption starting from NN\to\infty7. Summing columns or rows recovers Katz-style incoming and outgoing centrality,

NN\to\infty8

This makes the “infinite” operator interpretable as expected random-walk visitation before absorption rather than only as an algebraic matrix inverse (Roffo et al., 26 Feb 2026).

To avoid constructing the full NN\to\infty9 operator, Linear-InfSA approximates the principal eigenvector directly. For each head it computes

N>LmaxN>L_{\max}0

then scores keys by

N>LmaxN>L_{\max}1

and pools values as

N>LmaxN>L_{\max}2

The vector N>LmaxN>L_{\max}3 is broadcast to all positions and heads are concatenated. The stated complexity is N>LmaxN>L_{\max}4 time and N>LmaxN>L_{\max}5 extra memory per head, and the approximation is reported to match the dominant eigenvector of the quadratic operator with cosine N>LmaxN>L_{\max}6 (Roffo et al., 26 Feb 2026).

4. Infinite context with finite attention scope: ReAttention

A distinct usage of “Infinite Self-Attention” is the training-free two-stage scheme ReAttention, which is designed for length extrapolation in LLMs. Its premise is that a model based on the self-attention mechanism can support an infinite context with a finite attention scope under sufficient memory resources by decoupling candidate selection from final position-aware attention (Liu et al., 2024).

At each output step N>LmaxN>L_{\max}7, ReAttention partitions the KV cache into global, middle, and local regions. Stage I performs position-agnostic top-N>LmaxN>L_{\max}8 selection on the entire middle cache. For each head, scores are computed as

N>LmaxN>L_{\max}9

and the top-LmaxL_{\max}0 indices are retained. Stage II then forms a finite window by concatenating

LmaxL_{\max}1

applies positional embeddings only after this selection step, and runs ordinary position-aware self-attention on the resulting block of length LmaxL_{\max}2. In the simplest design, Stage I serves purely to pick a sparse set of candidates and all actual attended values flow through Stage II (Liu et al., 2024).

The reported per-token cost is obtained by streaming the middle cache in chunks of size LmaxL_{\max}3 and maintaining a running top-LmaxL_{\max}4 heap. Stage I then costs LmaxL_{\max}5, Stage II costs LmaxL_{\max}6, and overall per-token time is

LmaxL_{\max}7

with memory

LmaxL_{\max}8

Both are stated to be independent of the unbounded context length LmaxL_{\max}9 (Liu et al., 2024).

ReAttention is described as a drop-in replacement for standard self-attention. Integration consists of delaying positional embedding until after top-W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),0 selection, storing keys and values without positional encoding, maintaining three small pointers in the KV cache, and replacing one large W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),1 with the two-stage scheme. No retraining is required. Existing FlashAttention or Triton kernels can be reused for Stage II, while Stage I uses a custom top-W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),2 kernel plus batched GEMM (Liu et al., 2024).

Empirically, the paper reports LongBench average scores of W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),3 for LLaMA3.1-8B, W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),4 for Mistral-v0.3-7B, and W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),5 for LLaMA3.2-3B-chat, compared with full-attention scores of W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),6, W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),7, and W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),8, respectively. On L-Eval for Mistral-v0.3-7B, ReAttention gives W=softmax ⁣(QK/d),W=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d\bigr),9 on closed-ended QA and open-summ. ROUGE, compared with Z=WVZ=W\,V0 for full attention. On InfiniteBench retrieval at Z=WVZ=W\,V1M, Z=WVZ=W\,V2M, and Z=WVZ=W\,V3M tokens, the reported results are Z=WVZ=W\,V4 for LLaMA3.1-8B, Z=WVZ=W\,V5 for Mistral-v0.3-7B, and Z=WVZ=W\,V6 for LLaMA3.2-3B-chat. The same source states that ReAttention matches—or in some cases exceeds—the performance of full attention up to Z=WVZ=W\,V7K tokens, remains robust with retrieval Z=WVZ=W\,V8 out to millions of tokens, and enables context lengths of at least Z=WVZ=W\,V9M, including a AA0 expansion of LLaMA3.2-3B-chat to AA1M in Needle-In-A-Haystack tests without further training. A Triton implementation is reported to yield AA2 speedup and AA3 memory savings versus naively running full attention on the selected window (Liu et al., 2024).

5. Compressive memory and Infini-attention

A third line of work studies Infini-attention as a recurrent compressed-memory extension of the Transformer. In this architecture, each layer is augmented with a small, fixed-size memory that accumulates compressed summaries of past segments while preserving local causal attention over the current segment. Per layer and per head, the mechanism uses local projections AA4, a memory store AA5, and a trainable scalar balance factor AA6 that interpolates between local and memory attention (Huang et al., 29 Dec 2025).

The data flow is segmental. A full input is split into contiguous segments AA7 of length AA8. For segment AA9, one computes

k=1k=10

Local attention is

k=1k=11

Memory attention retrieves from the compressed store,

k=1k=12

and fusion is performed as

k=1k=13

The current segment is then compressed into the next memory state,

k=1k=14

using a stable nonlinearity summarized as ELUk=1k=15 followed by a fixed-size buffer or truncation step (Huang et al., 29 Dec 2025).

The small-scale pretraining study uses a k=1k=16M-parameter LLaMA decoder with k=1k=17 layers, hidden size k=1k=18, FFN size k=1k=19, Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.00 attention heads, max context Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.01 tokens, vocab Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.02, untied embeddings, RMSNorm Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.03, SiLU activations, and mixed-precision bfloat16. Pretraining uses FineWeb sample-10BT with Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.04M documents and median length Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.05 tokens, sequence length Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.06, segment length Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.07, Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.08 steps, global batch Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.09, Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.10 tokens per step, and approximately Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.11M tokens total. The optimizer is AdamW with Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.12, Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.13, Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.14, weight decay Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.15, gradient clip Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.16, and learning rate Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.17 with Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.18 warmup steps followed by cosine decay to Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.19. The cited comparison notes that, without memory, gradients vanished at Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.20 and doubling to Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.21 stabilized training, whereas Infini-attention required no such adjustment (Huang et al., 29 Dec 2025).

The main empirical claim is improved long-context retrieval relative to a baseline local-attention model. After Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.22-step fine-tuning on a needle-in-a-hay-stack dataset, Infini-attention improves on the baseline by up to Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.23 percentage points at Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.24K tokens, specifically Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.25 versus Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.26 at “needle at start.” The same source states that both models degrade sharply beyond Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.27K because repeated memory compressions are lossy, that accuracy peaks around Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.28K–Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.29K and falls nearly to zero by Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.30K for deep-end targets, and that the balance factor converges to approximately Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.31 on average, with early layers skewing toward memory and later layers relying almost exclusively on local attention (Huang et al., 29 Dec 2025).

The architecture is therefore not an exact infinite-context mechanism in the sense of lossless access to arbitrarily distant tokens. Its stated advantage is that even a small memory can compensate for a Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.32M-parameter model’s limited local window, while its stated limitation is that repeated compression degrades signal over long sequences (Huang et al., 29 Dec 2025).

6. Infinite-width attention and kernel limits

A different use of “infinite attention” studies the limit in which multi-head attention behaves as a Gaussian process or Neural Tangent Kernel. For an input sequence Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.33, head Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.34 computes

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.35

forms logits

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.36

applies an entrywise nonlinearity Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.37 to obtain Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.38, and outputs

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.39

The multi-head result is

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.40

with Gaussian initialization scaled so that pre- and post-activations remain Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.41 as Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.42 (Hron et al., 2020).

The central result is that a single-head layer does not converge to a GP in the Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.43 limit, because the normalized logits remain random and the output is a non-Gaussian scale mixture. By contrast, when

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.44

the multi-head output converges in distribution to a Gaussian array as Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.45. The covariance is determined by the per-head kernel

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.46

and in the joint limit Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.47 this yields the self-attention NNGP kernel (Hron et al., 2020).

The same work derives recursive NNGP and NTK updates through deep stacks of attention layers. For a GP input with covariance Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.48, the per-head NNGP kernel is

Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.49

The NTK has additional direct and indirect terms involving Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.50 and its derivative kernel. Positional encodings can be added or concatenated and folded into the kernel transform, while LayerNorm over the head dimension can likewise be incorporated (Hron et al., 2020).

The paper also reports finite-data empirical results. On CIFAR-10, an Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.51-layer Conv+ReLU stack followed by a single attention layer with structured positional encodings and identity Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.52 achieved Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.53 test accuracy for the NNGP and Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.54 for the NTK, compared with Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.55 for the previous Local Average Pooling kernel. The work introduced new features to the Neural Tangents library allowing applications of NNGP and NTK models, with and without attention, to variable-length sequences, including an example on IMDb reviews (Hron et al., 2020).

7. Comparative usage, limitations, and recurrent ambiguities

A recurring source of ambiguity is that “infinite” does not denote a single operational limit across the literature. It may refer to unbounded context length with finite attention scope, to an infinite sum over graph walks, to recurrent memory carried across segments, or to a limit in the number of heads or width (Liu et al., 2024, Roffo et al., 26 Feb 2026, Huang et al., 29 Dec 2025, Hron et al., 2020).

Usage in the cited literature Core mechanism Limiting object
ReAttention Position-agnostic top-Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.56 selection before position-aware self-attention Infinite context with finite attention scope
Pure InfSA / Linear-InfSA Discounted Neumann series over attention matrices; principal-eigenvector approximation Infinite-hop diffusion on a token graph
Infini-attention Compressed memory plus local causal attention with balance factor Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.57 Recurrent access to past segments
Infinite attention (NNGP/NTK) Multi-head attention in the Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.58 limit Gaussian-process and tangent-kernel behavior

Several misconceptions follow from collapsing these meanings into one. ReAttention does not perform full position-aware attention over arbitrarily many tokens; it performs a position-agnostic top-Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.59 scan to select candidates and then applies ordinary position-aware attention on a fixed window (Liu et al., 2024). Pure InfSA in the spectral sense is not automatically linear-time; the linear-time method is the approximation called Linear-InfSA, whereas Pure InfSA remains quadratic per layer (Roffo et al., 26 Feb 2026). Infini-attention does not eliminate long-context degradation; the study explicitly reports that retrieval accuracy drops with repeated memory compressions and that both models degrade sharply beyond Attention(Q,K,V)=softmax ⁣(QK/d+Bias)V.\mathrm{Attention}(Q,K,V)=\mathrm{softmax}\!\bigl(QK^\top/\sqrt d+\mathrm{Bias}\bigr)\,V.60K (Huang et al., 29 Dec 2025). In the kernel-limit literature, “infinite” concerns width or number of heads rather than unbounded sequence length, and the key distinction is that multi-head attention becomes Gaussian whereas single-head attention does not (Hron et al., 2020).

Taken together, these works define Infinite Self-Attention less as a single architecture than as a class of extensions in which the one-hop, finite-window interpretation of self-attention is replaced by multi-hop diffusion, sparse retrieval over unbounded history, recurrent compressed memory, or an infinite-limit kernel description. The cited papers agree on the underlying motivation: standard self-attention is constrained by quadratic scaling and by finite training-time positional structure, and each InfSA variant modifies the attention mechanism to make some aspect of that finite regime non-fundamental (Liu et al., 2024, Roffo, 19 Jul 2025, Roffo et al., 26 Feb 2026).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Infinite Self-Attention (InfSA).