Residual-pivoted landmark attention
Implementation & benchmark of arXiv:2607.26863 — Convergence rates for pivoted QR and LU
Source paper: Convergence rates for pivoted QR and LU arXiv:2607.26863 ⓘ · analyzed Aug 31, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace uniform or random landmark selection in low-rank attention with approximate greedy pivoted QR selection on the attention matrix. At each step, select the key whose residual attention column has the largest norm, orthogonalize it against previously selected columns, and stop when the residual energy falls below a target tolerance. Use the selected columns as an adaptive attention basis and reconstruct the full attention output through a small coefficient matrix.
Formulas
Mathematical statement
The paper defines the pivoted-QR residual sequence $\widehat{E}^{(0)}=A$, $q_{k+1}=\widehat{E}^{(k)}_{:,j_{k+1}}/\|\widehat{E}^{(k)}_{:,j_{k+1}}\|_2$, and $\widehat{E}^{(k+1)}=(I-q_{k+1}q_{k+1}^{\top})\widehat{E}^{(k)}$. Here $A\in\mathbb{R}^{N\times N}$ is an attention or kernel matrix, $N$ is sequence length, $j_{k+1}$ is the selected column, $q_{k+1}\in\mathbb{R}^N$ is the normalized new basis vector, and $\widehat{E}^{(k)}$ is the residual after $k$ pivots. Greedy QR chooses $j_{k+1}=\arg\max_j\|\widehat{E}^{(k)}_{:,j}\|_2$; approximate greedy selection can use a quality factor $0<\eta\leq1$ satisfying $\|\widehat{E}^{(k)}_{:,j_{k+1}}\|_2\geq\eta\max_j\|\widehat{E}^{(k)}_{:,j}\|_2$. The resulting rank-$k$ approximation is $\widetilde A_k=Q_kQ_k^{\top}A=A-\widehat E^{(k)}$, with $Q_k=[q_1,\ldots,q_k]$. The paper bounds selected-submatrix volume using the leading singular values: for index sets $I,J$ of size $k$, $|\det(A_{I,J})|^{1/k}\leq(\prod_{\ell=1}^{k}\sigma_\ell(A))^{1/k}$. Thus greedy residuals should decay rapidly when the singular values $\sigma_\ell(A)$ decay algebraically or geometrically.
Implementation notes
Integrate this at the attention-kernel stage for a noncausal self-attention layer, initially on one head. Let $A=\operatorname{softmax}(QK^\top/\sqrt d)\in\mathbb{R}^{N\times N}$ and $V\in\mathbb{R}^{N\times d_v}$. Build a landmark set $J$ of at most $r$ keys. Initialize an implicit residual $R=A$ and an empty basis $Q_r$. At each step, estimate $\|R_{:,j}\|_2$ for candidate keys, choose the largest candidate, append $q=R_{:,j}/\|R_{:,j}\|_2$ to the basis, and update candidate residuals by $R_{:,j}\leftarrow R_{:,j}-q(q^\top R_{:,j})$. Stop when the largest estimated residual norm is below $\tau\|A\|_F$, or when $r=r_{\max}$. Form $C=A_{:,J}$ and compute a ridge-stabilized coefficient matrix $T=(C^\top C+\lambda I)^{-1}C^\top A$. Replace exact attention output $AV$ with $C(TV)$. The residual recursion and greedy criterion come from the paper; $\eta$, tolerance $\tau$, candidate subsampling rate, and ridge parameter $\lambda$ are empirical engineering choices. To avoid materializing all of $A$, compute selected columns and candidate residual probes on demand, or apply the procedure to a feature-based approximation of the attention kernel. First test a 2-layer Transformer encoder on WikiText-2 or a synthetic attention matrix with controlled singular-value decay, comparing adaptive pivots with uniform and random Nyström landmarks at sequence lengths 512 and 2048. Record attention-output relative error $\|AV-C(TV)\|_F/\|AV\|_F$, validation perplexity, latency, and peak memory. Success is lower error at fixed rank or at least 2x lower attention memory/FLOPs at matched perplexity.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.