NearFormer: Linear-Size Sparse Attention via Randomized Near Neighbors
Abstract
Graph transformers can capture long-range interactions, but their quadratic attention cost limits their use on large graphs. We introduce \emph{NearFormer}, a graph transformer whose global attention is restricted to a randomized near-neighbor (NN) graph. NearFormer uses an efficient randomized construction to connect each node to a small number of near neighbors from a broader neighborhood defined by a label-independent feature or spectral geometry. For a fixed retained budget , the resulting attention support has linear size . The NN graph is built once by within-bin search and then held fixed. We use these edges as sparse global-attention supports, with optional learned attention biases, while preserving the original graph for local message passing. Experiments on long-range graph benchmarks and synthetic structural tasks show that NearFormer provides a favorable accuracy--scalability trade-off relative to local message passing, dense and sparse attention.
Create a lesson
Related papers
Translating KV Caches Between Hybrid-Attention Language Models: MLA Latents, Linear-Attention States and Sparse-Attention Indexers
Shared title terminology · Povilas Kvedaras, Tomas Rasymas
DisSparse: Pipelined Top-p Sparse Attention for Long-Context LLM Serving
Shared title terminology · Nurlan Nazaraliyev, Elaheh Sadredini, Nael Abu-Ghazaleh
Learning to Select Sparse Linear Solvers with Convolutional Neural Networks
Shared title terminology · Artemis Pados, Alan Edelman, Emmanuel Lujan et al.
On Adaptive Step Sizes for Eligibility Traces in Deep Reinforcement Learning
Shared title terminology · Esraa Elelimy, Martha White
RadAG: Reward-Adversarial Attention Guidance for Efficient Inference-Time Alignment of Diffusion Models
Shared title terminology · Hyeongchan Jeon, Kwanyoung Kim
Nearly Minimax-Optimal Sample Complexity of Natural Policy Gradient with a Matching Information-Theoretic Lower Bound
Shared title terminology · Asha Barua, Sajad Khodadadian