Introduction
Standard attention mechanisms, such as the ubiquitous softmax, are inherently discrete and "dense." They operate on a fixed set of items—like words in a sentence—and assign a non-zero probability to every single one, regardless of how irrelevant some items might be.
Recent "sparse" alternatives, like sparsemax, have improved interpretability by allowing models to ignore irrelevant items entirely, assigning them a weight of exactly zero. However, these methods are still limited to discrete domains. Conversely, existing continuous attention models can handle signals over time or treat images as smooth surfaces, but they typically rely on Gaussian distributions. Because Gaussians have infinite tails, they spread the model's "focus" infinitely thin across the entire domain, failing to isolate specific features.
This paper bridges that gap by introducing attention mechanisms that are both continuous (not tied to a rigid grid or sequence length) and sparse (capable of selecting a specific, bounded region of interest while assigning zero probability elsewhere). By extending traditional attention to continuous domains like time and space, models can focus on compact, well-defined regions—such as a specific time interval or an elliptical area in an image—while remaining fully differentiable for end-to-end training.
The Continuous and Sparse Framework
The researchers built their framework using $\Omega$-regularized prediction maps ($\Omega$-RPM), generalizing these maps from finite sets to arbitrary measure spaces.
Key technical contributions of this approach include:
- The Tsallis Connection: The authors reveal a deep mathematical link between sparse attention and Tsallis statistics (specifically $\alpha$-entropies). By setting the parameter $\alpha=2$, they successfully derive a "continuous sparsemax" transformation.
- New Probability Families: This continuous sparsemax leads to novel types of probability distributions for attention, including the truncated parabola (1D) and the truncated paraboloid (2D). Unlike a Gaussian distribution, these distributions have tails that actually hit zero, defining a clear, finite boundary for the model's focus.
- Implementation via Basis Functions: To make the continuous mathematics computationally feasible, the input signal and the attention "score" are represented using basis functions, such as Gaussian Radial Basis Functions (RBFs).
- Efficient Backpropagation: A major hurdle in continuous mappings is training efficiency. The authors prove that the Jacobian of these transformations is equivalent to a generalized covariance. This crucial finding allows for efficient gradient computation, making these complex continuous maps as easy to train as standard softmax.
Experimental Validation
The authors evaluated their continuous attention models across three distinct tasks, demonstrating that sparsity in continuous spaces yields highly interpretable and effective results.
1. Document Classification (1D)
On the IMDB Movie Reviews dataset, the model attended to text sequences as a continuous 1D signal. Because the attention is continuous, the number of parameters does not have to scale with the length of the input. The authors found that using just 32 or 64 basis functions was as effective as discrete attention over documents hundreds of words long. Ultimately, a combined model using both discrete and continuous sparsemax achieved the highest accuracy of 91.18%, outperforming the discrete softmax baseline (90.78%).
2. Machine Translation (1D)
Tested on the De-En IWSLT 2017 German-to-English translation task, continuous sparsemax improved translation quality. The continuous model reached a BLEU score of 24.25, compared to 23.92 for the discrete baseline. The continuous attention maps provided smoother, more focused alignments between the source and target languages.
3. Visual Question Answering (2D)
In the VQA-v2 task, the model must attend to specific regions of an image to answer a question. In a continuous 2D space, sparsity manifests as a "supporting ellipse." The continuous models proved highly effective at pinpointing relevant objects. While discrete attention often "scatters" its focus across various patches of the image, continuous sparsemax cleanly encloses the relevant information within a bounded elliptical area, ignoring the rest of the image entirely.
Limitations and Future Directions
The primary limitation of the current work is that it focuses on unimodal distributions. This means the model can only "look" at one contiguous blob or interval at a time. While excellent for isolating a single object or time frame, many complex tasks require attending to multiple disconnected regions simultaneously.
To address this, the authors suggest several promising future directions:
- Multimodal Attention: Extending the framework to support mixtures of distributions, allowing for multiple "blobs" of focus.
- Multi-head Architectures: Integrating these continuous maps into Transformer-style multi-head attention models.
- Continuous-Time Integration: Combining these attention mechanisms with other continuous-domain architectures, such as Neural ODEs or continuous-domain CNNs, to build fully continuous neural pipelines.
Summary updated