<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Haoran Zhang - Blog</title>
    <subtitle>Haoran Zhang is an Applied Research Scientist at NVIDIA working on machine learning systems, distributed systems, and efficient deep learning.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://snowchord.com/blog/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://snowchord.com/blog/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-07-25T00:00:00+00:00</updated>
    <id>https://snowchord.com/blog/atom.xml</id>
    <entry xml:lang="en">
        <title>Linear Attention, Visualized</title>
        <published>2026-07-25T00:00:00+00:00</published>
        <updated>2026-07-25T00:00:00+00:00</updated>
        
        <author>
          <name>
            Haoran Zhang
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://snowchord.com/blog/linear-attention-visualized/"/>
        <id>https://snowchord.com/blog/linear-attention-visualized/</id>
        
        <content type="html" xml:base="https://snowchord.com/blog/linear-attention-visualized/">&lt;p&gt;In July 2026, Moonshot released &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.kimi.com&#x2F;blog&#x2F;kimi-k3&quot;&gt;Kimi K3&lt;&#x2F;a&gt;, a 2T-parameter model with a 1M-token context window. K3 uses Moonshot&#x27;s linear-attention variant, Kimi Delta Attention (KDA). Moonshot reports that it trails only Claude Fable 5 and GPT-5.6 Sol across its evaluation suite.&lt;&#x2F;p&gt;
&lt;p&gt;NVIDIA had already made a similar choice in &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2512.20856&quot;&gt;Nemotron 3&lt;&#x2F;a&gt;, which combines softmax attention with Mamba-2 recurrent layers. KDA and Mamba-2 use different recurrences. Both offer linear-time sequence mixing during training and fixed-state decoding, although this efficiency comes with some loss of expressiveness.&lt;&#x2F;p&gt;
&lt;p&gt;In this post, we visualize the path from self-attention to the linear-attention variants used in recent models.&lt;&#x2F;p&gt;
&lt;!-- floating-toc --&gt;
&lt;h2 id=&quot;self-attention-recap&quot;&gt;Self-attention recap&lt;&#x2F;h2&gt;
&lt;p&gt;Given hidden states $H$, three learned projections produce queries, keys, and values:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$Q=HW_Q,\qquad K=HW_K,\qquad V=HW_V,$$
&lt;&#x2F;div&gt;
&lt;p&gt;where $Q,K\in\mathbb R^{n\times d_k}$ and $V,O\in\mathbb R^{n\times d_v}$, with $n$ denoting the sequence length.&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O
=
\operatorname{Attention}(Q,K,V)
=
\operatorname{softmax}\!\left(
  \frac{QK^{\mathsf T}}{\sqrt{d_k}}+M_{\mathrm{add}}
\right)V,
\qquad
M_{\mathrm{add}}
=
\begin{bmatrix}
0&amp;amp;-\infty&amp;amp;-\infty\\
0&amp;amp;0&amp;amp;-\infty\\
0&amp;amp;0&amp;amp;0
\end{bmatrix}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Each query $q_t$ represents a linear functional on the key space:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\phi_{q_t}:\mathbb R^{d_k}\to\mathbb R,
\qquad
k_j\mapsto\langle q_t,k_j\rangle.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Evaluating it at $k_j$ produces the scalar score $\langle q_t,k_j\rangle$. Softmax normalizes these scores into weights, and $o_t$ is the weighted sum of the corresponding values.&lt;&#x2F;p&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Notation&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;From here on, we assume $d_k=d_v=d$ and represent each token&#x27;s $q_t$, $k_t$, and $v_t$ as row vectors (some RNN and linear-attention literature instead uses column vectors), so $Q,K,V\in\mathbb R^{n\times d}$. We also omit the scale $1&#x2F;\sqrt d$, which can be absorbed into either $Q$ or $K$.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;h2 id=&quot;self-attention-is-quadratic&quot;&gt;Self-attention is quadratic&lt;&#x2F;h2&gt;
&lt;p&gt;The attention operation uses two matrix multiplications over the sequence:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
QK^{\mathsf T}:\quad
(n\times d)(d\times n)&amp;amp;\longrightarrow(n\times n),
&amp;amp;\approx 2n^2d\ \text{FLOPs},\\
\operatorname{softmax}(\cdots)V:\quad
(n\times n)(n\times d)&amp;amp;\longrightarrow(n\times d),
&amp;amp;\approx 2n^2d\ \text{FLOPs}.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Masking and softmax add $\mathcal O(n^2)$ work, so the attention operation costs&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$4n^2d+\mathcal O(n^2)=\mathcal O(n^2d),$$
&lt;&#x2F;div&gt;
&lt;p&gt;which is quadratic in the sequence length.&lt;&#x2F;p&gt;
&lt;p&gt;A direct implementation stores the $n\times n$ score matrix. FlashAttention avoids materializing this matrix in off-chip memory, but the computation remains quadratic.&lt;&#x2F;p&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Optional: Attention vs. FFN&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;For model width $d$ and FFN expansion factor $e$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\underbrace{8nd^2}_{Q,K,V,\text{ and output projections}}
+
\underbrace{4n^2d}_{\text{attention operation}},
\qquad
\operatorname{FLOPs}_{\mathrm{FFN}}\approx 4end^2.$$
&lt;&#x2F;div&gt;
&lt;p&gt;For $e=4$, the full attention layer (attention operation + input&#x2F;output projections) costs more than the FFN when $n&amp;gt;2d$; the attention operation alone does so when $n&amp;gt;4d$.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;h2 id=&quot;naive-linear-attention&quot;&gt;Naïve linear attention&lt;&#x2F;h2&gt;
&lt;p&gt;The quadratic cost comes from multiplying $Q$ by $K^{\mathsf T}$ first, which produces an $n\times n$ score matrix. If we remove softmax, matrix multiplication is associative, so we can change the order of computation:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O=(QK^{\mathsf T})V=Q(K^{\mathsf T}V).$$
&lt;&#x2F;div&gt;
&lt;p&gt;The left-hand order compares every query with every key before mixing the values. The right-hand order first summarizes all key–value pairs in the $d\times d$ matrix $K^{\mathsf T}V$, then applies each query to that summary. It never constructs an $n\times n$ matrix.&lt;&#x2F;p&gt;
&lt;p&gt;The two matrix multiplications now cost&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
K^{\mathsf T}V:\quad
(d\times n)(n\times d)&amp;amp;\longrightarrow(d\times d),
&amp;amp;\approx 2nd^2\ \text{FLOPs},\\
Q(K^{\mathsf T}V):\quad
(n\times d)(d\times d)&amp;amp;\longrightarrow(n\times d),
&amp;amp;\approx 2nd^2\ \text{FLOPs}.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Together, they require approximately $4nd^2=\mathcal O(nd^2)$ work, which is linear rather than quadratic in the sequence length.&lt;&#x2F;p&gt;
&lt;p&gt;This computation is not causal: the shared summary $K^{\mathsf T}V$ contains key–value pairs from the entire sequence, so every query can read the future. The causal version is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O=\bigl(QK^{\mathsf T}\odot M\bigr)V,
\qquad
M=
\begin{bmatrix}
1&amp;amp;0&amp;amp;0\\
1&amp;amp;1&amp;amp;0\\
1&amp;amp;1&amp;amp;1
\end{bmatrix},
\qquad
\odot:\ \text{Hadamard product}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;At first glance, the causal mask appears to prevent direct reassociation of the full matrix product. However, row $t$ of $O$ depends only on $q_t$, $K_{1:t}$, and $V_{1:t}$, as shown below.&lt;&#x2F;p&gt;
&lt;div class=&quot;row eq&quot; id=&quot;rg-form&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Once the masked columns are removed, row $t$ becomes an ordinary matrix product over a prefix:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$o_t
=q_tK_{1:t}^{\mathsf T}V_{1:t}
=q_t\!\left(K_{1:t}^{\mathsf T}V_{1:t}\right).$$
&lt;&#x2F;div&gt;
&lt;p&gt;We call the product of the key and value prefixes the state $S_t$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t
:=K_{1:t}^{\mathsf T}V_{1:t}
\in\mathbb R^{d\times d}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;$S_t$ is a fixed-size linear map from key space to value space. Moving from one token to the next adds exactly one outer product, so we can build this state recurrently instead of recomputing the entire prefix:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_0=0,
\qquad
S_t=S_{t-1}+k_t^{\mathsf T}v_t,
\qquad
o_t=q_tS_t.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Each recurrent step costs $\mathcal O(d^2)$, so processing $n$ tokens costs $\mathcal O(nd^2)$. The cost is linear in the sequence length, hence the name linear attention.&lt;&#x2F;p&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Optional: Linear attention as an RNN&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;This recurrence defines an RNN with a matrix-valued hidden state $S_t$. Each key–value pair updates $S_t$. The query $q_t$ reads $S_t$ to produce $o_t$. This recurrent view is the idea behind &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2006.16236&quot;&gt;&lt;em&gt;Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;p&gt;The recurrent form reduces the arithmetic complexity, but it uses GPUs inefficiently:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Large activation memory.&lt;&#x2F;strong&gt; A direct autograd implementation saves every $d\times d$ state $S_t$ for the backward pass. The $n$ saved states require $\mathcal O(nd^2)$ memory.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Sequential token updates.&lt;&#x2F;strong&gt; Computing $S_t$ requires $S_{t-1}$. This dependency prevents the GPU from updating different tokens in parallel.&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Poor Tensor Core utilization.&lt;&#x2F;strong&gt; Tensor Cores accelerate tiled matrix multiply-accumulate operations. The outer product $k_t^{\mathsf T}v_t$ has shape $(d\times1)(1\times d)$, so its reduction dimension is only one. This shape does not fill the Tensor Core tiles along the reduction dimension.&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;chunkwise-algorithm&quot;&gt;Chunkwise algorithm&lt;&#x2F;h2&gt;
&lt;p&gt;To solve these problems, we introduce the chunkwise algorithm. It uses the parallel form $\bigl(QK^{\mathsf T}\odot M\bigr)V$ within each chunk and the recurrent form $S_{\mathrm{out}}=S_{\mathrm{in}}+K^{\mathsf T}V$ between chunks.&lt;&#x2F;p&gt;
&lt;p&gt;Assume $C$ divides $n$. Split the sequence into $n&#x2F;C$ chunks of $C$ consecutive tokens. Let $Q_r,K_r,V_r\in\mathbb R^{C\times d}$ denote chunk $r$.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;block-the-causal-matrix&quot;&gt;Block the causal matrix&lt;&#x2F;h3&gt;
&lt;p&gt;Let $A=QK^{\mathsf T}\odot M$. Partition $A$ into $C\times C$ blocks and partition $V$ and $O$ into $C\times d$ blocks. Let $A_{r,s}$ denote block $(r,s)$ of $A$. In block row $r$, blocks to the left contain earlier chunks, the diagonal block contains the current chunk, and blocks to the right contain future tokens.&lt;&#x2F;p&gt;
&lt;div class=&quot;cw-block-matmul&quot; id=&quot;cw-block-matmul&quot;&gt;
  &lt;div class=&quot;cw-matrix-column&quot;&gt;
    &lt;div class=&quot;cw-figure-title&quot;&gt;&lt;b&gt;A&lt;&#x2F;b&gt; &lt;span&gt;n×n in C×C blocks&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;
    &lt;div class=&quot;cw-score-blocks&quot; id=&quot;cw-score-blocks&quot;&gt;&lt;&#x2F;div&gt;
  &lt;&#x2F;div&gt;
  &lt;div class=&quot;cw-operator&quot;&gt;×&lt;&#x2F;div&gt;
  &lt;div class=&quot;cw-matrix-column&quot;&gt;
    &lt;div class=&quot;cw-figure-title&quot;&gt;&lt;span class=&quot;vc&quot;&gt;V&lt;&#x2F;span&gt; &lt;span&gt;C×d blocks&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;
    &lt;div class=&quot;cw-vector-blocks&quot; id=&quot;cw-value-blocks&quot;&gt;&lt;&#x2F;div&gt;
  &lt;&#x2F;div&gt;
  &lt;div class=&quot;cw-operator&quot;&gt;=&lt;&#x2F;div&gt;
  &lt;div class=&quot;cw-matrix-column&quot;&gt;
    &lt;div class=&quot;cw-figure-title&quot;&gt;&lt;span class=&quot;oc&quot;&gt;O&lt;&#x2F;span&gt; &lt;span&gt;C×d blocks&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;
    &lt;div class=&quot;cw-vector-blocks&quot; id=&quot;cw-output-blocks&quot;&gt;&lt;&#x2F;div&gt;
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;cw-output-composition&quot; id=&quot;cw-output-composition&quot;&gt;&lt;&#x2F;div&gt;
&lt;div class=&quot;cw-legend&quot;&gt;
  &lt;span&gt;&lt;i class=&quot;cw-swatch cw-history&quot;&gt;&lt;&#x2F;i&gt;history&lt;&#x2F;span&gt;
  &lt;span&gt;&lt;i class=&quot;cw-swatch cw-local&quot;&gt;&lt;&#x2F;i&gt;local&lt;&#x2F;span&gt;
  &lt;span&gt;&lt;i class=&quot;cw-swatch cw-future&quot;&gt;&lt;&#x2F;i&gt;future&lt;&#x2F;span&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;The output for chunk $r$ splits into history and local contributions:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O_r
=\underbrace{\sum_{s&amp;lt;r}A_{r,s}V_s}_{\text{history}}
+\underbrace{A_{r,r}V_r}_{\text{local}}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The local block keeps a $C\times C$ causal mask because tokens in the chunk have different prefix lengths. The history blocks need no mask because every token in chunk $r$ may read every token in an earlier chunk.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;compress-the-history&quot;&gt;Compress the history&lt;&#x2F;h3&gt;
&lt;p&gt;Let $K_{&amp;lt;r}$ and $V_{&amp;lt;r}$ contain all chunks before chunk $r$. Associativity compresses the dense history:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\sum_{s&amp;lt;r}A_{r,s}V_s
=Q_rK_{&amp;lt;r}^{\mathsf T}V_{&amp;lt;r}
=Q_rS_r,
\qquad
S_r:=K_{&amp;lt;r}^{\mathsf T}V_{&amp;lt;r}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;$S_r$ contains all key–value updates before chunk $r$. Let $M_c$ denote the $C\times C$ causal mask inside the chunk. The chunk output is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O_r
=\underbrace{Q_rS_r}_{\text{history}}
+\underbrace{\bigl(Q_rK_r^{\mathsf T}\odot M_c\bigr)V_r}_{\text{local}}.$$
&lt;&#x2F;div&gt;
&lt;h3 id=&quot;update-the-state&quot;&gt;Update the state&lt;&#x2F;h3&gt;
&lt;p&gt;After computing $O_r$, add the current chunk to the history:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_{r+1}=S_r+K_r^{\mathsf T}V_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The matrix product $K_r^{\mathsf T}V_r$ batches $C$ rank-one updates into a dense GEMM. Its reduction dimension is $C$ rather than $1$, so it uses Tensor Cores efficiently.&lt;&#x2F;p&gt;
&lt;p&gt;For the recurrent state, autograd now saves one boundary state per chunk. These $n&#x2F;C$ states require $\mathcal O((n&#x2F;C)d^2)$ memory. Chunk boundaries still form a sequential chain, but the chain now contains $n&#x2F;C$ steps instead of $n$.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;cost&quot;&gt;Cost&lt;&#x2F;h3&gt;
&lt;p&gt;Each chunk requires&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\mathcal O\!\left(
\underbrace{C^2d}_{\text{local}}
+\underbrace{Cd^2}_{\text{state update}}
\right).$$
&lt;&#x2F;div&gt;
&lt;p&gt;Across $n&#x2F;C$ chunks, the total cost is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\mathcal O\!\left(nCd+nd^2\right).$$
&lt;&#x2F;div&gt;
&lt;p&gt;Larger chunks increase the local $nCd$ term but shorten the sequential state chain. $C=1$ recovers the recurrent form, while $C=n$ recovers the full parallel form. Every valid $C$ provides exact results. &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;fla-org&#x2F;flash-linear-attention&quot;&gt;FLA&lt;&#x2F;a&gt; uses $C=64$, while &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;MoonshotAI&#x2F;FlashKDA&quot;&gt;FlashKDA&lt;&#x2F;a&gt; uses $C=16$.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;retnet-scalar-decay&quot;&gt;RetNet: scalar decay&lt;&#x2F;h2&gt;
&lt;p&gt;In Naïve linear attention, each outer-product write $k_t^{\mathsf T}v_t$ enters the state with coefficient one and never decays. New and old writes therefore receive the same age-independent coefficient. &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2307.08621&quot;&gt;RetNet&lt;&#x2F;a&gt; introduces a recency bias by shrinking the existing state before adding the current write:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_0=0,
\qquad
S_t=\gamma S_{t-1}+k_t^{\mathsf T}v_t,
\qquad
o_t=q_tS_t,
\qquad
0&amp;lt;\gamma\le 1.$$
&lt;&#x2F;div&gt;
&lt;p&gt;$\gamma$ is a fixed scalar, so it scales the entire state uniformly. The figure follows one key–value write through the recurrence:&lt;&#x2F;p&gt;
&lt;div class=&quot;strip&quot; id=&quot;leak&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;A write from $s$ steps earlier has weight $\gamma^s$. The weight decreases exponentially with age.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;parallel-form&quot;&gt;Parallel form&lt;&#x2F;h3&gt;
&lt;p&gt;To compute the recurrence in parallel, note that a write at position $j$ undergoes $t-j$ decay steps before query $q_t$ reads it. Its coefficient is therefore $\gamma^{t-j}$. Collect these coefficients in a decayed causal matrix:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\Gamma[t,j]
=
\begin{cases}
\gamma^{t-j}, &amp;amp; j\le t,\\
0, &amp;amp; j&amp;gt;t.
\end{cases}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;row crow&quot; id=&quot;par&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;The diagonal is one because the current write has not decayed. Moving one column to the left adds one decay step.&lt;&#x2F;p&gt;
&lt;p&gt;The parallel form replaces the binary causal mask $M$ with $\Gamma$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O=\bigl(QK^{\mathsf T}\odot\Gamma\bigr)V.$$
&lt;&#x2F;div&gt;
&lt;h3 id=&quot;chunkwise-form&quot;&gt;Chunkwise form&lt;&#x2F;h3&gt;
&lt;p&gt;The chunkwise form again separates incoming history from interactions inside the chunk. Let $S_r$ denote the state immediately before chunk $r$, and let $\ell=1,\ldots,C$ index positions in the current chunk.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;decay-incoming-history&quot;&gt;Decay incoming history&lt;&#x2F;h4&gt;
&lt;p&gt;Before $q_{r,\ell}$ (the query at local position $\ell$ in chunk $r$) reads $S_r$, the state crosses $\ell$ decay steps. Define the boundary-to-query factors&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\lambda_\ell:=\gamma^\ell,
\qquad
\lambda=(\gamma,\gamma^2,\ldots,\gamma^C)^{\mathsf T}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The first illustration applies one entry of $\lambda$ to each row of $Q_rS_r$. (Hover a row of $Q_r$ to trace its decay factor and the resulting history row.)&lt;&#x2F;p&gt;
&lt;div class=&quot;row crow&quot; id=&quot;g1raw&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;We can move the row scale to $Q_r$ and define the decayed query:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\overleftarrow{Q}_r
:=
\operatorname{diag}\!\left(\gamma,\gamma^2,\ldots,\gamma^C\right)Q_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The left arrow denotes left-boundary decay: row $\ell$ includes the factor $\gamma^\ell$ from the chunk boundary to $q_{r,\ell}$.&lt;&#x2F;p&gt;
&lt;div class=&quot;row crow&quot; id=&quot;g1a&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;This gives the history term&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O_r^{\mathrm{hist}}=\overleftarrow{Q}_rS_r.$$
&lt;&#x2F;div&gt;
&lt;h4 id=&quot;compute-the-local-block&quot;&gt;Compute the local block&lt;&#x2F;h4&gt;
&lt;p&gt;Partitioning the full parallel computation into $C\times C$ blocks exposes the same history and local split:&lt;&#x2F;p&gt;
&lt;div class=&quot;bmwrap&quot;&gt;
  &lt;div class=&quot;bmcol&quot;&gt;
    &lt;div class=&quot;bmlbl&quot;&gt;(&lt;span class=&quot;q&quot;&gt;Q&lt;&#x2F;span&gt;&lt;span class=&quot;k&quot;&gt;K&lt;&#x2F;span&gt;&lt;sup&gt;T&lt;&#x2F;sup&gt; ⊙ &lt;span class=&quot;g&quot;&gt;Γ&lt;&#x2F;span&gt;)&lt;span class=&quot;bmsub&quot;&gt;decayed scores · n×n → C×C blocks&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;
    &lt;div class=&quot;hgrid&quot; id=&quot;hero&quot;&gt;&lt;&#x2F;div&gt;
  &lt;&#x2F;div&gt;
  &lt;div class=&quot;bmop&quot;&gt;×&lt;&#x2F;div&gt;
  &lt;div class=&quot;bmcol&quot;&gt;&lt;div class=&quot;bmlbl&quot;&gt;&lt;span class=&quot;v&quot;&gt;V&lt;&#x2F;span&gt;&lt;span class=&quot;bmsub&quot;&gt;C×d blocks&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;vstack&quot; id=&quot;vcol&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
  &lt;div class=&quot;bmop&quot;&gt;=&lt;&#x2F;div&gt;
  &lt;div class=&quot;bmcol&quot;&gt;&lt;div class=&quot;bmlbl&quot;&gt;&lt;span class=&quot;o&quot;&gt;O&lt;&#x2F;span&gt;&lt;span class=&quot;bmsub&quot;&gt;C×d blocks&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;&lt;div class=&quot;vstack&quot; id=&quot;ocol&quot;&gt;&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;legend&quot; style=&quot;margin-top:12px&quot;&gt;
  &lt;div class=&quot;leg-item&quot;&gt;&lt;span class=&quot;sw&quot; style=&quot;background:color-mix(in srgb,var(--intra) 42%,#fff)&quot;&gt;&lt;&#x2F;span&gt;diagonal = &lt;b&gt;local&lt;&#x2F;b&gt;&lt;&#x2F;div&gt;
  &lt;div class=&quot;leg-item&quot;&gt;&lt;span class=&quot;sw&quot; style=&quot;background:color-mix(in srgb,var(--inter) 44%,#fff)&quot;&gt;&lt;&#x2F;span&gt;below diagonal = &lt;b&gt;history&lt;&#x2F;b&gt;&lt;&#x2F;div&gt;
  &lt;div class=&quot;leg-item&quot;&gt;&lt;span class=&quot;sw masked-sw&quot;&gt;&lt;&#x2F;span&gt;above diagonal = future&lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;A write at local position $m$ crosses $\ell-m$ decay steps before $q_{r,\ell}$ reads it. The local decay matrix is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\Gamma_C[\ell,m]
=
\begin{cases}
\gamma^{\ell-m}, &amp;amp; m\le\ell,\\
0, &amp;amp; m&amp;gt;\ell.
\end{cases}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;row crow&quot; id=&quot;gloc&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;The local term is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O_r^{\mathrm{local}}
=\bigl(Q_rK_r^{\mathsf T}\odot\Gamma_C\bigr)V_r.$$
&lt;&#x2F;div&gt;
&lt;h4 id=&quot;update-the-state-1&quot;&gt;Update the state&lt;&#x2F;h4&gt;
&lt;p&gt;We now have the chunk output $O_r$. Next, we construct the state passed to the next chunk. The incoming state crosses all $C$ steps, while a write at local position $\ell$ crosses only $C-\ell$ steps. Define the write-to-boundary factors&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\rho_\ell:=\gamma^{C-\ell},
\qquad
\rho=(\gamma^{C-1},\gamma^{C-2},\ldots,1)^{\mathsf T}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Because token rows of $K_r$ become columns of $K_r^{\mathsf T}$, $\rho$ scales columns in the state update. (Hover a column of $\Delta S_r$ to trace the decayed keys and the corresponding column of $V_r$.)&lt;&#x2F;p&gt;
&lt;div class=&quot;row crow&quot; id=&quot;g3raw&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Write that column scaling as a diagonal matrix and absorb it into the keys:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\overrightarrow{K}_r
:=
\operatorname{diag}\!\left(\gamma^{C-1},\gamma^{C-2},\ldots,1\right)K_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The right arrow denotes right-boundary decay: key row $\ell$ includes the factor $\gamma^{C-\ell}$ from its position to the chunk&#x27;s right boundary.&lt;&#x2F;p&gt;
&lt;div class=&quot;row crow&quot; id=&quot;g3a&quot;&gt;&lt;&#x2F;div&gt;
&lt;h4 id=&quot;complete-chunkwise-form&quot;&gt;Complete chunkwise form&lt;&#x2F;h4&gt;
&lt;p&gt;Combining the history and local terms gives the complete chunkwise equations:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
O_r
&amp;amp;=\underbrace{\overleftarrow{Q}_rS_r}_{\text{history}}
+\underbrace{\bigl(Q_rK_r^{\mathsf T}\odot\Gamma_C\bigr)V_r}_{\text{local}},\\
S_{r+1}
&amp;amp;=\gamma^CS_r+\overrightarrow{K}_r^{\mathsf T}V_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The arrows identify the relevant boundary. Queries absorb decay from the left boundary, while keys absorb decay toward the right boundary. The incoming history state decays from the left boundary to each query position; each key–value write made inside the chunk decays from its position to the right boundary. This exact regrouping keeps the same $\mathcal O(nCd+nd^2)$ asymptotic cost as the Naïve chunkwise algorithm.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;mamba-2-input-dependent-scalar-decay&quot;&gt;Mamba-2: input-dependent scalar decay&lt;&#x2F;h2&gt;
&lt;p&gt;RetNet applies the same decay $\gamma$ at every position. &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2405.21060&quot;&gt;Mamba-2&lt;&#x2F;a&gt; replaces it with a token-dependent scalar $a_t$. Its recurrent form is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t=a_tS_{t-1}+k_t^{\mathsf T}v_t,
\qquad
o_t=q_tS_t,
\qquad
0&amp;lt;a_t&amp;lt;1.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Each token supplies one scalar for the entire state. A value near one preserves history; a value near zero nearly clears it.&lt;&#x2F;p&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Optional: Constructing the decay gate&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;The recurrence assumes $0&amp;lt;a_t&amp;lt;1$. During training, the model must learn $a_t$ while preserving this constraint. Mamba-2 constructs the gate by discretizing continuous-time exponential decay:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\frac{dS(\tau)}{d\tau}=-\lambda S(\tau),
\qquad \lambda&amp;gt;0.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Over one token interval $\Delta_t$, the exact solution is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t=e^{-\lambda\Delta_t}S_{t-1}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;First, Mamba-2 learns a positive decay rate. It stores an unconstrained log-rate $A_{\log}$ and exponentiates it:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\lambda=e^{A_{\log}}&amp;gt;0.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The rate $\lambda$ specifies the decay &lt;strong&gt;per unit time&lt;&#x2F;strong&gt;. Discretization converts the continuous system into one transition per token. Mamba-2 computes an input-dependent step size $\Delta_t$ for the transition at token $t$, so different tokens advance the continuous system by different amounts. A token with a larger $\Delta_t$ advances the system farther and produces stronger decay; a token with a smaller $\Delta_t$ produces weaker decay. From the token representation $h_t$, a learned projection $W_\Delta$ produces an unconstrained step $\widetilde\Delta_t$. The model adds a learned bias $b_\Delta$ and applies softplus to make the step positive:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\widetilde\Delta_t=h_tW_\Delta,
\qquad
\Delta_t=\operatorname{softplus}(\widetilde\Delta_t+b_\Delta)&amp;gt;0.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Combining the positive rate and interval gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$a_t=e^{-\lambda\Delta_t}
=\exp\!\left(-e^{A_{\log}}\operatorname{softplus}(\widetilde\Delta_t+b_\Delta)\right)\in(0,1).$$
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;h3 id=&quot;parallel-form-1&quot;&gt;Parallel form&lt;&#x2F;h3&gt;
&lt;p&gt;The outer-product write $k_j^{\mathsf T}v_j$ enters the state at position $j$. To reach $S_t$, subsequent transitions multiply it by $a_{j+1},a_{j+2},\ldots,a_t$. Its survival coefficient is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$a_{j+1}a_{j+2}\cdots a_t.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Collect these survival coefficients in the decay matrix $\Gamma$. Entry $\Gamma[t,j]$ scales the score between $q_t$ and $k_j$. (Hover an entry of $\Gamma$ to trace the corresponding query, key, value, and output.)&lt;&#x2F;p&gt;
&lt;div class=&quot;row crow&quot; id=&quot;gProd&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;For an inclusive interval, define&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\lambda[i:j]:=\prod_{s=i}^{j}a_s,
\qquad
\text{empty product }(i&amp;gt;j)\text{ returns }1.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The decay matrix becomes&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\Gamma[t,j]
=
\begin{cases}
\lambda[j+1:t], &amp;amp; j\le t,\\
0, &amp;amp; j&amp;gt;t.
\end{cases}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;row crow&quot; id=&quot;gGam&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;The parallel equation keeps the same form as RetNet:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O=\bigl(QK^{\mathsf T}\odot\Gamma\bigr)V.$$
&lt;&#x2F;div&gt;
&lt;h3 id=&quot;chunkwise-form-1&quot;&gt;Chunkwise form&lt;&#x2F;h3&gt;
&lt;p&gt;The chunkwise derivation follows RetNet. Each fixed power of $\gamma$ is replaced by a product of token-dependent gates.&lt;&#x2F;p&gt;
&lt;p&gt;Within chunk $r$, let $a_{r,\ell}$ denote the gate at local position $\ell$, and define&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\lambda_r[i:j]:=\prod_{s=i}^{j}a_{r,s}.$$
&lt;&#x2F;div&gt;
&lt;h4 id=&quot;decay-incoming-history-1&quot;&gt;Decay incoming history&lt;&#x2F;h4&gt;
&lt;p&gt;Before $q_{r,\ell}$ reads the incoming state $S_r$, the recurrence multiplies $S_r$ by $\lambda_r[1:\ell]$. As in RetNet, absorb this scalar into the query row:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\overleftarrow q_{r,\ell}
:=\lambda_r[1:\ell]q_{r,\ell},
\qquad
O_r^{\mathrm{hist}}=\overleftarrow Q_rS_r.$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;row crow&quot; id=&quot;gHist&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;The left arrow again denotes decay from the chunk&#x27;s left boundary to each query position.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;compute-the-local-block-1&quot;&gt;Compute the local block&lt;&#x2F;h4&gt;
&lt;p&gt;The write $k_{r,m}^{\mathsf T}v_{r,m}$ is multiplied by $\lambda_r[m+1:\ell]$ before it contributes to the output at local position $\ell$. Therefore,&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\Gamma_{C,r}[\ell,m]
=
\begin{cases}
\lambda_r[m+1:\ell], &amp;amp; m\le\ell,\\
0, &amp;amp; m&amp;gt;\ell.
\end{cases}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;row crow&quot; id=&quot;gLocal&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;The local output is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O_r^{\mathrm{local}}
=\bigl(Q_rK_r^{\mathsf T}\odot\Gamma_{C,r}\bigr)V_r.$$
&lt;&#x2F;div&gt;
&lt;h4 id=&quot;update-the-state-2&quot;&gt;Update the state&lt;&#x2F;h4&gt;
&lt;p&gt;We now have $O_r$. To construct the state for the next chunk, multiply the incoming state by $\lambda_r[1:C]$. The write at local position $\ell$ is multiplied only by the subsequent gates, whose product is $\lambda_r[\ell+1:C]$. Absorb this suffix product into its key:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\overrightarrow k_{r,\ell}
:=\lambda_r[\ell+1:C]k_{r,\ell}.$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;row crow&quot; id=&quot;gState&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;The right arrow denotes decay from each write position to the chunk&#x27;s right boundary. The state update is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_{r+1}
=\lambda_r[1:C]S_r+\overrightarrow K_r^{\mathsf T}V_r.$$
&lt;&#x2F;div&gt;
&lt;h4 id=&quot;complete-chunkwise-form-1&quot;&gt;Complete chunkwise form&lt;&#x2F;h4&gt;
&lt;p&gt;Combining the output and state equations gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
O_r
&amp;amp;=\underbrace{\overleftarrow Q_rS_r}_{\text{history}}
+\underbrace{\bigl(Q_rK_r^{\mathsf T}\odot\Gamma_{C,r}\bigr)V_r}_{\text{local}},\\
S_{r+1}
&amp;amp;=\lambda_r[1:C]S_r+\overrightarrow K_r^{\mathsf T}V_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Mamba-2 therefore keeps RetNet&#x27;s scalar state transition but lets each token choose how much history survives. The gate remains scalar, so it scales every entry of the state equally.&lt;&#x2F;p&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Optional: Discretization convention&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;Discretization affects both the decay and the new write. Mamba-2 also multiplies the write by the step size $\Delta_t$, so the literal recurrence is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t=a_tS_{t-1}+k_t^{\mathsf T}(\Delta_t v_t^{\mathrm{raw}}).$$
&lt;&#x2F;div&gt;
&lt;p&gt;To keep the same notation as the preceding sections, define&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$v_t:=\Delta_t v_t^{\mathrm{raw}}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;All equations above use this rescaled $v_t$.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;h2 id=&quot;deltanet-correcting-memory-collisions&quot;&gt;DeltaNet: correcting memory collisions&lt;&#x2F;h2&gt;
&lt;p&gt;Mamba-2 decays the entire history at once. Sometimes we instead want to correct the association addressed by the current key without uniformly decaying the entire memory. &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2406.06484&quot;&gt;DeltaNet&lt;&#x2F;a&gt; provides this more selective update.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;why-additive-writes-collide&quot;&gt;Why additive writes collide&lt;&#x2F;h3&gt;
&lt;p&gt;Treat $S$ as a key–value associative memory. For each association $(k_i,v_i)$, we would like to retrieve $v_i$ by reading the memory with $k_i$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$k_iS\approx v_i.$$
&lt;&#x2F;div&gt;
&lt;p&gt;However, for a unit-norm key $k_i$, the read contains&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
k_iS
&amp;amp;=\sum_{j=1}^{m}(k_i k_j^{\mathsf T})v_j\\
&amp;amp;=v_i+\underbrace{\sum_{j\ne i}(k_i k_j^{\mathsf T})v_j}_{\text{cross-talk}}.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The first term is the intended value. The other terms come from keys that overlap with $k_i$. Orthogonal keys eliminate this interference, but learned keys generally are not mutually orthogonal. A raw outer-product write can therefore collide with associations already stored in $S$.&lt;&#x2F;p&gt;
&lt;p&gt;DeltaNet first asks what value the current state associates with $k_t$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\widehat v_t=k_tS_{t-1},$$
&lt;&#x2F;div&gt;
&lt;p&gt;The residual $v_t-\widehat v_t$ points from this prediction toward the desired value $v_t$. DeltaNet writes a step in that direction at $k_t$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t
=S_{t-1}+\beta_t k_t^{\mathsf T}(v_t-\widehat v_t),
\qquad 0&amp;lt;\beta_t\le 1.$$
&lt;&#x2F;div&gt;
&lt;h3 id=&quot;an-intuitive-example&quot;&gt;An intuitive example&lt;&#x2F;h3&gt;
&lt;p&gt;Consider a simplified memory with two associations. The labels below stand for key and value vectors. Assume the Alice and Bob keys are orthogonal and unit norm, so a write at Bob&#x27;s key does not change the value read at Alice&#x27;s key.&lt;&#x2F;p&gt;
&lt;div class=&quot;dn-memory-example&quot; aria-label=&quot;Delta rule memory update example&quot;&gt;
  &lt;div class=&quot;dn-memory-card&quot;&gt;
    &lt;div class=&quot;dn-memory-title&quot;&gt;Current memory&lt;&#x2F;div&gt;
    &lt;div class=&quot;dn-memory-row&quot;&gt;&lt;strong&gt;Alice&lt;&#x2F;strong&gt;&lt;span&gt;at school&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;
    &lt;div class=&quot;dn-memory-row&quot;&gt;&lt;strong&gt;Bob&lt;&#x2F;strong&gt;&lt;span&gt;at home&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;
  &lt;&#x2F;div&gt;
  &lt;div class=&quot;dn-memory-arrow&quot;&gt;+&lt;&#x2F;div&gt;
  &lt;div class=&quot;dn-memory-card dn-memory-new&quot;&gt;
    &lt;div class=&quot;dn-memory-title&quot;&gt;New association&lt;&#x2F;div&gt;
    &lt;div class=&quot;dn-memory-row&quot;&gt;&lt;strong&gt;Bob&lt;&#x2F;strong&gt;&lt;span&gt;at the office&lt;&#x2F;span&gt;&lt;&#x2F;div&gt;
  &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;Reading the state with Bob&#x27;s key first returns “at home.” The target is “at the office,” so DeltaNet writes the difference between those two value vectors at Bob&#x27;s key. Reading Bob after the update gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$k_{\mathrm{Bob}}S_{\mathrm{new}}
=(1-\beta)\,v_{\mathrm{home}}
+\beta\,v_{\mathrm{office}}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;If $\beta=1$, the new value replaces the old prediction exactly. A smaller $\beta$ makes a partial correction.&lt;&#x2F;p&gt;
&lt;p&gt;More generally, when $\lVert k_t\rVert_2=1$,&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$k_tS_t=(1-\beta_t)\widehat v_t+\beta_t v_t.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The unit-norm condition matters. Without it, reading the update back with $k_t$ introduces an additional factor $\lVert k_t\rVert_2^2$.&lt;&#x2F;p&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Optional: Test-time training (TTT) interpretation&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;Another interpretation treats $S$ as a small linear model that maps keys to values. The pair $(k_t,v_t)$ supplies one online training example with squared-error loss&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\mathcal L_t(S)=\frac12\lVert k_tS-v_t\rVert_2^2.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Its gradient is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\nabla_S\mathcal L_t(S)=k_t^{\mathsf T}(k_tS-v_t).$$
&lt;&#x2F;div&gt;
&lt;p&gt;One gradient step from $S_{t-1}$ with learning rate $\beta_t$ gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t
=S_{t-1}-\beta_t\nabla_S\mathcal L_t(S_{t-1})
=S_{t-1}+\beta_tk_t^{\mathsf T}(v_t-k_tS_{t-1}),$$
&lt;&#x2F;div&gt;
&lt;p&gt;which is exactly the DeltaNet update. This view connects the delta rule to &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2407.04620&quot;&gt;&lt;em&gt;Learning to (Learn at Test Time)&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;: the forward pass updates the recurrent state as a fast-weight model.&lt;&#x2F;p&gt;
&lt;p&gt;The same view also recovers the preceding recurrences. With a unit learning rate:&lt;&#x2F;p&gt;
&lt;div class=&quot;ttt-table-wrap&quot;&gt;
  &lt;table class=&quot;ttt-table&quot;&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Method&lt;&#x2F;th&gt;
        &lt;th&gt;Online loss $\mathcal L_t(S)$&lt;&#x2F;th&gt;
        &lt;th&gt;State update&lt;&#x2F;th&gt;
      &lt;&#x2F;tr&gt;
    &lt;&#x2F;thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Naïve&lt;&#x2F;td&gt;
        &lt;td&gt;$-\langle k_tS,v_t\rangle$&lt;&#x2F;td&gt;
        &lt;td&gt;$S_t=S_{t-1}+k_t^{\mathsf T}v_t$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
      &lt;tr&gt;
        &lt;td&gt;RetNet&lt;&#x2F;td&gt;
        &lt;td&gt;$-\langle k_tS,v_t\rangle+\dfrac{1-\gamma}{2}\lVert S\rVert_F^2$&lt;&#x2F;td&gt;
        &lt;td&gt;$S_t=\gamma S_{t-1}+k_t^{\mathsf T}v_t$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Mamba-2&lt;&#x2F;td&gt;
        &lt;td&gt;$-\langle k_tS,v_t\rangle+\dfrac{1-a_t}{2}\lVert S\rVert_F^2$&lt;&#x2F;td&gt;
        &lt;td&gt;$S_t=a_tS_{t-1}+k_t^{\mathsf T}v_t$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
    &lt;&#x2F;tbody&gt;
  &lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;From the TTT view, Naïve linear attention has an unbounded objective: increasing $S$ along $k_t^{\mathsf T}v_t$ can drive the linear loss toward $-\infty$. RetNet adds a fixed $L_2$ penalty on the state, while Mamba-2 makes the strength of that penalty token-dependent through $a_t$.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;p&gt;The example explains one token update. We now derive the recurrent and full-sequence matrix forms.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;recurrent-form&quot;&gt;Recurrent form&lt;&#x2F;h3&gt;
&lt;p&gt;Define the scaled correction&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$u_t:=\beta_t(v_t-\widehat v_t).$$
&lt;&#x2F;div&gt;
&lt;p&gt;The complete token recurrence is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
\widehat v_t&amp;amp;=k_tS_{t-1},\\
u_t&amp;amp;=\beta_t(v_t-\widehat v_t),\\
S_t&amp;amp;=S_{t-1}+k_t^{\mathsf T}u_t,\\
o_t&amp;amp;=q_tS_t.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;flow&quot; id=&quot;flow&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Once $u_t$ is known, the state has the same additive form as Naïve linear attention:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t=\sum_{i=1}^{t}k_i^{\mathsf T}u_i.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Unlike the raw values $v_t$, the corrections $u_t$ are causally coupled: each $u_t$ depends on earlier corrections through $S_{t-1}$. We therefore cannot form all rows of $U$ independently as in Naïve linear attention. We first collect this dependency into a triangular system and solve for $U$; only then can we reuse the linear-attention readout.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-triangular-correction-system&quot;&gt;The triangular correction system&lt;&#x2F;h3&gt;
&lt;p&gt;Substitute&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_{t-1}=\sum_{i&amp;lt;t}k_i^{\mathsf T}u_i$$
&lt;&#x2F;div&gt;
&lt;p&gt;into the prediction. Then&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$u_t
=\beta_t\left(v_t-\sum_{i&amp;lt;t}(k_tk_i^{\mathsf T})u_i\right).$$
&lt;&#x2F;div&gt;
&lt;p&gt;For the first three tokens,&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
u_1&amp;amp;=\beta_1v_1,\\
u_2&amp;amp;=\beta_2\left(v_2-(k_2k_1^{\mathsf T})u_1\right),\\
u_3&amp;amp;=\beta_3\left(v_3-(k_3k_1^{\mathsf T})u_1-(k_3k_2^{\mathsf T})u_2\right).
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Only earlier corrections appear on the right. Define the strictly lower-triangular matrix&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$L[t,i]
=\begin{cases}
k_tk_i^{\mathsf T},&amp;amp;i&amp;lt;t,\\
0,&amp;amp;i\ge t.
\end{cases}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;dnrow&quot; id=&quot;g-Lliteral&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Let $M$ be the inclusive causal mask and $M^-:=M-I$ its strictly lower-triangular part. Then&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$L=(KK^{\mathsf T})\odot M^-.$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;dnrow&quot; id=&quot;g-Lfactor&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;Stack $u_t$ into $U\in\mathbb R^{n\times d}$ and define $B:=\operatorname{diag}(\beta)$. The row recurrences become (as you should verify):&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
U&amp;amp;=B(V-LU),\\
(I+BL)U&amp;amp;=BV.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Equivalently,&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$U=(I+BL)^{-1}BV.$$
&lt;&#x2F;div&gt;
&lt;h3 id=&quot;solving-for-u&quot;&gt;Solving for $U$&lt;&#x2F;h3&gt;
&lt;p&gt;We do not compute $(I+BL)^{-1}$ explicitly. Forming a dense $n\times n$ inverse costs $\mathcal O(n^3)$.&lt;&#x2F;p&gt;
&lt;p&gt;Set $A:=I+BL$ and $R:=BV$. Since $A$ is unit lower triangular, &lt;strong&gt;forward substitution&lt;&#x2F;strong&gt; solves&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$AU=R$$
&lt;&#x2F;div&gt;
&lt;p&gt;one row at a time. At row $t$, the earlier rows of $U$ are already known, and $u_t$ is the only new row. (Hover a row to follow the known inputs and current unknown.)&lt;&#x2F;p&gt;
&lt;div class=&quot;row fs-row&quot; id=&quot;g-forward&quot;&gt;&lt;&#x2F;div&gt;
&lt;p&gt;For $U\in\mathbb R^{n\times d}$, row $t$ costs $\mathcal O(td)$ and the full solve costs $\mathcal O(n^2d)$.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;parallel-output&quot;&gt;Parallel output&lt;&#x2F;h3&gt;
&lt;p&gt;After solving for $U$, the state is a sum of key–correction outer products. The causal output therefore reuses the Naïve linear-attention equation with $U$ in place of $V$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
O_{\mathrm{naïve}}&amp;amp;=(QK^{\mathsf T}\odot M)V,\\
O_{\mathrm{DeltaNet}}&amp;amp;=(QK^{\mathsf T}\odot M)U,
\qquad
U=[I+B(KK^{\mathsf T}\odot M^-)]^{-1}BV.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;h3 id=&quot;chunkwise-algorithm-1&quot;&gt;Chunkwise algorithm&lt;&#x2F;h3&gt;
&lt;p&gt;The full $n$-token triangular system still requires quadratic work. Divide the sequence into chunks of $C$ tokens instead. Each chunk starts from its incoming boundary state. Local dependencies then fit in a $C\times C$ system, while a $d\times d$ state carries history between chunks. This regrouping is exact.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;one-chunk-as-an-affine-recurrence&quot;&gt;One chunk as an affine recurrence&lt;&#x2F;h4&gt;
&lt;p&gt;Let $r$ index chunks and $\ell\in{1,\ldots,C}$ index tokens in the current chunk. $S_r$ is the state before the chunk, and $S_{r+1}$ is the state after it. Rewrite the DeltaNet update as&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
A_{r,\ell}
&amp;amp;:=I-\beta_{r,\ell}k_{r,\ell}^{\mathsf T}k_{r,\ell},\\
X_{r,\ell}
&amp;amp;:=\beta_{r,\ell}k_{r,\ell}^{\mathsf T}v_{r,\ell},\\
S_r^{(\ell)}
&amp;amp;=A_{r,\ell}S_r^{(\ell-1)}+X_{r,\ell},
\qquad
S_r^{(0)}=S_r,\quad S_r^{(C)}=S_{r+1}.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;For example, a chunk with $C=2$ contains two local transitions:&lt;&#x2F;p&gt;
&lt;div id=&quot;dn-chunk-rail&quot; class=&quot;dn-chunk-rail&quot; aria-label=&quot;DeltaNet recurrence through one two-token chunk&quot;&gt;&lt;&#x2F;div&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Lemma: Explicit form of an affine recurrence&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;So far, we have always described $S_t$ through a recurrence relation. For a numerical sequence, we often seek an explicit formula that gives its $t$-th term directly. Can we do the same for $S_t$?&lt;&#x2F;p&gt;
&lt;p&gt;First, consider a constant transition $A$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t=AS_{t-1}+X_t.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The first two steps are&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
S_1&amp;amp;=AS_0+X_1,\\
S_2&amp;amp;=A^2S_0+AX_1+X_2.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The pattern gives the explicit formula&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t
=
A^tS_0
+
\sum_{i=1}^{t}A^{t-i}X_i.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The same formula can start from any earlier state $S_\tau$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t
=
A^{t-\tau}S_\tau
+
\sum_{i=\tau+1}^{t}A^{t-i}X_i.$$
&lt;&#x2F;div&gt;
&lt;p&gt;For $S_t$, the first term carries the earlier state $S_\tau$ forward. The second term is the &lt;strong&gt;convolution sum&lt;&#x2F;strong&gt;. Since $X_i$ enters at position $i$, the remaining $t-i$ transitions act on it.&lt;&#x2F;p&gt;
&lt;p&gt;How about the general affine recurrence, where the transition matrix changes with $t$?&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t=A_tS_{t-1}+X_t.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Powers of one matrix no longer suffice. For $i\le j$, define the ordered transition product&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\Lambda[i:j]:=A_jA_{j-1}\cdots A_i,$$
&lt;&#x2F;div&gt;
&lt;p&gt;and let $\Lambda[i:j]=I$ when $i&amp;gt;j$. The constant-transition formula becomes (as you should verify)&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t
=
\Lambda[1:t]S_0
+
\sum_{i=1}^{t}\Lambda[i+1:t]X_i.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Starting from any earlier state $S_\tau$ gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t
=
\Lambda[\tau+1:t]S_\tau
+
\sum_{i=\tau+1}^{t}\Lambda[i+1:t]X_i.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Here $\Lambda[i+1:t]$ is the time-varying counterpart of $A^{t-i}$.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;p&gt;Use $\Lambda_r[i:j]$ for the ordered transition product over local positions $i$ through $j$ in chunk $r$. Applying the lemma to the incoming state $S_r$ gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
S_{r+1}
&amp;amp;=\Lambda_r[1:C]S_r+H_r,\\
H_r
&amp;amp;:=\sum_{i=1}^{C}\Lambda_r[i+1:C]X_{r,i}.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The first term carries the incoming state across the chunk. $H_r$ is the within-chunk &lt;strong&gt;convolution sum&lt;&#x2F;strong&gt; of local writes. Computing either expression directly would require many dense $d\times d$ transition products.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;compact-the-transition-product-with-wy&quot;&gt;Compact the transition product with WY&lt;&#x2F;h4&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Householder transformations and WY&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;For a unit row vector $h$, the matrix&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$I-2h^{\mathsf T}h$$
&lt;&#x2F;div&gt;
&lt;p&gt;is a Householder reflection. It reflects a vector across the hyperplane orthogonal to $h$. Now consider the more general factors&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$G_i=I-k_i^{\mathsf T}v_i.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Each $G_i$ is the identity plus a rank-one update, a special case of &lt;strong&gt;diagonal plus low rank (DPLR)&lt;&#x2F;strong&gt;, a common transition structure in structured state-space models.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;strong&gt;WY representation&lt;&#x2F;strong&gt; says that the ordered product can be written as&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$G_mG_{m-1}\cdots G_1
=
I-K^{\mathsf T}W$$
&lt;&#x2F;div&gt;
&lt;p&gt;where $K$ stacks the rows $k_1,\ldots,k_m$ and $W\in\mathbb R^{m\times d}$. WY replaces the growing transition product with the two thin matrices $K$ and $W$.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;p&gt;For DeltaNet, the two vectors in each DPLR correction are $k_{r,\ell}$ and $\beta_{r,\ell}k_{r,\ell}$. We absorb $\beta_{r,\ell}$ into the triangular factor below. WY then gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\Lambda_r[1:C]=I-K_r^{\mathsf T}W_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;To construct $W_r$, maintain the partial form&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\Lambda_r[1:\ell]
=
I-\sum_{i=1}^{\ell}k_{r,i}^{\mathsf T}w_{r,i}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The first three rows of $W_r$ follow by substituting one transition at a time:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
w_{r,1}
&amp;amp;=\beta_{r,1}k_{r,1},\\
w_{r,2}
&amp;amp;=\beta_{r,2}\!\left(
k_{r,2}-(k_{r,2}k_{r,1}^{\mathsf T})w_{r,1}
\right),\\
w_{r,3}
&amp;amp;=\beta_{r,3}\!\left(
k_{r,3}
-(k_{r,3}k_{r,1}^{\mathsf T})w_{r,1}
-(k_{r,3}k_{r,2}^{\mathsf T})w_{r,2}
\right).
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The general row is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$w_{r,\ell}
=
\beta_{r,\ell}\!\left(
k_{r,\ell}
-\sum_{i&amp;lt;\ell}
(k_{r,\ell}k_{r,i}^{\mathsf T})w_{r,i}
\right).$$
&lt;&#x2F;div&gt;
&lt;p&gt;Let $M_c$ be the inclusive $C\times C$ causal mask, $M_c^-:=M_c-I$, and&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$B_r:=\operatorname{diag}(\beta_r),
\qquad
L_r:=(K_rK_r^{\mathsf T})\odot M_c^-.$$
&lt;&#x2F;div&gt;
&lt;p&gt;As in the full-sequence parallel form, stacking these row recurrences produces:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$(I+B_rL_r)W_r=B_rK_r,
\qquad
\Lambda_r[1:C]=I-K_r^{\mathsf T}W_r.$$
&lt;&#x2F;div&gt;
&lt;h4 id=&quot;compact-the-local-writes&quot;&gt;Compact the local writes&lt;&#x2F;h4&gt;
&lt;p&gt;The local convolution sum $H_r$ is the state produced by the tokens in chunk $r$ when the incoming state is zero. The full-sequence parallel form already showed that DeltaNet writes its state as $K^{\mathsf T}U$. Applying the same result within the chunk gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$H_r=K_r^{\mathsf T}U_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The first three rows of $U_r$ are (as you may verify)&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
u_{r,1}
&amp;amp;=\beta_{r,1}v_{r,1},\\
u_{r,2}
&amp;amp;=\beta_{r,2}\!\left(
v_{r,2}-(k_{r,2}k_{r,1}^{\mathsf T})u_{r,1}
\right),\\
u_{r,3}
&amp;amp;=\beta_{r,3}\!\left(
v_{r,3}
-(k_{r,3}k_{r,1}^{\mathsf T})u_{r,1}
-(k_{r,3}k_{r,2}^{\mathsf T})u_{r,2}
\right).
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The general row is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$u_{r,\ell}
=
\beta_{r,\ell}\!\left(
v_{r,\ell}
-\sum_{i&amp;lt;\ell}
(k_{r,\ell}k_{r,i}^{\mathsf T})u_{r,i}
\right).$$
&lt;&#x2F;div&gt;
&lt;p&gt;This is exactly the full-sequence correction recurrence, applied only within chunk $r$. Stacking the rows gives:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$(I+B_rL_r)U_r=B_rV_r.$$
&lt;&#x2F;div&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Optional: Use UT to share the triangular transform&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;Solving for $W_r$ and $U_r$ separately would repeat the same lower-triangular solve. UT lets us solve once for a shared transform, then obtain both matrices with dense matrix multiplications.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;UT representation.&lt;&#x2F;strong&gt; The WY form leaves $W$ implicit. For the DPLR product above, let $V$ stack the right factors $v_1,\ldots,v_m$. Because row $i$ of $W$ depends only on $v_1,\ldots,v_i$, we can write&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$W=TV$$
&lt;&#x2F;div&gt;
&lt;p&gt;for a lower-triangular $T\in\mathbb R^{m\times m}$. The WY representation then becomes&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$G_mG_{m-1}\cdots G_1
=
I-K^{\mathsf T}TV.$$
&lt;&#x2F;div&gt;
&lt;p&gt;This equivalent form is the &lt;strong&gt;UT representation&lt;&#x2F;strong&gt;. It exposes the triangular transform from the original right factors $V$ to their accumulated form $W$.&lt;&#x2F;p&gt;
&lt;p&gt;The derivations of $W_r$ and $U_r$ produced&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
(I+B_rL_r)W_r&amp;amp;=B_rK_r,\\
(I+B_rL_r)U_r&amp;amp;=B_rV_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The coefficient matrix is identical; only the right-hand side changes. Following UT, define $T_r\in\mathbb R^{C\times C}$ by&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$(I+B_rL_r)T_r=B_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Right multiplication by $K_r$ or $V_r$ then gives&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
W_r&amp;amp;=T_rK_r,\\
U_r&amp;amp;=T_rV_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The compact transition product and convolution sum are therefore&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\Lambda_r[1:C]=I-K_r^{\mathsf T}T_rK_r,
\qquad
H_r=K_r^{\mathsf T}T_rV_r.$$
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;h4 id=&quot;correct-the-incoming-state&quot;&gt;Correct the incoming state&lt;&#x2F;h4&gt;
&lt;p&gt;Substitute the compact forms of $\Lambda_r[1:C]$ and $H_r$ into the unrolled recurrence:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
S_{r+1}
&amp;amp;=(I-K_r^{\mathsf T}W_r)S_r+K_r^{\mathsf T}U_r\\
&amp;amp;=S_r+K_r^{\mathsf T}(U_r-W_rS_r).
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Define the actual correction rows as&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$Z_r=U_r-W_rS_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;$U_r$ contains the corrections obtained with an empty incoming state. $W_rS_r$ is the transformed contribution of the predictions from $S_r$. Their difference gives the corrections produced by the actual chunk:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_{r+1}=S_r+K_r^{\mathsf T}Z_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The update now has the same additive form as Naïve linear attention. We can therefore reuse its chunkwise output formula with $Z_r$ in place of $V_r$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$O_r
=
Q_rS_r
+
(Q_rK_r^{\mathsf T}\odot M_c)Z_r.$$
&lt;&#x2F;div&gt;
&lt;details class=&quot;algorithm-fold&quot;&gt;
  &lt;summary&gt;Complete per-chunk algorithm&lt;&#x2F;summary&gt;
  &lt;div class=&quot;algorithm-fold-body&quot;&gt;
    &lt;p&gt;For each chunk $r$,&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
L_r
&amp;amp;=(K_rK_r^{\mathsf T})\odot M_c^-,\\
(I+B_rL_r)T_r
&amp;amp;=B_r,\\
W_r
&amp;amp;=T_rK_r,\\
U_r
&amp;amp;=T_rV_r,\\
Z_r
&amp;amp;=U_r-W_rS_r,\\
O_r
&amp;amp;=Q_rS_r+(Q_rK_r^{\mathsf T}\odot M_c)Z_r,\\
S_{r+1}
&amp;amp;=S_r+K_r^{\mathsf T}Z_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;The local quantities $L_r,T_r,W_r,$ and $U_r$ can be computed for all chunks in parallel. The boundary pass then threads $S_r$ through the chunks to form $Z_r$, $O_r$, and $S_{r+1}$.&amp;lt;&#x2F;p&amp;gt;
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
  &lt;&#x2F;div&gt;
&lt;&#x2F;details&gt;
&lt;h2 id=&quot;gated-deltanet-gdn&quot;&gt;Gated DeltaNet (GDN)&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2412.06464&quot;&gt;Gated DeltaNet (GDN)&lt;&#x2F;a&gt; extends DeltaNet by adding a token-dependent scalar decay to the state transition:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
\text{DeltaNet:}\qquad
S_t
&amp;amp;=(I-\beta_tk_t^{\mathsf T}k_t)S_{t-1}
  +\beta_tk_t^{\mathsf T}v_t,\\
\text{GDN:}\qquad
S_t
&amp;amp;=a_t(I-\beta_tk_t^{\mathsf T}k_t)S_{t-1}
  +\beta_tk_t^{\mathsf T}v_t.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;GDN adds scalar decay to DeltaNet in the same way that Mamba-2 adds scalar decay to Naïve linear attention. DeltaNet also has the same chunkwise form as Naïve linear attention after replacing $V_r$ with $Z_r$.&lt;&#x2F;p&gt;
&lt;div class=&quot;ttt-table-wrap&quot;&gt;
  &lt;table class=&quot;ttt-table gdn-comparison-table&quot;&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Method&lt;&#x2F;th&gt;
        &lt;th&gt;Chunkwise readout&lt;&#x2F;th&gt;
        &lt;th&gt;Chunkwise state update&lt;&#x2F;th&gt;
      &lt;&#x2F;tr&gt;
    &lt;&#x2F;thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Naïve&lt;&#x2F;td&gt;
        &lt;td&gt;$O_r=Q_rS_r+(Q_rK_r^{\mathsf T}\odot M_c)V_r$&lt;&#x2F;td&gt;
        &lt;td&gt;$S_{r+1}=S_r+K_r^{\mathsf T}V_r$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
      &lt;tr class=&quot;group-end&quot;&gt;
        &lt;td&gt;Mamba-2&lt;&#x2F;td&gt;
        &lt;td&gt;$O_r=\overleftarrow Q_rS_r+(Q_rK_r^{\mathsf T}\odot\Gamma_{C,r})V_r$&lt;&#x2F;td&gt;
        &lt;td&gt;$S_{r+1}=\lambda_r[1:C]S_r+\overrightarrow K_r^{\mathsf T}V_r$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
      &lt;tr class=&quot;group-start&quot;&gt;
        &lt;td&gt;DeltaNet&lt;&#x2F;td&gt;
        &lt;td&gt;$O_r=Q_rS_r+(Q_rK_r^{\mathsf T}\odot M_c)Z_r$&lt;&#x2F;td&gt;
        &lt;td&gt;$S_{r+1}=S_r+K_r^{\mathsf T}Z_r$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
      &lt;tr&gt;
        &lt;td&gt;GDN&lt;&#x2F;td&gt;
        &lt;td&gt;$O_r=\overleftarrow Q_rS_r+(Q_rK_r^{\mathsf T}\odot\Gamma_{C,r})Z_r$&lt;&#x2F;td&gt;
        &lt;td&gt;$S_{r+1}=\lambda_r[1:C]S_r+\overrightarrow K_r^{\mathsf T}Z_r$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
    &lt;&#x2F;tbody&gt;
  &lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Decay also changes the correction rows&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;GDN scales the entire correction by $\beta_t$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$u_t=\beta_t\bigl(v_t-a_tk_tS_{t-1}\bigr).$$
&lt;&#x2F;div&gt;
&lt;p&gt;Thus, $\beta_t$ scales both the target and the prediction. Within a chunk, $\Gamma_{C,r}$ also applies the scalar decay to the key–key coefficients in the triangular system, while $B_r$ incorporates $\beta_t$ into $T_r$.&lt;&#x2F;p&gt;
&lt;p&gt;The prediction from the incoming state has decayed from the left chunk boundary. Therefore, replace&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$W_r=T_rK_r
\qquad\longrightarrow\qquad
\overleftarrow W_r=T_r\overleftarrow K_r$$
&lt;&#x2F;div&gt;
&lt;p&gt;and define&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$Z_r=U_r-\overleftarrow W_rS_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The prediction uses the &lt;strong&gt;left arrow&lt;&#x2F;strong&gt; because it starts from the incoming state. The state update uses $\overrightarrow K_r$ because each correction decays from its own position to the right boundary.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;details class=&quot;algorithm-fold&quot;&gt;
  &lt;summary&gt;Complete per-chunk algorithm&lt;&#x2F;summary&gt;
  &lt;div class=&quot;algorithm-fold-body&quot;&gt;
    &lt;p&gt;For each chunk $r$, define the decay products and the correction gate:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
\lambda_r[i:j]
&amp;amp;:=\prod_{s=i}^{j}a_{r,s},
\qquad
\lambda_r[i:j]=1\ \text{when }i&amp;gt;j,\\
\Gamma_{C,r}[\ell,i]
&amp;amp;:=
\begin{cases}
\lambda_r[i+1:\ell],&amp;amp;i\le\ell,\\
0,&amp;amp;i&amp;gt;\ell,
\end{cases}\\
B_r
&amp;amp;:=\operatorname{diag}(\beta_{r,1},\ldots,\beta_{r,C}).
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
\overleftarrow q_{r,\ell}
&amp;amp;:=\lambda_r[1:\ell]q_{r,\ell},&amp;amp;
\overleftarrow k_{r,\ell}
&amp;amp;:=\lambda_r[1:\ell]k_{r,\ell},&amp;amp;
\overrightarrow k_{r,\ell}
&amp;amp;:=\lambda_r[\ell+1:C]k_{r,\ell}.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
L_r
&amp;amp;=(K_rK_r^{\mathsf T}\odot\Gamma_{C,r})\odot M_c^-,\\
(I+B_rL_r)T_r
&amp;amp;=B_r,\\
U_r
&amp;amp;=T_rV_r,\\
\overleftarrow W_r
&amp;amp;=T_r\overleftarrow K_r,\\
Z_r
&amp;amp;=U_r-\overleftarrow W_rS_r,\\
O_r
&amp;amp;=\overleftarrow Q_rS_r
  +(Q_rK_r^{\mathsf T}\odot\Gamma_{C,r})Z_r,\\
S_{r+1}
&amp;amp;=\lambda_r[1:C]S_r+\overrightarrow K_r^{\mathsf T}Z_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
  &lt;&#x2F;div&gt;
&lt;&#x2F;details&gt;
&lt;h2 id=&quot;gated-delta-product-gdp&quot;&gt;Gated Delta Product (GDP)&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2502.10297&quot;&gt;Gated Delta Product (GDP)&lt;&#x2F;a&gt; replaces GDN&#x27;s single generalized Householder transition per token with an ordered product of $n_h$ transitions.&lt;&#x2F;p&gt;
&lt;p&gt;Each transition has its own key, value, and correction gate, all projected from the same input token. The transitions act along different learned key directions, increasing computation and expressiveness without changing the shape of $S_t$.&lt;&#x2F;p&gt;
&lt;p&gt;For substep $j$, define&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$A_{t,j}:=I-\beta_{t,j}k_{t,j}^{\mathsf T}k_{t,j},
\qquad
X_{t,j}:=\beta_{t,j}k_{t,j}^{\mathsf T}v_{t,j}.$$
&lt;&#x2F;div&gt;
&lt;p&gt;For example, with $n_h=3$, the token update is&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
S_{t,0}
&amp;amp;=a_tS_{t-1},\\
S_{t,1}
&amp;amp;=A_{t,1}S_{t,0}+X_{t,1},\\
S_{t,2}
&amp;amp;=A_{t,2}S_{t,1}+X_{t,2},\\
S_{t,3}
&amp;amp;=A_{t,3}S_{t,2}+X_{t,3},\\
S_t
&amp;amp;:=S_{t,3},
\qquad
o_t=q_tS_t.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;The decay $a_t$ is applied before the first substep, so the previous state decays only once. The query reads the state only after all three updates have finished.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;gdp-as-gdn-over-a-virtual-sequence&quot;&gt;GDP as GDN over a virtual sequence&lt;&#x2F;h3&gt;
&lt;p&gt;GDP can be written as an ordinary GDN recurrence over a longer sequence. Treat its $n_h$ substeps as consecutive positions in that sequence. We call the original positions &lt;strong&gt;real tokens&lt;&#x2F;strong&gt; and the expanded positions &lt;strong&gt;virtual steps&lt;&#x2F;strong&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;For $n_h=3$, one real token expands into three virtual steps. Two real tokens therefore become six:&lt;&#x2F;p&gt;
&lt;div class=&quot;gdp-table-wrap&quot;&gt;
&lt;table class=&quot;gdp-table&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;&lt;&#x2F;th&gt;&lt;th colspan=&quot;3&quot; class=&quot;token-end&quot;&gt;real token $t=1$&lt;&#x2F;th&gt;&lt;th colspan=&quot;3&quot;&gt;real token $t=2$&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;virtual step $m$&lt;&#x2F;th&gt;&lt;td&gt;1&lt;&#x2F;td&gt;&lt;td&gt;2&lt;&#x2F;td&gt;&lt;td class=&quot;token-end&quot;&gt;3&lt;&#x2F;td&gt;&lt;td&gt;4&lt;&#x2F;td&gt;&lt;td&gt;5&lt;&#x2F;td&gt;&lt;td&gt;6&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;th&gt;substep $(t,j)$&lt;&#x2F;th&gt;&lt;td&gt;$(1,1)$&lt;&#x2F;td&gt;&lt;td&gt;$(1,2)$&lt;&#x2F;td&gt;&lt;td class=&quot;token-end&quot;&gt;$(1,3)$&lt;&#x2F;td&gt;&lt;td&gt;$(2,1)$&lt;&#x2F;td&gt;&lt;td&gt;$(2,2)$&lt;&#x2F;td&gt;&lt;td&gt;$(2,3)$&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;th&gt;&lt;span class=&quot;k&quot;&gt;$\tilde k_m$&lt;&#x2F;span&gt;&lt;&#x2F;th&gt;&lt;td&gt;$k_{1,1}$&lt;&#x2F;td&gt;&lt;td&gt;$k_{1,2}$&lt;&#x2F;td&gt;&lt;td class=&quot;token-end&quot;&gt;$k_{1,3}$&lt;&#x2F;td&gt;&lt;td&gt;$k_{2,1}$&lt;&#x2F;td&gt;&lt;td&gt;$k_{2,2}$&lt;&#x2F;td&gt;&lt;td&gt;$k_{2,3}$&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;th&gt;&lt;span class=&quot;v&quot;&gt;$\tilde v_m$&lt;&#x2F;span&gt;&lt;&#x2F;th&gt;&lt;td&gt;$v_{1,1}$&lt;&#x2F;td&gt;&lt;td&gt;$v_{1,2}$&lt;&#x2F;td&gt;&lt;td class=&quot;token-end&quot;&gt;$v_{1,3}$&lt;&#x2F;td&gt;&lt;td&gt;$v_{2,1}$&lt;&#x2F;td&gt;&lt;td&gt;$v_{2,2}$&lt;&#x2F;td&gt;&lt;td&gt;$v_{2,3}$&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;th&gt;&lt;span class=&quot;bt&quot;&gt;$\tilde\beta_m$&lt;&#x2F;span&gt;&lt;&#x2F;th&gt;&lt;td&gt;$\beta_{1,1}$&lt;&#x2F;td&gt;&lt;td&gt;$\beta_{1,2}$&lt;&#x2F;td&gt;&lt;td class=&quot;token-end&quot;&gt;$\beta_{1,3}$&lt;&#x2F;td&gt;&lt;td&gt;$\beta_{2,1}$&lt;&#x2F;td&gt;&lt;td&gt;$\beta_{2,2}$&lt;&#x2F;td&gt;&lt;td&gt;$\beta_{2,3}$&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;th&gt;&lt;span class=&quot;g&quot;&gt;$\tilde a_m$&lt;&#x2F;span&gt;&lt;&#x2F;th&gt;&lt;td&gt;$a_1$&lt;&#x2F;td&gt;&lt;td&gt;1&lt;&#x2F;td&gt;&lt;td class=&quot;token-end&quot;&gt;1&lt;&#x2F;td&gt;&lt;td&gt;$a_2$&lt;&#x2F;td&gt;&lt;td&gt;1&lt;&#x2F;td&gt;&lt;td&gt;1&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;th&gt;&lt;span class=&quot;q&quot;&gt;$\tilde q_m$&lt;&#x2F;span&gt;&lt;&#x2F;th&gt;&lt;td&gt;0&lt;&#x2F;td&gt;&lt;td&gt;0&lt;&#x2F;td&gt;&lt;td class=&quot;token-end&quot;&gt;$q_1$&lt;&#x2F;td&gt;&lt;td&gt;0&lt;&#x2F;td&gt;&lt;td&gt;0&lt;&#x2F;td&gt;&lt;td&gt;$q_2$&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr class=&quot;keep-row&quot;&gt;&lt;th&gt;retained output&lt;&#x2F;th&gt;&lt;td&gt;—&lt;&#x2F;td&gt;&lt;td&gt;—&lt;&#x2F;td&gt;&lt;td class=&quot;token-end&quot;&gt;$o_1$&lt;&#x2F;td&gt;&lt;td&gt;—&lt;&#x2F;td&gt;&lt;td&gt;—&lt;&#x2F;td&gt;&lt;td&gt;$o_2$&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;
&lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;The decay appears at the first virtual step of each real token; the remaining steps use $1$. The query appears at the last virtual step; the earlier steps use zero queries because they do not produce outputs.&lt;&#x2F;p&gt;
&lt;p&gt;To write this construction generally, flatten token $t$ and substep $j$ into&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$m=n_h(t-1)+j.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Map the GDP inputs to this virtual sequence by setting&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
(\tilde k_m,\tilde v_m,\tilde\beta_m)
&amp;amp;=(k_{t,j},v_{t,j},\beta_{t,j}),\\
\tilde a_m
&amp;amp;=
\begin{cases}
a_t,&amp;amp;j=1,\\
1,&amp;amp;j&amp;gt;1,
\end{cases}\\
\tilde q_m
&amp;amp;=
\begin{cases}
q_t,&amp;amp;j=n_h,\\
0,&amp;amp;j&amp;lt;n_h.
\end{cases}
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Every virtual step then follows the GDN recurrence:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
\tilde S_m
&amp;amp;=\tilde a_m
  (I-\tilde\beta_m\tilde k_m^{\mathsf T}\tilde k_m)\tilde S_{m-1}
  +\tilde\beta_m\tilde k_m^{\mathsf T}\tilde v_m,\\
S_t
&amp;amp;=\tilde S_{tn_h},
\qquad
o_t=\tilde q_{tn_h}\tilde S_{tn_h}.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Flattening preserves the update order. We can therefore run the GDN chunkwise algorithm on a virtual sequence of length $nn_h$ and retain every $n_h$-th output. Only the sequence becomes longer; the recurrent state keeps the same shape.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;gated-linear-attention-gla&quot;&gt;Gated Linear Attention (GLA)&lt;&#x2F;h2&gt;
&lt;p&gt;Mamba-2 lets each token choose how much of the previous state survives, but its gate is scalar:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t=a_tS_{t-1}+k_t^{\mathsf T}v_t.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The same $a_t$ scales every row of $S_{t-1}$. It can shorten or extend the lifetime of the memory as a whole, but it cannot preserve one channel while rapidly forgetting another.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2312.06635&quot;&gt;Gated Linear Attention (GLA)&lt;&#x2F;a&gt; replaces the scalar gate with a vector&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\boldsymbol a_t=(a_{t,1},\ldots,a_{t,d})\in(0,1)^d,$$
&lt;&#x2F;div&gt;
&lt;p&gt;and uses the recurrence&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$S_t=\operatorname{Diag}(\boldsymbol a_t)S_{t-1}+k_t^{\mathsf T}v_t,
\qquad
o_t=q_tS_t.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The two gates scale the same state differently:&lt;&#x2F;p&gt;
&lt;div
  id=&quot;gla-gate-compare&quot;
  class=&quot;gla-gate-compare&quot;
  aria-label=&quot;Comparison of scalar state decay in Mamba-2 and channelwise state decay in GLA&quot;
&gt;&lt;&#x2F;div&gt;
&lt;p&gt;GLA therefore gives each channel its own forgetting rate.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;chunkwise-form-2&quot;&gt;Chunkwise form&lt;&#x2F;h3&gt;
&lt;p&gt;Multiplying diagonal decay matrices is equivalent to multiplying their diagonal vectors elementwise:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\operatorname{Diag}(\boldsymbol a_{r,i})
\cdots
\operatorname{Diag}(\boldsymbol a_{r,j})
=
\operatorname{Diag}\left(
\boldsymbol a_{r,i}\odot\cdots\odot\boldsymbol a_{r,j}
\right).$$
&lt;&#x2F;div&gt;
&lt;p&gt;We therefore replace Mamba-2&#x27;s scalar prefix product with a vector prefix product. Within chunk $r$, define&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\boldsymbol\lambda_r[i:j]
:=\bigodot_{s=i}^{j}\boldsymbol a_{r,s},
\qquad
\boldsymbol\lambda_r[i:j]=\boldsymbol 1\ \text{when }i&amp;gt;j.$$
&lt;&#x2F;div&gt;
&lt;p&gt;Here, $\bigodot$ denotes a repeated Hadamard (elementwise) product.&lt;&#x2F;p&gt;
&lt;p&gt;After a write enters the state, later tokens decay each of its channels independently:&lt;&#x2F;p&gt;
&lt;div
  id=&quot;gla-channel-decay&quot;
  class=&quot;gla-channel-decay&quot;
  aria-label=&quot;One state write decaying at different rates across three channels&quot;
&gt;&lt;&#x2F;div&gt;
&lt;p&gt;&lt;strong&gt;Incoming state.&lt;&#x2F;strong&gt; The incoming state reaches local position $\ell$ through $\boldsymbol\lambda_r[1:\ell]$. Stack these vectors and absorb them into $Q_r$:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\overleftarrow q_{r,\ell}
:=
\boldsymbol\lambda_r[1:\ell]\odot q_{r,\ell},
\qquad
\overleftarrow Q_r
:=
\begin{bmatrix}
\boldsymbol\lambda_r[1:1]\\
\boldsymbol\lambda_r[1:2]\\
\vdots\\
\boldsymbol\lambda_r[1:C]
\end{bmatrix}
\odot Q_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;&lt;strong&gt;Local writes.&lt;&#x2F;strong&gt; A write at position $m$ reaches position $\ell$ through $\boldsymbol\lambda_r[m+1:\ell]$. Its local score is therefore&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$A_r[\ell,m]
=
\begin{cases}
q_{r,\ell}
\bigl(\boldsymbol\lambda_r[m+1:\ell]\odot k_{r,m}\bigr)^{\mathsf T},
&amp;amp;m\le\ell,\\
0,&amp;amp;m&amp;gt;\ell.
\end{cases}$$
&lt;&#x2F;div&gt;
&lt;p&gt;For the state update, absorb the decay from each write to the right boundary into its key:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\overrightarrow k_{r,\ell}
:=\boldsymbol\lambda_r[\ell+1:C]\odot k_{r,\ell},
\qquad
\overrightarrow K_r
:=
\begin{bmatrix}
\boldsymbol\lambda_r[2:C]\\
\boldsymbol\lambda_r[3:C]\\
\vdots\\
\boldsymbol\lambda_r[C+1:C]
\end{bmatrix}
\odot K_r.$$
&lt;&#x2F;div&gt;
&lt;p&gt;The complete chunkwise equations are&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
O_r
&amp;amp;=\overleftarrow Q_rS_r+A_rV_r,\\
S_{r+1}
&amp;amp;=\operatorname{Diag}\bigl(\boldsymbol\lambda_r[1:C]\bigr)S_r
  +\overrightarrow K_r^{\mathsf T}V_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;h2 id=&quot;kimi-delta-attention-kda&quot;&gt;Kimi Delta Attention (KDA)&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2510.26692&quot;&gt;Kimi Delta Attention (KDA)&lt;&#x2F;a&gt; adds GLA&#x27;s channelwise decay to GDN&#x27;s delta rule:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
S_t
&amp;amp;=(I-\beta_tk_t^{\mathsf T}k_t)
  \operatorname{Diag}(\boldsymbol a_t)S_{t-1}
  +\beta_tk_t^{\mathsf T}v_t\\
&amp;amp;=\operatorname{Diag}(\boldsymbol a_t)S_{t-1}
  +\beta_tk_t^{\mathsf T}
   \left(
   v_t-k_t\operatorname{Diag}(\boldsymbol a_t)S_{t-1}
   \right),\\
o_t&amp;amp;=q_tS_t.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;KDA first decays the state channel by channel, then applies the delta correction. If $\boldsymbol a_t=a_t\boldsymbol 1$, it reduces exactly to GDN.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;reuse-gla-and-gdn&quot;&gt;Reuse GLA and GDN&lt;&#x2F;h3&gt;
&lt;p&gt;The GLA and GDN sections give most of the chunkwise algorithm. GLA gives the decayed matrices $\overleftarrow Q_r$ and $\overrightarrow K_r$, together with the local score matrix $A_r$. GDN shows that the delta rule replaces the value rows $V_r$ with correction rows $Z_r$. Therefore,&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
O_r
&amp;amp;=\overleftarrow Q_rS_r+A_rZ_r,\\
S_{r+1}
&amp;amp;=\operatorname{Diag}\bigl(\boldsymbol\lambda_r[1:C]\bigr)S_r
  +\overrightarrow K_r^{\mathsf T}Z_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;It remains to compute $Z_r$. KDA reuses GDN&#x27;s correction solve but replaces scalar decay with channelwise decay. In this solve, decay appears in two quantities: $L_r$ and $\overleftarrow K_r$.&lt;&#x2F;p&gt;
&lt;aside class=&quot;note-card&quot;&gt;
  &lt;div class=&quot;note-card-title&quot;&gt;Recap: GDN correction solve&lt;&#x2F;div&gt;
  &lt;div class=&quot;note-card-body&quot;&gt;&lt;p&gt;With scalar decay, GDN defines&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
\overleftarrow k_{r,\ell}
&amp;amp;:=\lambda_r[1:\ell]k_{r,\ell},\\
L_r[\ell,m]
&amp;amp;:=
\begin{cases}
\lambda_r[m+1:\ell]
\bigl(k_{r,\ell}k_{r,m}^{\mathsf T}\bigr),&amp;amp;m&amp;lt;\ell,\\
0,&amp;amp;m\ge\ell.
\end{cases}
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;These quantities enter the triangular correction solve:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
(I+B_rL_r)T_r&amp;amp;=B_r,&amp;amp;
U_r&amp;amp;=T_rV_r,\\
\overleftarrow W_r&amp;amp;=T_r\overleftarrow K_r,&amp;amp;
Z_r&amp;amp;=U_r-\overleftarrow W_rS_r.
\end{aligned}$$
&lt;&#x2F;div&gt;&lt;&#x2F;div&gt;
&lt;&#x2F;aside&gt;
&lt;p&gt;KDA keeps this structure and replaces the scalar decay products with channelwise products:&lt;&#x2F;p&gt;
&lt;div class=&quot;ttt-table-wrap&quot;&gt;
  &lt;table class=&quot;ttt-table kda-gdn-table&quot;&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Quantity&lt;&#x2F;th&gt;
        &lt;th&gt;GDN: scalar decay&lt;&#x2F;th&gt;
        &lt;th&gt;KDA: channelwise decay&lt;&#x2F;th&gt;
      &lt;&#x2F;tr&gt;
    &lt;&#x2F;thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Decay from $i$ through $j$&lt;&#x2F;td&gt;
        &lt;td&gt;$\lambda_r[i:j]=\prod_{s=i}^{j}a_{r,s}$&lt;&#x2F;td&gt;
        &lt;td&gt;$\boldsymbol\lambda_r[i:j]=\bigodot_{s=i}^{j}\boldsymbol a_{r,s}$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Incoming prediction key&lt;&#x2F;td&gt;
        &lt;td&gt;$\overleftarrow k_{r,\ell}=\lambda_r[1:\ell]k_{r,\ell}$&lt;&#x2F;td&gt;
        &lt;td&gt;$\overleftarrow k_{r,\ell}=\boldsymbol\lambda_r[1:\ell]\odot k_{r,\ell}$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
      &lt;tr&gt;
        &lt;td&gt;$L_r[\ell,m]$ for $m&lt;\ell$&lt;&#x2F;td&gt;
        &lt;td&gt;$\lambda_r[m+1:\ell](k_{r,\ell}k_{r,m}^{\mathsf T})$&lt;&#x2F;td&gt;
        &lt;td&gt;$k_{r,\ell}\bigl(\boldsymbol\lambda_r[m+1:\ell]\odot k_{r,m}\bigr)^{\mathsf T}$&lt;&#x2F;td&gt;
      &lt;&#x2F;tr&gt;
    &lt;&#x2F;tbody&gt;
  &lt;&#x2F;table&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;Using the new $L_r$ and $\overleftarrow K_r$, reuse GDN&#x27;s triangular transform. Let $B_r:=\operatorname{diag}(\beta_{r,1},\ldots,\beta_{r,C})$. Then&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
(I+B_rL_r)T_r
&amp;amp;=B_r,\\
U_r
&amp;amp;=T_rV_r,\\
\overleftarrow W_r
&amp;amp;=T_r\overleftarrow K_r,\\
Z_r
&amp;amp;=U_r-\overleftarrow W_rS_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;details class=&quot;algorithm-fold&quot;&gt;
  &lt;summary&gt;Complete per-chunk algorithm&lt;&#x2F;summary&gt;
  &lt;div class=&quot;algorithm-fold-body&quot;&gt;
    &lt;p&gt;For each chunk $r$, define the channelwise decay products and correction gate:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
\boldsymbol\lambda_r[i:j]
&amp;amp;:=\bigodot_{s=i}^{j}\boldsymbol a_{r,s},
\qquad
\boldsymbol\lambda_r[i:j]=\boldsymbol 1\ \text{when }i&amp;gt;j,\\
B_r
&amp;amp;:=\operatorname{diag}(\beta_{r,1},\ldots,\beta_{r,C}).
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
\overleftarrow q_{r,\ell}
&amp;amp;:=\boldsymbol\lambda_r[1:\ell]\odot q_{r,\ell},&amp;amp;
\overleftarrow k_{r,\ell}
&amp;amp;:=\boldsymbol\lambda_r[1:\ell]\odot k_{r,\ell},&amp;amp;
\overrightarrow k_{r,\ell}
&amp;amp;:=\boldsymbol\lambda_r[\ell+1:C]\odot k_{r,\ell}.
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;p&gt;Stack the transformed rows into $\overleftarrow Q_r$, $\overleftarrow K_r$, and $\overrightarrow K_r$. Define the two causal within-chunk matrices:&lt;&#x2F;p&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
A_r[\ell,m]
&amp;amp;:=
\begin{cases}
q_{r,\ell}
\bigl(\boldsymbol\lambda_r[m+1:\ell]\odot k_{r,m}\bigr)^{\mathsf T},
&amp;amp;m\le\ell,\\
0,&amp;amp;m&amp;gt;\ell,
\end{cases}\\
L_r[\ell,m]
&amp;amp;:=
\begin{cases}
k_{r,\ell}
\bigl(\boldsymbol\lambda_r[m+1:\ell]\odot k_{r,m}\bigr)^{\mathsf T},
&amp;amp;m&amp;lt;\ell,\\
0,&amp;amp;m\ge\ell.
\end{cases}
\end{aligned}$$
&lt;&#x2F;div&gt;
&lt;div class=&quot;eqn&quot;&gt;
  $$\begin{aligned}
(I+B_rL_r)T_r
&amp;amp;=B_r,\\
U_r
&amp;amp;=T_rV_r,\\
\overleftarrow W_r
&amp;amp;=T_r\overleftarrow K_r,\\
Z_r
&amp;amp;=U_r-\overleftarrow W_rS_r,\\
O_r
&amp;amp;=\overleftarrow Q_rS_r+A_rZ_r,\\
S_{r+1}
&amp;amp;=\operatorname{Diag}\bigl(\boldsymbol\lambda_r[1:C]\bigr)S_r
  +\overrightarrow K_r^{\mathsf T}Z_r.
\end{aligned}$$
&lt;&#x2F;div&gt;
  &lt;&#x2F;div&gt;
&lt;&#x2F;details&gt;
&lt;h2 id=&quot;sources-and-further-reading&quot;&gt;Sources and further reading&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;related-papers&quot;&gt;Related papers&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2006.16236&quot;&gt;&lt;em&gt;Transformers are RNNs&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2307.08621&quot;&gt;&lt;em&gt;RetNet&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2312.06635&quot;&gt;&lt;em&gt;Gated Linear Attention (GLA)&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2405.21060&quot;&gt;&lt;em&gt;Mamba-2 &#x2F; SSD&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2406.06484&quot;&gt;&lt;em&gt;DeltaNet&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2412.06464&quot;&gt;&lt;em&gt;Gated DeltaNet (GDN)&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2502.10297&quot;&gt;&lt;em&gt;DeltaProduct (GDP)&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;, and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2510.26692&quot;&gt;&lt;em&gt;Kimi Linear &#x2F; Kimi Delta Attention (KDA)&lt;&#x2F;em&gt;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;blogs&quot;&gt;Blogs&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;Tri Dao&#x27;s &lt;em&gt;State Space Duality (Mamba-2)&lt;&#x2F;em&gt; series: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tridao.me&#x2F;blog&#x2F;2024&#x2F;mamba2-part1-model&#x2F;&quot;&gt;Part I&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tridao.me&#x2F;blog&#x2F;2024&#x2F;mamba2-part2-theory&#x2F;&quot;&gt;Part II&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tridao.me&#x2F;blog&#x2F;2024&#x2F;mamba2-part3-algorithm&#x2F;&quot;&gt;Part III&lt;&#x2F;a&gt;, and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tridao.me&#x2F;blog&#x2F;2024&#x2F;mamba2-part4-systems&#x2F;&quot;&gt;Part IV&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Songlin Yang&#x27;s &lt;em&gt;DeltaNet Explained&lt;&#x2F;em&gt; series: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sustcsonglin.github.io&#x2F;blog&#x2F;2024&#x2F;deltanet-1&#x2F;&quot;&gt;Part I&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sustcsonglin.github.io&#x2F;blog&#x2F;2024&#x2F;deltanet-2&#x2F;&quot;&gt;Part II&lt;&#x2F;a&gt;, and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sustcsonglin.github.io&#x2F;blog&#x2F;2024&#x2F;deltanet-3&#x2F;&quot;&gt;Part III&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Jianlin Su&#x27;s &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kexue.fm&#x2F;archives&#x2F;11033&quot;&gt;&lt;em&gt;《线性注意力简史：从模仿、创新到反哺》&lt;&#x2F;em&gt;&lt;&#x2F;a&gt; &lt;em&gt;(in Chinese)&lt;&#x2F;em&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
</feed>
