Introduction
While transformer architectures dominate modern deep learning—particularly in natural language processing—they notoriously struggle to capture long-range dependencies. This limitation is often framed as an efficiency problem due to the quadratic scaling of self-attention. However, it is equally an effectiveness problem. As highlighted by the Long Range Arena (LRA) benchmark, standard transformers often fail to learn long-range dependencies even when compute is not a bottleneck.
Recently, specialized layers like State-Space Models (e.g., S4) and global convolutions have significantly outperformed transformers on these long-context tasks. This raises a critical question: Why do transformers fail here, and what do these specialized layers possess that transformers lack? The authors hypothesize that the issue is not a lack of expressiveness or vanishing gradients, but rather the absence of the right inductive biases necessary to generalize over extended sequences.
The LaS-Attention Architecture
To bridge the gap between standard transformers and specialized long-range layers, the authors introduce Local and Smooth (LaS) Attention. This method injects the successful properties of long convolutions into transformers by modifying the standard self-attention computation with two simple, non-learnable operations:
- Locality (The "La"): The model multiplies the attention matrix element-wise with a Constant Positional Exponentially Decaying (ELD) matrix. This enforces a bias where closer tokens receive higher attention weights, which decay exponentially as distance increases. Different attention heads are assigned different decay rates ($\alpha$), allowing the model to capture dependencies at multiple scales.
- Smoothness (The "S"): The model applies 1D average pooling to each row of the attention matrix. This smooths out the attention scores, acting as a regularizer that prevents the model from over-indexing on noisy, isolated pairwise interactions.
Additionally, the authors introduce LaS-Chunk, a linear-complexity variant that segments input sequences into fixed local blocks (e.g., chunk size 128) to maintain computational efficiency while leveraging the LaS principles.
Key Insights: Why Inductive Biases Matter
- Transformers are expressive enough, but they overfit: The authors mathematically demonstrate that a single transformer head can express any channel of a state-space layer. The failure of transformers on long sequences is fundamentally a generalization problem. Adding the right inductive biases helps the model fit the underlying data distribution rather than memorizing noise.
- Locality enables long-range learning: It may seem counter-intuitive to enforce locality when trying to learn long-range dependencies. However, capturing far-away signals is often best achieved by hierarchically combining local dependencies. The exponential decay naturally forces the model to build this hierarchy.
- Smoothness acts as crucial regularization: Just as long convolutions use squashing operators to enforce smoothness in the frequency domain, smoothing the attention matrix prevents pathological optimization dynamics and stabilizes learning over thousands of tokens.
Experimental Evaluation
The LaS-Attention model was rigorously evaluated across several benchmarks, most notably the Long Range Arena (LRA), which features sequences ranging from 1K to 16K tokens across text, visual, and mathematical tasks.
- Massive LRA Boost: LaS-Attention achieves an average score of 73.99% on the LRA benchmark, crushing the vanilla Transformer (54.39%) and outperforming the previous best transformer variant, Luna-256 (61.95%).
- Image Task Dominance: On the LRA Image task—which requires treating an image as a flat sequence of pixels—LaS-Attention outperformed all other transformer variants by a massive margin of at least 22%.
- High Efficiency, High Reward: The linear-complexity LaS-Chunk variant achieves 65.73% on LRA. It outperforms computationally heavy, full-attention quadratic transformers by over 11% while being significantly faster and more memory-efficient.
- Ablations: Both operators are strictly necessary. Removing the smoothness operator drops accuracy by ~6.7% on average, and removing the locality operator drops it by ~8.6%.
Limitations and Future Directions
While LaS-Attention drastically improves long-context performance without adding any learnable parameters, it does have limitations. Because it forces a smooth, local inductive bias, it performs worse than vanilla attention on tasks that are inherently non-local and non-smooth by design (e.g., synthetic "Select" tasks that require plucking a specific distant element). Furthermore, while it performs well on smaller character-level datasets, LaS-Attention showed a slight degradation in perplexity on larger language modeling tasks like Wikitext-103.
Finally, while LaS-Attention significantly narrows the performance gap, it still lags behind state-of-the-art global convolutions like MEGA (which scores 88.21% on LRA). The authors suggest that exploring bidirectional processing—since LaS is currently causal/unidirectional—could be the key to closing this final performance gap in future iterations.
Summary updated