Manuscript Offprint

arXiv:2611.08236

Beyond Quadratic Attention: Separable Gaussian Operators for ODE Vision Transformers

Carlos Boned Riera, David Romero Sanchez, Oriol Ramos Terrades

Carlos Boned Riera*

Universitat Autònoma de Barcelona Centre de Visió per Computador (CVC) cboned@cvc.uab.cat

David Romero Sánchez

Universitat Autònoma de Barcelona Centre de Recerca Matemàtica (CRM) dromero@crm.cat

Oriol Ramos Terrades

Universitat Autònoma de Barcelona Centre de Visió per Computador (CVC) oriolrt@cvc.uab.cat

Figure

Figure 1: Left: throughput–memory trade-off at resolution 1024 as the width of the model increases. Points farther upward provide more throughput and points farther left allocate less memory. Our proposed method dominates multi-head attention, achieving higher throughput at lower memory. Right: comparison of the three model families with our proposed method.

ABSTRACT

Self-attention carries a quadratic cost in token count, which limits how far Vision Transformers can scale with input resolution. We introduce SSoG, a separable sum-of-Gaussians spatial operator that replaces dense self-attention with a learned mixture of axis-factorized Gaussian kernels, reducing the per-layer cost from O(N2)\mathcal{O}(N^2) to subquadratic in NN. Unlike dot-product self-attention, whose Lipschitz constant is unbounded outside a compact input domain, SSoG with fixed kernels is globally Lipschitz continuous, which, via the Picard–Lindelöf theorem, guarantees that the continuous-depth variant has a unique solution on the whole integration interval, a global guarantee that dense-attention counterparts lack in general. On CIFAR-100 at 224×224224 \times 224, in a matched discrete-Transformer setting and in the continuous setting, SSoG improves Top-1 accuracy by 2.2–4.1 points across three model widths while using 8.8–16.6% fewer parameters, with depth and training recipe held fixed. In a looped-Transformer setting, SSoG improves

*Corresponding Author.

Top-1 accuracy by 5.4–8.1 points. We further probe inference-time scaling by evaluating on inputs up to 1024×10241024 \times 1024 at matched batch size: in the continuous-depth (Neural ODE) architecture, SSoG reaches up to 154% higher throughput and over 60% lower peak memory than dense attention, with the gap widening as resolution grows, consistent with the difference in asymptotic cost. In the discrete and looped settings, SSoG also achieves over 30% higher throughput than dense attention at this resolution. Together, these results establish SSoG as a practical, parameter-efficient, and theoretically grounded alternative to dense attention across discrete, weight-shared, and continuous-depth Transformer variants.

1 INTRODUCTION

The self-attention mechanism, implemented through scaled dot-product attention (SDPA) Vaswani et al. (2017), has marked a paradigm shift in AI. ViT Dosovitskiy et al. (2021) showed that this SDPA mechanism could scale to images, and this led to remarkably impressive results across a wide range of vision tasks. Foundation models such as DINO Caron et al. (2021), SAM Kirillov et al. (2023) for segmentation and DiT Peebles & Xie (2023) for diffusion, as well as VLMs and LLMs, demonstrated that this attention mechanism could scale to results beyond what seemed possible. Alongside these strengths, however, come several problems: the complexity of self-attention itself, a limited understanding of how a model learns to attend, difficulty training these models due to theoretical issues inherent to SDPA, and the emergence of artifacts Darcet et al. (2024); Qiu et al. (2025), among others. These issues have mostly been studied in isolation. In this paper, we show that reducing the complexity of self-attention and satisfying the theoretical property required for Lipschitz continuity can be achieved by the same operator, and we study the behaviour of this operator when instantiated across discrete, looped, and continuous-depth Transformers.

The complexity of SDPA arises from the token sequence length. For NN tokens of dimension dd, SDPA needs O(N2)\mathcal{O}(N^2) memory and O(N2d)\mathcal{O}(N^2d) computation, and in vision NN grows with the square of the image side, so the cost increases with the resolution. Research on context compression Zhang et al. (2025); Liu et al. (2026) reduces the memory needed to store the matrix, reducing the effective sequence length, but the operation is still quadratic. State Space Models Gu & Dao (2024); Zhu et al. (2024) drop pairwise interaction altogether and are linear in NN; however, they tend to be harder to train and imply a complete change of architecture. Looped Transformers Byra et al. (2026) and Neural ODEs Zhong et al. (2022) work on a different axis: they share parameters across depth, which reduces model size but not the cost of a single evaluation. Moreover, these models are sensitive to hyperparameters, and noise in the parameter space is carried through all the optimization steps and cannot be isolated.

Beyond the cost of recurrent and continuous models, they inherit a second, more fundamental problem from dense attention itself: attention scores are computed over an unbounded domain. Since the query-key interaction is an inner product between unconstrained vectors, SDPA is not globally Lipschitz continuous Kim et al. (2021). This is part of why the literature argues that Transformers are sensitive to hyperparameters, initialization, and learning rate Qi et al. (2023). These theoretical implications matter most for continuous-depth models. Dense attention is smooth, and hence Lipschitz on bounded sets, so the Picard–Lindelöf theorem still guarantees a unique solution locally in time. What global Lipschitz continuity adds is existence of the solution on the whole integration interval for every initial condition, without finite-time blow-up, together with a uniform bound on how much two trajectories can drift apart when their initial conditions differ. Recurrent and continuous architectures, which apply the same block many times, are therefore the ones that benefit most from a property that dense attention lacks.

Pisoni (2026) recently outlined SSoG, a Sum of Separable Gaussians operator that replaces dot-product attention in standard ViTs with a small mixture of anisotropic, axis-factorized Gaussian kernels, in a fixed and a content-steered variant, and reported preliminary results on image classification. Because the kernel factorizes along the image axes, SSoG never builds the N×NN \times N attention matrix and is subquadratic in N. We study it in a regime for which it was neither designed nor analyzed: as the token mixer of looped and continuous-depth Transformers. In this paper, we show that SSoG with fixed kernels is globally Lipschitz continuous by construction, precisely the property that looped and continuous-depth models require, while its content-steered variant is Lipschitz on sets of bounded token norms; we are the first to study it inside these architectures. Unlike MHA, where tokens compete for a fixed normalization budget through content-dependent scores, fixed SSoG assigns weights from a spatial kernel of the relative offsets, so no token can take mass away from another, leaving no mechanism for an attention sink to form. We confirm this empirically on the trained models: dense attention develops a persistent sink on ImageNet, whereas SSoG does not (Appendix A.2). We benchmark this instantiation of SSoG against dense attention across discrete, looped, and continuous-depth settings, providing the first empirical and theoretical characterization of its behavior as a weight-shared, continuous-depth attention mechanism. We also find that content steering improves the discrete and looped models but not the continuous-depth one, and that the efficiency gains of SSoG grow with input resolution.

References (37)