Translator’s note (Opus 5.5): This is an English translation of 连续化 Softmax Attention by Jianlin Su (苏剑林), originally published on October 19, 2026 on Scientific Spaces (科学空间). The translation preserves the author’s first-person voice.
Softmax Attention surely needs no introduction by now: it is a weighted mixing operator defined over a finite set of vectors. Recently, the paper Continuum Attention proposed a very interesting idea: making attention continuous. This reminded me of EFLA, which I introduced earlier in Why Does DeltaNet Need L2 Normalize?. EFLA likewise makes a discrete RNN continuous and then discretizes it again, arriving at some interesting results. Similar examples include the earlier SSM line of work.
Seen this way, “continuize, then discretize” seems to be a tried-and-true (屡试不爽) path of exploration. So what interesting results can we get by making Softmax Attention continuous? Let’s take a closer look together.
Problem Statement
Standard Softmax Attention is defined as
ot=∑i=1teqt⋅ki∑i=1teqt⋅kivi(1)
By continuization, we mean changing it into
ot=∫0teqt⋅ksds∫0teqt⋅ksvsds(2)
where k,v at non-integer points are defined by linear interpolation. That is, for any s∈[i−1,i],i∈N+, we define
This definition requires introducing two additional vectors, k0,v0 (used for s∈[0,1]). We will discuss their values at the end.
Note that the definition in equation (2) differs slightly from the original paper. For the sake of symmetry, the original paper changes the integration interval to [1/2,t+1/2]. I feel that although this adjustment is more symmetric, it is actually less natural in the causal setting, so this post uses the integration interval [0,t] instead. Of course, the derivation that follows has little to do with the choice of interval; technically, it is the same either way.
Preliminaries
Equation (2) is only a formal definition. To actually use it, we must compute the integrals explicitly. By the additivity of integrals, we only need to compute each segment ∫ii+1 separately. Writing at,i=qt⋅ki,δt,i=at,i−at,i−1, it is not hard to obtain
This identity will be used in the simplification in the next section. In addition, the integral definitions make it clear that φ1(x) and φ2(x) are always positive, so the logarithms we take later will never be undefined.
Assembly and Simplification
Substituting the above integrals into equation (2), we obtain
Note that the denominator is exactly what we get by replacing every vi with 1, so the denominator is directly ∑i=0teat,i+bt,i. Therefore,
ot=∑i=0teat,i+bt,i∑i=0teat,i+bt,ivi(11)
Analysis of the Result
Compared with standard Softmax Attention,
ot=∑i=1teat,i∑i=1teat,ivi(12)
the changes brought by continuization are the extra k0,v0 and a correction term bt,i added to each at,i. The extra k0,v0 are not really an essential change, and we will briefly discuss them in a moment. For now, let’s focus on bt,i.
For a general 1≤i≤t−1, bt,i depends on at,i as well as its left and right neighbors at,i−1,at,i+1. Formally, this looks a lot like adding a Short Conv to the Attention matrix, and this becomes even more evident after a Taylor expansion of bt,i:
Here, at,i−1+at,i+1−2at,i is precisely the second-order difference of at,i, which is a simple Short Conv operation. So continuous Softmax Attention and “adding a Short Conv to the Attention matrix” really do reach similar ends by different routes (异曲同工).
As for k0,v0, they are essentially equivalent to the sink token we introduce to address the Attention Sink problem. In the context of continuization, their main purpose is to fill out all t intervals, so they are purely a mathematical device. We generally have three choices: all zeros; k0=k1,v0=v1; or trainable. In the experiments below, I chose all zeros.
Simple Experiments
Because bt,i depends on both at,i and its neighbors, continuous Softmax Attention cannot reuse existing FlashAttention implementations. However, the implementation principle carries over, and the theoretical FLOPs are essentially the same. I had K3 write a simple kernel. It runs at only about 1/4 the speed of Softmax Attention, mainly because it contains too many fine-grained operations that are hard to accelerate. Still, it is enough to run some experiments for now.
The first experimental finding is that, although continuization introduces a locality prior, it cannot fully replace position encoding. In an architecture that uses Full Attention throughout, continuous Softmax Attention without RoPE is clearly worse than standard Softmax Attention with RoPE. Conversely, once RoPE is added, it closes the gap.
As for training dynamics, with RoPE added to both, continuous Softmax Attention is clearly better than standard Softmax Attention early in training, but the gap gradually narrows. By the end of training, the two curves essentially coincide and the advantage disappears. My guess is that the core reason is that natural language is not a true time series, so continuization does not bring any substantive benefit. Perhaps an advantage would only show up on genuine time series.
I also ran an experiment that switched from standard Softmax Attention to the continuous version partway through training. The loss jump at the switch was not very large, and the model eventually converged slowly to essentially the same performance as the standard version.
Summary
This post briefly derived continuous Softmax Attention, and the result resembles applying a Short Conv operation to the Attention matrix. Although my experiments did not find any advantage from this continuization on natural language tasks, it is still an interesting result worth appreciating.
Citation: Su, J. (2026, October 19). 连续化 Softmax Attention [Continuous Softmax Attention]. Scientific Spaces. https://kexue.fm/archives/11980
Original content licensed under CC BY-NC-SA 4.0. This translation is shared under the same license.