Continuous Softmax Attention

By 苏剑林 | October 19, 2026

Softmax Attention is surely no stranger to everyone; it is a weighted mixture operator defined over a finite set of vectors. Recently, the paper 《Continuum Attention》 proposed a very interesting idea—continuizing attention. This reminds me of EFLA, which I introduced earlier in "Why does DeltaNet need L2 Normalization?", which also continuizes a discrete RNN and then re-discretizes it to obtain interesting results, similar to the earlier SSM series of work.

It seems that "continuization-discretization" is a tried-and-true path for exploration. So, what interesting results can we get from continuizing Softmax Attention? Let's appreciate it together.

Problem Description

Standard Softmax Attention is defined as

The so-called continuization intends to change it to

where at non-integer points is defined by linear interpolation, i.e., for any , we define

This definition requires the additional introduction of two vectors (used for ), the values of which we will discuss at the end.

Note that the definition in Eq. is slightly different from the original paper. The original paper, out of symmetry considerations, changed the integration interval to , but I feel that while this adjustment is more symmetric, it is less natural for causal scenarios, so this article uses the integration interval . Of course, the subsequent derivation actually has little to do with the choice of interval; the technique is the same.

Preparatory Work

Eq. is just a formal definition; to actually use it, the integral must be explicitly calculated. According to the additivity of integrals, we only need to calculate each segment separately. Letting , it is not difficult to obtain

Here

where the cases for are handled by limits, resulting in respectively. They also satisfy the following identity relationship

This identity will be used in the simplification in the next section. Additionally, as seen from the integral definition, and are always positive, so the subsequent logarithm operations will not have undefined issues.

Assembly and Simplification

Substituting the above integrals into Eq. , we get

Simplifying the numerator first:

From this, it can be seen that the numerator has the form , where

Note that the denominator is exactly the result of replacing all with , so the denominator is directly , thus

Analysis of Results

Compared to standard Softmax Attention

The change brought by continuization is the introduction of additional and, for each , the addition of a correction term . The extra is not a very fundamental change; we will discuss it briefly later. Now let's mainly look at .

For a general , depends simultaneously on and its neighboring . Formally, this is very similar to adding a Short Conv to the Attention matrix, which becomes even more apparent after performing a Taylor expansion on :

where is precisely the second-order difference of , which is a simple Short Conv operation. Therefore, continuous Softmax Attention indeed shares many similarities with "adding Short Conv to the Attention matrix."

As for , it is essentially equivalent to the Sink token we introduce to solve the Attention Sink problem. For continuization, it is mainly a mathematical trick to complete the intervals. We generally have three choices: all zeros, , or trainable. I chose all zeros in the experiments below.

Simple Experiment

depends simultaneously on and its adjacent values, which also means it cannot reuse existing Flash Attention. However, the implementation principle is universal, and the theoretical FLOPs are basically the same. I had K3 write a simple Kernel, and the speed was only about 1/4 of Softmax Attention, mainly because there are too many fragmented operations inside, making it difficult to accelerate, but we can still run it first.

The first experimental result is that although continuization introduces a local prior, it cannot completely replace positional encoding. In a full Full Attention architecture, continuous Softmax Attention without RoPE is significantly worse than standard Softmax Attention with RoPE; conversely, adding RoPE can bridge this gap.

Regarding training dynamics, when everyone uses RoPE, continuous Softmax Attention is significantly better than standard Softmax Attention in the early stages, but the gap gradually narrows, and by the end of training, the two basically overlap and the advantage disappears. It is speculated that the core reason is that natural language is not a true time series, so continuization does not bring substantial benefits. Perhaps for real time series, there would be a chance to measure an advantage.

I also conducted experiments switching to the continuous version midway through standard Softmax Attention training and found that the jump in Loss was not high, and it eventually converged to basically the same effect as the standard version.

Summary

This article briefly derives the continuous Softmax Attention, showing that its result is similar to adding a Short Conv operation to the Attention matrix. Although no advantage was found for this continuization in natural language tasks, it remains an interesting result to appreciate.