2025/07/31 by Piotr Indyk, Indyk, Piotr, Michael Kapralov +5 · 1 citation
Engineering · Computer Science · Neuroscience · #Sparse and Compressive Sensing Techniques #Medical Image Segmentation Techniques #Brain Tumor Detection and Classification
paper · pdf · doi:10.48550/arxiv.2507.23539
Motivated by the problem of fast processing of attention matrices, we study fast algorithms for computing matrix-vector products for asymmetric Gaussian Kernel matrices K∈ ℝn× n. K's columns are indexed by a set of n keys k1,k2…, kn∈ ℝd, rows by a set of n queries q1,q2,…,qn∈ ℝd , and its i,j entry is Kij = e-‖qi-kj‖22/2σ2 for some bandwidth parameter σ>0. Given a vector x∈ ℝn and error parameter ε>0, our task is to output a y∈ ℝn such that ‖Kx-y‖2≤ ε‖x‖2 in time subquadratic in n and linear in d. Our algorithms rely on the following modelling assumption about the matrices K: the sum of the entries of K scales linearly in n, as opposed to worst case quadratic growth. We validate this assumption experimentally, for Gaussian kernel matrices encountered in various settings such as fast attention computation in LLMs. We obtain the first subquadratic-time algorithm that works under this assumption, for unrestricted vectors.