I’ve been reading about linear attention and fast-weight models lately, and one small detail caught my eye: the short convolution (aka shortconv). It shows up in many recent frontier open-weight LLMs, including Qwen (3.5 onwards), Kimi (Linear, K3), and GLM (5.3-Flash), right after the Q/K/V projections. It has even made it into Thinking Machines’ Inkling, which doesn’t use linear attention at all. As Songlin Yang put it, “shortconv is scalable”. I’ve been wondering why it is there, how it got there in the first place, and why it’s almost always with kernel_size=4.
To understand shortconvs, let’s start with something all attention architectures do: use information from earlier in a conversation. We might tell an assistant what a nickname means or teach it a new shortcut, and then expect it to remember that later.
As an example, consider a sequence that defines a few associations:
zeta rabbit kappa tiger omega penguin ... zeta ?We expect a well-performing model to predict the token rabbit. The pairs are deliberately arbitrary, so knowing what zeta is won’t help here - the model has to use what appeared earlier in the sequence. This is a particular instance of in-context learning, known in the linear-attention literature as associative recall. Transformers famously handle this with induction heads.
In softmax attention, the KV cache keeps a key and a value for each earlier position. For our task, a useful entry at the rabbit position would have a key that matches zeta and a value that carries rabbit. For that, the rabbit position needs to know that zeta came right before it. In a transformer, this is usually the job of a previous-token head in an earlier layer.
When zeta appears again, its query can match that entry’s key and retrieve information about rabbit. More generally, attention combines the cached values according to how well their keys match:
Linear attention as fast weights#
If we drop the softmax and use raw dot products as weights, the sum can be rearranged:
\[ \begin{aligned} o_t&=\sum_{i\leq t}(q_t^\top k_i)\,v_i =\Big(\sum_{i\leq t}v_i k_i^\top\Big)q_t = S_t\,q_t,\\ S_t&=\sum_{i\leq t}v_i k_i^\top = S_{t-1}+v_tk_t^\top,\qquad S_0=0. \end{aligned} \]Now the zeta/rabbit association is folded into one matrix, \(S_t\in\mathbb R^{d_v\times d_k}\), together with kappa/tiger and omega/penguin. There’s no list of entries (aka KV cache) anymore, just a fixed-size matrix that the query reads from. This is the simplest (unnormalized) form of linear attention, whose computational cost grows linearly with sequence length (instead of quadratically).1
There’s another way to look at \(S_t\): as the weights of a small linear model, \(k\mapsto S_tk\), that predicts a value from a key. These weights change with every token, so they’re called fast weights - an idea going back to the late 1980s2. The projections that produce \(q\), \(k\) and \(v\) are the usual slow weights, learned in pretraining.
Seen this way, the layer runs a small learning loop inside every forward pass. Each token writes its key/value pair into the fast weights with a gradient step, and each query reads from them:
\[ \begin{aligned} \textbf{Write:}\quad & W_t=W_{t-1}-\eta_t\nabla_W\,\ell\big(f_W(k_t),\,v_t\big),\\ \textbf{Read:}\quad & o_t=f_{W_t}(q_t). \end{aligned} \]Here \(f_W\) is the memory, a model with fast weights \(W\), and the loss \(\ell\) measures how well it maps keys to values. For linear attention the memory is just a linear map, \(f_W(k)=Wk\) with \(W_t=S_t\), and the loss is \(\ell=-\langle Wk_t,v_t\rangle\). Its gradient is \(-v_tk_t^\top\), so a step with \(\eta_t=1\) gives back \(S_t=S_{t-1}+v_tk_t^\top\). This view is often called test-time training (though I prefer fast weights, or test-time regression).
With the memory framed as a learning problem, most variants differ in two ways: the loss, and how the old state is decayed before each write. The dot-product loss has a gradient that doesn’t depend on \(S\), so the write ignores what the memory already predicts, and associations pile up. In contrast, DeltaNet (Schlag et al., 2021; Yang et al., 2024) uses \(\ell_2\) loss,
\[ \begin{aligned} \ell_t(S)&=\tfrac12\|Sk_t-v_t\|^2,\\ S_t&=S_{t-1}+\beta_t(v_t-S_{t-1}k_t)k_t^\top, \end{aligned} \]where now each write is a correction: it moves what the memory returns for \(k_t\) toward \(v_t\), so a new value for a familiar key replaces the old one. Gated DeltaNet (GDN) also lets old associations fade - it first decays the old state by a scalar \(\alpha_t\):
\[ \begin{aligned} \widetilde S_t&=\alpha_t S_{t-1},\\ S_t&=\widetilde S_t+\beta_t(v_t-\widetilde S_tk_t)k_t^\top. \end{aligned} \]Kimi Delta Attention (KDA) gives each key channel its own rate, \(\widetilde S_t=S_{t-1}\operatorname{diag}(\boldsymbol\alpha_t)\).
Why shortconv?#
In practice, most of the linear-attnetion variants mentioned above pass their Q/K/V through a shortconv. In FLA’s Gated DeltaNet implementation, it even comes with a warning: “ShortConvolution is crucial to the performance. Do not turn it off unless you know what you are doing”.
A shortconv is a small causal convolution applied to a sequence of projected vectors \(u_1,u_2,\dots\in\mathbb R^D\). With kernel-size \(m\), its output is
\[ y_t=\sum_{j=0}^{m-1}w_j\odot u_{t-j},\qquad u_s=0\ \text{for}\ s\le 0, \]where the \(w_j\in\mathbb R^D\) are learned and \(\odot\) is elementwise multiplication (each channel \(c\) of \(y_t\) sees only channel \(c\) of the last \(m\) inputs). The projection before it mixes channels at a fixed position, and the conv mixes positions within one channel. A general implementation of shortconv looks something like nn.Conv1d(D, D, kernel_size=4, groups=D, padding=3), applied to Q/K/V (sometimes concatenated).3
To see why this convolution might help, notice that every write to the recurrent state takes a key and a value from the same position \(t\). In our example, we want a key for zeta paired with a value for rabbit, but those two words sit at different positions.
The conv can fix this. Let’s pick its weights by hand, with \(m=4\). On the key path, set \(w_1=\mathbf 1\) (the all-ones vector) and the other \(w_j\) to zero. This way \(y_t=u_{t-1}\), so each position’s key is precisely the previous token’s key. For simplicity, say we don’t apply shortconv to Q/V (e.g. by setting \(w_0=\mathbf 1\) and the rest zero). Now, at the rabbit position, the memory writes a key that describes zeta together with a value that describes rabbit:
When zeta shows up again, its query matches that key, and out comes rabbit. This is the previous-token head from earlier. In a transformer, an induction head takes two layers: one head copies information about the previous token forward, and a later head uses it to find what came after an earlier occurrence (Elhage et al., 2021). Here the conv does the first step inside a single layer. Trained models are messier than this, but the idea is the same.
The fast-weight view gives another way to see this.4 The memory is solving a small regression from keys to values. Without the conv, \(k_t=W_kx_t\) and \(v_t=W_vx_t\) are two views of the same vector, so there’s little for that regression to learn: if keys equalled values, the best memory would just be the identity. Mixing earlier tokens into the key gives it something real to fit.
Why four?#
Keys can also span more than one token:
alpha zeta rabbit beta zeta tiger ... alpha zeta ?Now zeta alone isn’t enough, and the key has to know about alpha too. A shift by one can’t do that, but a window of a few tokens can. For that we can just increase the kernel size of the conv. But which value works best in practice?
In almost every real-world implementation of shortconv (including all models mentioned earlier), the chosen kernel size is 4. What is the reason for that?
Digging through the papers, I couldn’t find anyone arguing for 4 specifically. It seems to trace back to Albert Gu and Tri Dao’s Mamba (d_conv=4), released in December 2023, together with Dao’s causal-conv1d CUDA kernel, which only accepts kernel size \(\in \{2,3,4\}\). Later models mostly followed. The DeltaNet paper adds its short convolution because “recent linear recurrent models typically incorporate” one (citing, among others, Hyena and xLSTM), and sets the kernel size to 4. Kimi Linear mentions “a small kernel size (e.g., 4)”, and FLA, the Qwen configs, Canon layers and Inkling all use 4 as well.
So does 4 actually work best? A few papers tried other kernel sizes:
| Kernel size | 2Mamba2Furious, ~300M (loss) | Dynamic convs, 300M (PPL) | Static convs, Qwen3-1.7B (PPL) |
|---|---|---|---|
| no conv | 3.06 | 19.12 | 13.42 |
| 1 | — | 18.42 | — |
| 2 | 2.93 | 18.17 | 12.99 |
| 3 | 2.91 | 18.08 | 12.79 |
| 4 | 2.90 | 18.10 | 13.13 |
In all three, most of the gain comes from adding a convolution in the first place. Beyond that the differences are small, and they don’t always favour 4. The dynamic-conv study also tried 5 and 6, but neither showed an improvement. Primer (which put depthwise conv [with kernel_size=3] after Q/K/V back in 2021) found the same: “wider depthwise convolution and standard convolution not only do not improve performance, but in several cases hurt it.”
Ablations#
So how much does the conv actually help? Some papers report what happens with and without conv:
| Model | Setup | Without conv | With conv |
|---|---|---|---|
| DeltaNet | 340M, 15B tokens (LAMBADA ppl) | 50.87 | 37.37 |
| GDN | 400M (average ppl) | 28.95 | 27.35 |
| Kimi Linear | 16-layer ablation model (validation ppl) | 5.70 | 5.65 |
The conv helps in all three, but by different amounts: a lot for DeltaNet, and only a little for Kimi Linear (and that is on a small ablation model, not the released 48B one). It also isn’t strictly needed for recall (the DeltaNet paper shows high associative recall, at least on synthetic tasks, without it).
Q, K or V?#
The explanations so far give a good reason to put the conv on the keys. In practice, we see the conv appearing on Q, K and V. Why would conv help on queries and values? Two recent studies tried different placements in a transformer:
| Conv on | Dynamic convs, 300M | Static convs, Qwen3-1.7B |
|---|---|---|
| no conv | 19.12 | 13.42 |
| Q | 18.69 | 13.38 |
| K | 18.83 | 13.29 |
| V | 18.56 | 13.21 |
| Q + K | 18.44 | — |
| Q + V | 18.36 | — |
| K + V | 18.35 | — |
| Q + K + V | 18.10 | 12.85 |
Perplexity, lower is better. Both studies use transformers (not linear attention).
In both studies, V on its own helps more than Q or K on its own, and putting the conv on all three works best. The second study compared 17 different places in the block, and Q+K+V still won. The V result is the one I find most interesting, since the key-shift story from before doesn’t explain it.
A short conv with a long history#
Below is my best effort at reconstructing the chain of events that led to the emergence of shortconvs in so many frontier architectures.
Mixing a few neighbouring tokens before (or instead of) attention is an older idea than the recent linear-attention models. In 2019, Wu et al. showed that lightweight and dynamic convolutions could compete with self-attention in machine translation, and a year later Conformer combined convolutions and attention for speech recognition. The exact placement we care about here (a small depthwise convolution right after the Q/K/V projections) shows up in Primer in 2021, whose architecture search arrived at what the authors call “multi-dconv-head attention”.
In recurrent models, the operation started out as a shift. H3 paired a “shift-SSM”, which carries the last few tokens forward, with a longer-range SSM (designed for exactly the kind of recall this example needs). Hyena kept short convolutions next to its long ones, and Mamba made a kernel-size-4 conv a standard. Around the same time, Zoology found that most of the perplexity gap between these efficient models and attention comes down to recalling earlier tokens, and its follow-up, Based, paired linear attention with short convolutions. RWKV arrived at something similar in 2023 with its “token shift”, a learned per-channel mix of the current and previous token. By mid-2024, shortconv was common enough that in the DeltaNet paper the authors write: “Recent linear recurrent models typically incorporate a lightweight depthwise-separable convolution layer after the query/key/value projections. This ‘short convolution’ layer generalizes the shift SSM, and is efficient in both number of parameters and computational cost.”
Meanwhile, the shortconv also found its way back into softmax attention. The Forgetting Transformer shifts its keys and values, Canon layers add kernel-size-4 convolutions all over the block (their conv, they write, “is inspired by Mamba and GLA, which trace back to H3, where the component was introduced as ‘shift-SSM.’”), and Liquid AI’s LFM2 pairs short convolutions with softmax attention, with Mathias Lechner arguing that the convolutions were doing much of the work. Dynamic short convolutions bring back Wu et al.’s dynamic convolutions, whose filters are computed from the current token, and TML’s Inkling puts kernel-size-4 convolutions on K/V (but not Q).
At the same time, some recent models drop the shortconv. Mamba-3 removes the separate short convolution of Mamba-2 (but introduces an operation equivalent to a data-dependent convolution with kernel size 2, inside the recurrence). Most lately, DeepSeek’s Engram module was introduced in January 2026 with a kernel-size-4 causal conv, and lost it again in DeepSeek-V4.1 later that year, “because its performance gains do not justify the added complexity in our inference stack”.
That’s it#
Thanks for reading! This post grew out of my own attempt to understand one small box in an architecture diagram, so if I got something wrong or missed a paper, please let me know :)
References#
- Induction heads. Olsson, C., et al. (2022). “In-context Learning and Induction Heads.” Transformer Circuits Thread. transformer-circuits.pub
- Transformer circuits. Elhage, N., et al. (2021). “A Mathematical Framework for Transformer Circuits.” Transformer Circuits Thread. transformer-circuits.pub
- Linear attention. Katharopoulos, A., Vyas, A., Pappas, N., & Fleuret, F. (2020). “Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention.” ICML 2020. arXiv:2006.16236
- Fast weights. Hinton, G. E., & Plaut, D. C. (1987). “Using Fast Weights to Deblur Old Memories.” Proceedings of the 9th Annual Conference of the Cognitive Science Society, 177–186. escholarship
- Fast weight memories. Schmidhuber, J. (1992). “Learning to Control Fast-Weight Memories: An Alternative to Dynamic Recurrent Networks.” Neural Computation, 4(1), 131–139. MIT Press · author’s blog post on the 1991 report
- Fast weight programmers. Schlag, I., Irie, K., & Schmidhuber, J. (2021). “Linear Transformers Are Secretly Fast Weight Programmers.” ICML 2021. arXiv:2102.11174
- DeltaNet. Yang, S., Wang, B., Zhang, Y., Shen, Y., & Kim, Y. (2024). “Parallelizing Linear Transformers with the Delta Rule over Sequence Length.” NeurIPS 2024. arXiv:2406.06484
- Gated DeltaNet. Yang, S., Kautz, J., & Hanson, A. (2025). “Gated Delta Networks: Improving Mamba2 with Delta Rule.” ICLR 2025. arXiv:2412.06464
- Kimi Linear / KDA. Kimi Team (2025). “Kimi Linear: An Expressive, Efficient Attention Architecture.” arXiv:2510.26692
- GLA. Yang, S., Wang, B., Shen, Y., Panda, R., & Kim, Y. (2024). “Gated Linear Attention Transformers with Hardware-Efficient Training.” ICML 2024. arXiv:2312.06635
- Mamba-2. Dao, T., & Gu, A. (2024). “Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Duality.” ICML 2024. arXiv:2405.21060
- TTT. Sun, Y., et al. (2024). “Learning to (Learn at Test Time): RNNs with Expressive Hidden States.” arXiv:2407.04620
- Test-time regression. Wang, K. A., Shi, J., & Fox, E. B. (2025). “Test-time regression: a unifying framework for designing sequence models with associative memory.” arXiv:2501.12352
- DeltaNet Explained. Yang, S. (2024). “DeltaNet Explained” (blog series, parts I–III). sustcsonglin.github.io
- Dynamic short convolutions. Sieberling, O., Runwal, B., Panda, R., & Kim, Y. (2026). “Dynamic Short Convolutions Improve Transformers.” arXiv:2606.03825
- Mamba. Gu, A., & Dao, T. (2023). “Mamba: Linear-Time Sequence Modeling with Selective State Spaces.” arXiv:2312.00752
- 2Mamba2Furious. Mongaras, G., & Larson, E. C. (2026). “2Mamba2Furious: Linear in Complexity, Competitive in Accuracy.” arXiv:2602.17363
- Hyena. Poli, M., et al. (2023). “Hyena Hierarchy: Towards Larger Convolutional Language Models.” ICML 2023. arXiv:2302.10866
- xLSTM. Beck, M., et al. (2024). “xLSTM: Extended Long Short-Term Memory.” NeurIPS 2024. arXiv:2405.04517
- Conformer. Gulati, A., et al. (2020). “Conformer: Convolution-augmented Transformer for Speech Recognition.” Interspeech 2020. arXiv:2005.08100
- Primer. So, D. R., et al. (2021). “Primer: Searching for Efficient Transformers for Language Modeling.” NeurIPS 2021. arXiv:2109.08668
- RWKV. Peng, B., et al. (2023). “RWKV: Reinventing RNNs for the Transformer Era.” Findings of EMNLP 2023. arXiv:2305.13048
- H3. Fu, D. Y., et al. (2023). “Hungry Hungry Hippos: Towards Language Modeling with State Space Models.” ICLR 2023. arXiv:2212.14052
- Zoology. Arora, S., et al. (2024). “Zoology: Measuring and Improving Recall in Efficient Language Models.” ICLR 2024. arXiv:2312.04927
- Based. Arora, S., et al. (2024). “Simple Linear Attention Language Models Balance the Recall-Throughput Tradeoff.” ICML 2024. arXiv:2402.18668 · Hazy Research blog post
- Forgetting Transformer. Lin, Z., et al. (2025). “Forgetting Transformer: Softmax Attention with a Forget Gate.” ICLR 2025. arXiv:2503.02130
- Canon layers. Allen-Zhu, Z. (2025). “Physics of Language Models: Part 4.1, Architecture Design and the Magic of Canon Layers.” arXiv:2512.17351
- Dynamic convolutions. Wu, F., Fan, A., Baevski, A., Dauphin, Y. N., & Auli, M. (2019). “Pay Less Attention with Lightweight and Dynamic Convolutions.” ICLR 2019. arXiv:1901.10430
- Mamba-3. Lahoti, A., Li, K. Y., Chen, B., Wang, C., Bick, A., Kolter, J. Z., Dao, T., & Gu, A. (2026). “Mamba-3: Improved Sequence Modeling using State Space Principles.” arXiv:2603.15569
- Convolution placement and kernel size. Tian, Y., Shu, Y., He, W., Zhang, S., Zhao, T., Xu, C., Chen, X., Wang, Y., Chen, H., & Wang, Y. (2026). “Convolution for Large Language Models Technical Report.” arXiv:2607.18413
- Short convolutions without linear attention. Lechner, M. (2025). “Flipping the Script: Why Short Convolutions Don’t Need Linear Attention” (blog post). mlechner.substack.com
- Why linear attention needs a short conv. Su, J. (2025). “为什么线性注意力要加Short Conv?” [Why does linear attention need Short Conv?] (blog post, in Chinese). kexue.fm
- Engram. Cheng, X., et al. (2026). “Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Models.” ACL 2026. arXiv:2601.07372
Models and code#
- DeepSeek-V4.1. DeepSeek-AI (2026). “DeepSeek-V4.1-Flash: Pushing the Limits of KV Cache Compression.” Hugging Face
- Kimi K3. Kimi Team (2026). “Kimi K3: Open Frontier Intelligence.” arXiv:2607.24653
- Inkling. Thinking Machines Lab (2026). “Inkling: Our Open-Weights Model.” thinkingmachines.ai · model card · weights and config
- Model cards. Qwen3-Next-80B-A3B-Instruct · Qwen3.5-0.8B-Base · Kimi-Linear-48B-A3B-Instruct · GLM-5.3-Flash
- Code. flash-linear-attention (GatedDeltaNet layer) · Hugging Face Transformers (Qwen3.5 and Qwen3-Next modeling code) · Kimi Linear modeling code · causal-conv1d (CUDA kernel for short causal convolutions)
Despite the recurrence, training doesn’t have to loop token by token. Chunkwise-parallel algorithms handle the recurrence by chunks, so most of the work runs in parallel on a GPU. For a better introduction to all of this, I recommend Songlin Yang’s own blog posts, starting with DeltaNet Explained. ↩︎
This idea goes back to Hinton & Plaut (1987), who used fast weights as a temporary memory, and to Schmidhuber (1992) who had one network program another network’s fast weights with outer products, which is the update rule above with keys and values under older names. This latter connection was made explicit by Schlag et al. (2021). ↩︎
In FLA and Kimi, Q, K and V each get their own separate shortconv with \(m=4\). Qwen3.5 runs Q, K and V through one grouped module. Either way, each channel keeps its own filter, so there is no mathemtical difference. ↩︎
The argument comes from a blog post by Moonshot AI’s Su Jianlin (in Chinese), which I found through Liquid AI’s Mathias Lechner’s post, along with a short English summary by Harold Benoit. ↩︎

