Skip to content
DraconiticResearch
Search Sources API
181,686 studies31 sourcesUpdated 40 min ago
PreprintarXiv licencearXiv

Fast Gauss Sums via Flash Attention

Abstract

Gaussian kernel sums are the computational core of maximum mean discrepancies (MMDs), kernel gradient flows, Stein variational gradient descent (SVGD), and many other kernel methods. At the same time, softmax attention has received an extraordinary amount of hardware-aware code engineering, culminating in flash attention. We show that Gauss kernel sums with arbitrary, signed weights can be evaluated via flash attention: two small input augmentations turn the normalized softmax reduction into the unnormalized Gauss sum, without writing a single line of custom GPU code. For feature dimension D>8 in fp16, this approach beats compiled PyTorch code as well as PyKeOps kernels (often significantly) in speed, memory-overhead and accuracy. Indeed, its memory scaling remains linear.

Related

  1. On Special Arithmetic Gamma Values and Thakur's Gauss Sums: From ∞-adic to v-adic
    Ting-Wei Chang
    arXivPreprintCC BY 4.0Full textAlgebra & number theoryarXiv
  2. Butson Hadamard Matrices from Pairs of Gauss Sums
    Cheng Yiin Ong, Bernhard Schmidt
    arXivPreprintarXiv licenceFull textCombinatorics & discrete mathematicsarXiv
  3. Distinguishing Gauss sums
    Moshe Adrian, Jack Diamond, Kenneth Kramer +1
    arXivPreprintCC BY 4.0Full textAlgebra & number theoryarXiv
  4. Approximation by short exponential sums with geometric error decay based on Gauss quadrature
    Gerlind Plonka, Yannick Riebe, Annie Cuyt
    arXivPreprintCC BY 4.0Full textNumerical analysis & scientific computingarXiv
  5. Fast Weight Attention for Continual Learning
    Yifan Zhang, Steve Ta, Jasper Zhang +8
    arXivPreprintarXiv licenceFull textStatisticsarXiv
BibTeX
@misc{rux2026fast,
  title = {{Fast Gauss Sums via Flash Attention}},
  author = {Nicolaj Rux and Sebastian Neumayer},
  howpublished = {arXiv},
  year = {2026},
  month = sep,
  doi = {10.48550/arxiv.2609.04910},
  eprint = {2609.04910},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.04910},
}
RIS
TY  - UNPB
TI  - Fast Gauss Sums via Flash Attention
AU  - Nicolaj Rux
AU  - Sebastian Neumayer
PY  - 2026
DA  - 2026/09/04
PB  - arXiv
DO  - 10.48550/arxiv.2609.04910
UR  - https://arxiv.org/abs/2609.04910
AB  - Gaussian kernel sums are the computational core of maximum mean discrepancies (MMDs), kernel gradient flows, Stein variational gradient descent (SVGD), and many other kernel methods. At the same time, softmax attention has received an extraordinary amount of hardware-aware code engineering, culminating in flash attention. We show that Gauss kernel sums with arbitrary, signed weights can be evaluated via flash attention: two small input augmentations turn the normalized softmax reduction into the unnormalized Gauss sum, without writing a single line of custom GPU code. For feature dimension D>8 in fp16, this approach beats compiled PyTorch code as well as PyKeOps kernels (often significantly) in speed, memory-overhead and accuracy. Indeed, its memory scaling remains linear.
ER  -