ELSAA: Efficient Low-Rank and Sparse Attention Approximation for Training Transformers

Mahdi Heidari, Mohammad Mahdi Rahimi, Jaekyun MoonarXiv 2026

TL;DR

ELSAA is a novel, linear-time attention mechanism that combines sparse and low-rank approximations to capture both sharp token-level interactions and broad global context. By introducing a "denominator-aware" fusion rule, it successfully resolves the scale mismatch that occurs when combining separately normalized attention branches, enabling stable training and excellent length extrapolation up to 64K tokens.

What Problem Does This Paper Address?

As Transformers are applied to longer sequences (e.g., long documents, high-resolution images), they hit a hard wall: the standard self-attention mechanism scales quadratically ($O(N^2)$) with the sequence length $N$.

To bypass this bottleneck, researchers typically turn to one of two camps:

  1. Sparse Attention: Restricts queries to attend only to a small subset of keys (e.g., local windows or hashed buckets). This is great for sharp, localized token interactions but misses the broader global context.
  2. Low-Rank/Kernel Attention: Compresses the key-value space into a lower-dimensional representation. This captures diffuse global context well but smooths out and loses sharp, high-mass token-to-token dependencies.

Since these two approaches are complementary, why not just combine them? The challenge is subtle but profound: attention outputs are normalized via softmax. A sparse branch and a low-rank branch cover vastly different amounts of "denominator mass." Naively adding their outputs together results in a severe scale mismatch, distorting the true attention computation during training.

ELSAA addresses this by approximating the $N \times N$ attention operator itself in sequence space (rather than decomposing weight parameters like LoRA) using a well-balanced hybrid architecture.

Methods

ELSAA splits the attention computation into two parallel, independent branches:

  • Sparse Branch (sortLSH): Uses Locality-Sensitive Hashing (LSH) and sorting to group highly similar query-key pairs into blocks. It computes exact block-diagonal attention within these groups, preserving sharp local features.
  • Low-Rank Branch (RACE): Uses differentiable hash-sketch summaries to softly assign keys to buckets, accumulating global statistics that queries can read from in linear time.

The Secret Sauce: Denominator-Aware Fusion

To combine these branches without scale distortion, ELSAA introduces a denominator-aware sparse multiplier ($m_{\text{sparse},i}$):

$$m_{\text{sparse},i} = \frac{d_{\text{sparse},i}}{d_{\text{sparse},i} + \lambda_i d_{\text{lr},i} + \varepsilon}$$

Here, $d_{\text{sparse},i}$ and $d_{\text{lr},i}$ are the estimated denominator masses from the sparse and low-rank branches, respectively. This term rescales the sparse branch's contribution based on how much attention mass it actually captures relative to the global summary. Finally, learned token-wise gates ($g_{\text{sparse}}$ and $g_{\text{lr}}$) dynamically balance the two branches to produce the final fused output.

ELSAA also provides a recursive divide-and-conquer structure to support causal (autoregressive) attention settings efficiently.

Datasets

The authors evaluated ELSAA across a diverse set of modalities and sequence lengths:

  • Text: ArXiv scientific text classification (32K tokens), Text Retrieval (64K tokens), and IMDB sentiment analysis.
  • Vision: Fashion-MNIST, Oxford-IIIT Pet, Flowers-102, Food-101 (up to 16K tokens), and Tiny ImageNet (causal ViT).
  • Synthetic: A Needle-in-a-Haystack (NIAH) benchmark to test long-context retrieval and length extrapolation from 512 to 65,536 tokens.

Key Insights and Ideas

  • Modality Dictates Structure: The authors discovered a clear structural dichotomy between vision and text. Vision attention is highly localized and peaked (benefiting heavily from the sparse branch), whereas long-text topic classification relies on aggregating weak, diffuse evidence across the entire document (benefiting more from the low-rank branch). ELSAA successfully handles both.
  • Exact Attention Can Harm Optimization at Scale: In ultra-long contexts (64K tokens), exact attention can actually cause optimization to collapse because gradient signals get diluted across billions of mostly uninformative pairwise interactions. Approximate attention acts as an implicit structural prior that stabilizes training.
  • Normalization is the Bottleneck for Hybrid Models: Simply adding a sparse matrix to a low-rank matrix works in unnormalized settings (like robust PCA), but fails in attention layers because of the non-linear softmax normalization. Tracking and adjusting for the denominator mass is essential.

Key Results

ELSAA achieves an approximate 99% reduction in attention interactions compared to exact dense attention for a sequence length of 32,000, bringing the complexity down to linear time ($O(N)$).

Table 1. Comparison of attention methods across long-context classification tasks.

As shown in Table 1, ELSAA achieves the highest average test accuracy (46.81%) across long-context classification tasks, consistently outperforming its individual sparse (Sort_LSH) and low-rank (RACE) components, as well as the un-rescaled ablation (Sort_Lsh_RACE).

Table 2. Text Retrieval @ 64K

In the extreme 64K Text Retrieval task (Table 2), standard Exactflash completely collapses to random guessing (~50%), while ELSAA stabilizes training to achieve 65.34% test accuracy.

Table 4. NIAH task test accuracy across input lengths. OOM indicates out-of-memory.

On the Needle-in-a-Haystack benchmark (Table 4), where models were trained at 1K context and evaluated up to 64K, ELSAA demonstrates robust length extrapolation. It avoids the out-of-memory (OOM) errors of Exact Flash and prevents the catastrophic accuracy collapse suffered by pure RACE at longer lengths.

Limitations and Future Work

  • Hardware Efficiency: While asymptotically linear, ELSAA is currently implemented using standard framework operations. To realize its full speedup potential in practice, it requires custom, fused GPU kernels (similar to FlashAttention) that execute the hashing, sorting, and fusion in a single kernel launch.
  • LLM Pretraining: The current evaluation focuses primarily on encoder-style classification and retrieval tasks. Testing causal ELSAA on large-scale autoregressive language model pretraining remains an open and important next step.
  • Joint Compression: The authors suggest exploring the intersection of compressing attention space (like ELSAA) and parameter space (like LoRA) simultaneously for maximum efficiency.

Summary updated

BibTeX
@misc{heidari2026elsaa,
  author = {Mahdi Heidari and Mohammad Mahdi Rahimi and Jaekyun Moon},
  title = {{ELSAA: Efficient Low-Rank and Sparse Attention Approximation for Training Transformers}},
  year = {2026},
  eprint = {2607.20214},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.20214},
}
Figure