arXiv:2611.04216cs.CVNov 2026

Manuscript Offprint

arXiv:2611.04216

LiSA: Linear Stochastic Attention for Long-Range Visual Modeling

Sahar Dastani, Fereshteh Shakeri, Samuel Barbeau, Kunal Mahatha, Ismail Ben Ayed, Herve Lombaert, Christian Desrosiers

Abstract

Self-attention has become the standard for modern sequence modeling, enabling Transformers to model long-range dependencies across a wide range of modalities. Despite these advances, its quadratic cost with respect to sequence length remains a significant computational bottleneck. Recent work addresses this limitation by introducing linear variants of self-attention, namely with kernel approximations of the softmax operator. However, their first-order aggregation restricts expressivity and struggles to capture higher-order structure. We propose Linear Stochastic Attention (LiSA), a linear attention plug-in module that enables higher-order token interactions via a stochastic diffusion process based on truncated random walks. LiSA incorporates adaptive locality, favoring semantically similar neighbors to preserve fine-grained structures, while maintaining stable and efficient training. We conduct extensive experiments on classification, semantic segmentation, and object detection tasks and show improved results over state-of-the-art methods. The code is available here.

1. Introduction

Transformers [34] have become a central paradigm in visual representation learning, with self-attention [24] serving as a key mechanism for capturing long-range dependencies. Since the advent of Vision Transformers (ViTs) [10, 33], self-attention has delivered strong performance across image classification [33, 38], object detection [3, 22], segmentation [4, 43], and multi-modal tasks [30], highlighting the value of global context in modern vision pipelines. However, self-attention scales quadratically with token length, which limits applicability to high-resolution images.

A number of recent works seek to reduce the quadratic complexity of standard ViTs. One common approach restricts attention to a limited set of tokens, either through fixed-sized attention windows [25, 32], introducing sparsity

Figure

Figure 1. Softmax vs. Linear vs. Higher-order attention. Given Q,K,V∈Rn×dQ, K, V \in \mathbb{R}^{n \times d}. softmax-attention forms QK⊤QK^\top then applies to VV. Linear-attention computes K⊤VK^\top V then applies to QQ. Higher-order attention (ours) uses a truncation length TT, retaining multiple diffusion terms while remaining linear in nn and expanding the effective receptive field.

[38, 41] or representing the attention queries and keys with low rank matrices [37]. By reducing the number of pairwise token interactions, these methods lower computational cost, but often at the expense of global context modeling.

Other approaches linearize self-attention using kernel-based approximations [1, 20, 29, 31], replacing the softmax with a positive feature map ϕ(⋅)\phi(\cdot). This enables an associative reordering of the Q, K, and V computation that avoids explicit pairwise interactions and reduces the complexity to linear in the sequence length. These methods retain a global receptive field without relying on downsampling.

In practice, however, an accuracy gap between kernelized linear-attention and standard self-attention persists. Recent works have reduced this gap by linearizing dot-product attention [2], enriching the kernel with angular [45] or focused parameterizations, and adding depthwise-convolutional components [14] or auxiliary softmax branches [45]. However, these variants are almost always built on the same core backbone, vanilla kernelized linear-attention [20]. Our analysis points to a structural bottleneck in this baseline: its single-pass bilinear aggregation.

Vanilla linear-attention mixes values for each query once through direct query-key affinities. With the affinity matrix defined as A=ϕ(Q)ϕ(K)⊤A = \phi(Q) \phi(K)^{\top}, the output Y=AVY = AV can be interpreted as a first-order message-passing step along the edges encoded by A. Crucially, indirect dependencies (i.e., using intermediate tokens) would appear only in higher powers (e.g., A2VA^{2}V, A3VA^{3}V), but vanilla linear-attention never materializes higher-order terms. As a result, when two

© 2027 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.

regions are semantically related yet have weak first-order similarity (e.g., appearance changes due to lighting, occlusion, or viewpoint), their connection is under-weighted and the signal is diluted by many competing matches. In contrast, softmax-attention introduces competitive normalization that can concentrate probability mass on high-scoring connections, which help preserve long-range links.

Our approach targets this limitation and proposes a novel plug-in Linear Stochastic Attention (LiSA) module, which achieves efficient higher-order information propagation without sacrificing stability or locality. LiSA models attention as a linear stochastic process, where image patches are represented as graph nodes and edges encode transition probabilities among them during a truncated random walk. This formulation allows information to traverse intermediate tokens, enabling transitive reasoning. The random walk is truncated to a small number of steps to maintain linear complexity and numerical stability, providing a controllable balance between expressiveness and efficiency.

Overall, LiSA serves as a stronger drop-in module: it integrates cleanly with standard linear-attention refinements and often amplifies their benefits, delivering higher accuracy than vanilla linear-attention while preserving linear-time complexity and training stability. Our contributions are summarized as follows:

  • We introduce LiSA, a plug-in linear-attention module that enables efficient higher-order token interactions.

  • We formulate attention as a truncated random walk, enabling transitive information flow while preserving linear-time complexity and stable training.

  • We evaluate our method across classification, segmentation, and detection, consistently outperforming both self-attention and linear-attention baselines.

References (48)