Softmax Attention should be familiar by now: it is a weighted mixing operator defined over a finite collection of vectors. Recently, the paper “Continuum Attention” proposed an interesting idea: make attention continuous. This reminded me that, as I previously discussed in “Why Does DeltaNet Require L2 Normalization?”, EFLA also makes a discrete RNN continuous and then discretizes it again, obtaining some interesting results. Earlier work in the SSM family followed a similar approach.
Seen this way, “continuization followed by discretization” seems to be a tried-and-true path of exploration. What interesting results might we obtain by making Softmax Attention continuous? Let us take a look together.
Problem Formulation #
Standard Softmax Attention is defined as
By making it continuous, we mean changing this to
Here,
This requires introducing two additional vectors,
Notice that the definition in Eq.
Preliminaries #
Eq.
Here,
At
We will use this identity to simplify the expressions in the next section. Also, their integral definitions show that
Putting the Pieces Together and Simplifying #
Substituting these integrals into Eq.
First, simplify the numerator:
We see that the numerator has the form
The denominator is exactly what we obtain by replacing every
Analyzing the Result #
Compared with standard Softmax Attention,
the changes introduced by continuization are an additional
For a general
Here,
As for
Simple Experiments #
The fact that
The first experimental result was that, although continuization introduces a local prior, it cannot completely replace positional encoding. In an architecture using full attention throughout, continuous Softmax Attention without RoPE is significantly worse than standard Softmax Attention with RoPE. Adding RoPE to the continuous version, by contrast, closes this gap.
As for training dynamics, when both versions use RoPE, continuous Softmax Attention is noticeably better early in training. But the gap gradually narrows, and by the end of training the two curves essentially coincide: the advantage disappears. My guess is that the main reason is that natural language is not a genuine time series, so continuization brings no substantial benefit. Perhaps only on genuine time series would there be a chance to measure an advantage.
I also tried switching from standard Softmax Attention to the continuous version partway through training. The initial loss jump was not particularly large, and the result gradually converged to essentially the same performance as the standard version.
Summary #
This article briefly derived a continuous form of Softmax Attention. The result resembles adding a short-convolution operation to the attention matrix. Although experiments on natural-language tasks did not reveal an advantage from this continuization, it is still an interesting result worth appreciating.