DeltaLog: Deferred Materialization of Recurrent States for Linear Attention Decoding
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
DeltaLog: Deferred Materialization of Recurrent States for Linear Attention Decoding Junqing Lin
Jingwei Sun†
Guangzhong Sun
linjunqing@mail.ustc.edu.cn University of Science and Technology of China Hefei, China
sunjw@ustc.edu.cn University of Science and Technology of China Hefei, China
gzsun@ustc.edu.cn University of Science and Technology of China Hefei, China
attention, including IO-aware kernels such as FlashAttention [8, 9, 22] and serving systems that improve KV-cache management [15, 23, 36]. A complementary line of work modifies the attention operator itself. Rather than computing softmax attention between the current token and all preceding tokens, recurrent linearattention models [17, 25, 26, 30] maintain a fixed-size recurrent state that summarizes the prefix. During decoding, each step reads the previous state, applies an operator-specific transformation such as decay or gating, and incorporates the current token into the state. This update is compact, since it can be represented by two vectors instead of a full matrix. However, the state that must be carried to the next token is still a dense matrix. As a result, although recurrent linear attention avoids the context-length growth of the KV cache, it does not remove the cost of maintaining decode state. The bottleneck shifts from storing many token-level KV entries to repeatedly updating a dense recurrent state. This recurrent update pattern creates a mismatch between the logical update required by linear-attention models and the physical memory traffic performed by existing implementations [15, 33]. As shown in Figure 1, for batch size 𝐵 and 𝐻 attention heads, the compact per-token update contains only 𝑂 (𝐵𝐻 (𝑑𝑘 +𝑑 𝑣 )) values. In contrast, an eager implementation immediately materializes this update into the full recurrent state and writes back the dense [𝐵, 𝐻, 𝑑𝑘 , 𝑑 𝑣 ] tensor to highbandwidth memory (HBM). This touches 𝑂 (𝐵𝐻𝑑𝑘 𝑑 𝑣 ) state elements at every generated token, even though the actual information added by the token is much smaller. We refer
Linear attention models eliminate the quadratic prefix computation and context-growing KV cache of softmax attention by replacing pairwise token interactions with recurrent state updates. However, existing decoding implementations often materialize and write back the full recurrent state after every generated token, making state maintenance a major source of memory traffic, especially for models with large states and many heads. This paper presents DeltaLog, a recurrentstate decoding scheme that reduces this overhead without changing the model semantics. Specifically, DeltaLog represents the recurrent state as a dense base state together with a bounded log of recent compact updates. Most decode steps append only compact update factors to this log, while periodic merge steps fold the accumulated updates back into the dense base state. Thus, the model observes the same dense state as in eager decoding, but most full-state write-backs are replaced by lightweight append operations. We implement DeltaLog for GDN, KDA, and RWKV6 and integrate it into a prototype serving stack. Across these models, DeltaLog accelerates the recurrent-state update kernel by up to 1.86×, reduces profiled recurrent-state write traffic by up to 7.83×, and achieves 1.05–1.20× end-to-end serving speedups over dense recurrent baselines. Keywords: Recurrent Linear Attention, Autoregressive Decoding, Memory-Bandwidth Optimization
1
Introduction
Large language models (LLMs) have become central to many production services [3, 15, 35, 36]. However, as deployments scale, inference efficiency is increasingly limited by the softmax attention mechanism in Transformer-based LLMs [28], in which each token attends to all preceding tokens in the prefix. This design introduces two major efficiency bottlenecks. First, full-sequence attention requires quadratic token interactions, causing computational cost to grow rapidly with sequence length. Second, autoregressive decoding relies on a key-value (KV) cache to store previously computed keys and values, which can impose substantial GPU memory pressure when serving large batches or long sequences. These limitations have motivated systems optimizations for standard
COMPACT FACTORS
𝑑𝑘
arXiv:2608.15533v1 [cs.DC] 16 Aug 2026
Abstract
𝑎𝑡
⊗
EAGER DENSE COMMIT
𝑏𝑡⊤ 𝑑𝑣
WRITE AMPLIFICATION
𝑆𝑡 [𝐵, 𝐻, 𝑑𝑘 , 𝑑 𝑣 ]
𝑎𝑡 , 𝑏𝑡⊤ is specified compactly
Figure 1. The state-update tax. A token contributes compact factors with 𝑂 (𝐵𝐻 (𝑑𝑘 +𝑑 𝑣 )) values, but eager materialization writes back the full [𝐵, 𝐻, 𝑑𝑘 , 𝑑 𝑣 ] recurrent state, touching 𝑂 (𝐵𝐻𝑑𝑘 𝑑 𝑣 ) elements per token.
† Co-corresponding author
1
Junqing Lin, Jingwei Sun, and Guangzhong Sun
to this amplified per-token maintenance cost as the stateupdate tax. This cost arises from the chosen materialization policy rather than from the recurrence itself. This mismatch motivates a different execution strategy. Future decoding steps must observe the same logical state 𝑆𝑡 , but 𝑆𝑡 does not need to be stored as a freshly materialized dense tensor after every token. Instead, recent compact updates can remain deferred, as long as subsequent state reads incorporate them exactly. This paper proposes DeltaLog, a deferred materialization strategy for recurrent linear-attention decoding. Rather than eagerly materializing this state as a fully updated dense tensor after every step, DeltaLog decomposes the state into a dense base state that stores older history and a bounded update log that stores recent compact updates. Each log entry stores the compact factors needed to reconstruct a recent state update. As a result, most decoding steps only append a compact log entry while leaving the dense base unchanged. To bound replay overhead, DeltaLog periodically merges the accumulated log entries into the dense base. To implement DeltaLog efficiently on GPUs, we partition each head state along the value dimension. Each value tile stores the corresponding dense-base slice and value-side shard of the deferred update log, whereas the key-side component of each compact update is shared across value tiles and written only once per request–head. This layout exposes value-tile parallelism while avoiding redundant writes. DeltaLog changes only the physical schedule by which state updates are committed, without modifying the model weights or logical recurrence. In exact arithmetic, it is algebraically equivalent to eager dense-state updates. We evaluate DeltaLog with both decode kernels and a serving prototype. For one-token decoding across Gated DeltaNet (GDN) [30], Kimi Delta Attention (KDA) [26], and RWKV6 [17], DeltaLog reduces latency relative to Fast Linear Attention (FLA) [33], a highly optimized dense recurrentstate baseline, by 1.19–1.69× on H200 and 1.30–1.86× on RTX 4090. In the serving prototype, the gains are smaller but positive, reaching 1.08–1.20× on Qwen3.6-35B-A3B [20] and 1.05–1.12× on Kimi-Linear-48B-A3B-Instruct [26]. These results show that deferred recurrent-state write-back improves the targeted decode kernels and can translate into end-to-end serving benefits under the evaluated configurations. This paper makes the following contributions.
allowing most decoding steps to append compact factors rather than rewrite the full dense state. • We instantiate DeltaLog for one-token decoding in GDN, KDA, and RWKV6. Experiments show that our implementation preserves the original recurrence equations and improves decoding performance at the kernel level and in end-to-end prototype serving.
2
Background and Motivation
2.1
Recurrent Form of Linear Attention
Softmax attention evaluates each query against the keys and values of preceding tokens, requiring the processed prefix to remain available as a token-level KV history. Linear attention instead uses a factorized similarity function that allows key–value contributions to be aggregated before a query arrives [14]. Ignoring optional normalization, causal linear attention can be written as the recurrence 𝑆𝑡 = 𝑆𝑡 −1 + 𝜙 (𝑘𝑡 )𝑣𝑡⊤,
𝑜𝑡 = 𝜙 (𝑞𝑡 ) ⊤𝑆𝑡 ,
(1)
where 𝑆𝑡 aggregates the key–value interactions of the prefix through step 𝑡. Rather than retaining one key and value per preceding token, the recurrence carries a matrix state 𝑆𝑡 ∈ R𝑑𝑘 ×𝑑 𝑣 whose shape is independent of context length. Modern recurrent linear-attention models extend this basic additive recurrence with decay, gating, or delta-rule corrections [17, 25, 26, 30, 31]. For our systems analysis, these variants can be expressed by the same two operations: transforming the previous state and adding the outer product of two token-dependent vectors. Let 𝐷 (ℓ) = diag(exp(ℓ)) .
(2)
Absorbing any query feature map into 𝑞𝑡 , a recurrent decoding step can then be written as 𝑆𝑡 = 𝐷 (𝜆𝑡 )𝑆𝑡 −1 + 𝑎𝑡 𝑏𝑡⊤,
𝑜𝑡 = 𝜙 (𝑞𝑡 ) ⊤𝑆𝑡 ,
(3)
where 𝜆𝑡 ∈ R𝑑𝑘 is the per-step log-decay vector and 𝑎𝑡 ∈ R𝑑𝑘 and 𝑏𝑡 ∈ R𝑑 𝑣 form the token update. Thus, the carried state is Table 1. Representative recurrent formulations written in the components used by our systems analysis. The columns list the model-specific ingredients that instantiate Eq. 3.
Model
• We identify and characterize the state-update tax: the per-token overhead caused by eager dense recurrentstate materialization in large-batch recurrent linear attention serving.
Linear Attention RetNet GLA RWKV6 GDN KDA
• We propose DeltaLog, a deferred-materialization execution strategy for recurrent linear-attention decoding. DeltaLog represents the state as a dense base augmented with a bounded log of compact updates, 2
State Transform
Update Pair (𝑎𝑡 , 𝑏𝑡 )
Decay Form
𝑆𝑡 −1
(𝜙 (𝑘𝑡 ), 𝑣𝑡 )
none
𝛾𝑡 𝑆𝑡 −1 𝐷 (𝜆𝑡 )𝑆𝑡 −1 𝐷 (𝜆𝑡 )𝑆𝑡 −1 𝐷 (𝜆𝑡 )𝑆𝑡 −1 𝐷 (𝜆𝑡 )𝑆𝑡 −1
(𝑘𝑡 , 𝑣𝑡 ) (𝑘𝑡 , 𝑣𝑡 ) (𝑘𝑡 , 𝑣𝑡 ) (𝑘𝑡 , 𝛽𝑡 (𝑣𝑡 − 𝑘𝑡⊤𝑆𝑡 −1 )) (𝑘𝑡 , 𝛽𝑡 (𝑣𝑡 − 𝑘𝑡⊤𝑆𝑡 −1 ))
scalar diagonal diagonal scalar diagonal
DeltaLog
38.7
32.6
35.6
34.2
23.7
30
25.2
40 24.5
Latency share (%)
50
step, but it places a full-state read–modify–write operation on the critical path of every generated token. Thus, replacing a context-growing KV cache with a fixed-shape recurrent state changes the structure of decode-state traffic, but does not necessarily make that traffic inexpensive. The recurrence exposes an important asymmetry between the logical update and its eager physical realization. A new token contributes factors of total size 𝑂 (𝑑𝑘 +𝑑 𝑣 ), but immediately folding those factors into the state reads and writes 𝑂 (𝑑𝑘 𝑑 𝑣 ) elements. We call the memory traffic caused by this eager dense materialization the state-update tax. The term separates the cost of physically maintaining the recurrent state from the compact information introduced by the token itself. This tax scales with serving concurrency. For a batch of 𝐵 requests and 𝐻 heads, the runtime maintains a dense recurrent-state tensor of shape [𝐵, 𝐻, 𝑑𝑘 , 𝑑 𝑣 ], while the new token factors occupy only 𝑂 (𝐵𝐻 (𝑑𝑘 +𝑑 𝑣 )) elements. Increasing the batch exposes more parallel decode work, but also increases the dense state traffic incurred at every iteration. A fixed per-request state can therefore become a large aggregate bandwidth cost. To determine whether this cost remains visible beyond an isolated recurrent kernel, we measure its share of fullmodel decode latency in Qwen3.6-35B-A3B. Figure 2 shows a consistent concurrency trend across context lengths: for a 1k-token context, recurrent-state materialization grows from 25.2% of decode latency at 𝐵 = 64 to 44.6% at 𝐵 = 256. The corresponding shares at 2k and 4k contexts also rise monotonically with batch size. Eager state maintenance can therefore become a first-order serving bottleneck even though the recurrent state is independent of context length.
4k context 44.6
2k context
42.3
1k context
20 10 0 64
128
256
Serving batch size (𝐵 )
Figure 2. Recurrent-state materialization occupies a growing share of full-model decode latency.
a dense 𝑑𝑘 × 𝑑 𝑣 matrix, whereas each new token contributes an update represented by vectors of total size 𝑂 (𝑑𝑘 + 𝑑 𝑣 ). Table 1 shows how representative models instantiate this common form. Linear attention [14] applies no decay, RetNet [25] uses scalar decay, and GLA [31], RWKV6 [17], and KDA [26] use diagonal decay with different update semantics. Scalar decay is represented by sharing one value across the coordinates of 𝜆𝑡 , whereas diagonal decay uses a keywise vector. Delta-rule models, including DeltaNet [32] and GDN [30], additionally construct the value-side factor using the previous state. Eq. 3 therefore provides the common decode-time interface used in the remainder of our analysis. 2.2
Recurrent State in Autoregressive Decoding
LLM inference typically comprises two phases: prefill and decode [15, 36]. The prefill phase processes the input prompt in parallel and constructs the state required for subsequent generation. The decode phase then generates tokens autoregressively, with each step depending on the state produced by the previous step. As a result, decode latency is sensitive not only to per-token arithmetic cost, but also to how the recurrent state is stored, accessed, and updated across steps. In recurrent linear attention, prefill compresses the prompt into an initial recurrent state. During decode, each active request maintains one state slot per recurrent layer, instead of a token-level KV history. At step 𝑡, the decoder reads 𝑆𝑡 −1 , computes the output and token-specific update factors, and produces the logical state 𝑆𝑡 needed by the next step. Each state slot has a fixed shape independent of context length, but a serving batch must maintain and access these slots across all active requests and attention heads. 2.3
2.4
Why the State-Update Tax Is Memory-Bound
The measurements above are consistent with a bandwidth bottleneck. Eager materialization converts a compact logical update into a large physical memory transaction: for every generated token, the runtime reads the dense 𝑑𝑘 × 𝑑 𝑣 state from HBM, performs the state transition and compact update, and writes the entire result back. The amount of arithmetic and the amount of memory traffic both scale as 𝑂 (𝑑𝑘 𝑑 𝑣 ), but the update performs only a small constant amount of computation per state element. The roofline model [29] characterizes this imbalance via arithmetic intensity, defined as computation per byte moved. Retaining only the dominant dense-state read and write traffic yields
The State-Update Tax in Serving
AIdense =
Existing dense implementations typically materialize each state slot as a tensor and evaluate Eq. 3 eagerly [33, 37]. Given the compact factors 𝑎𝑡 and 𝑏𝑡 , they read the full state from HBM, apply the state transformation and outer-product update, and write the resulting dense state back to HBM. This design makes 𝑆𝑡 immediately available for the next decode
4𝑑𝑘 𝑑 𝑣 FLOPs = 0.5 FLOPs/byte 2 · 4𝑑𝑘 𝑑 𝑣 bytes
for a 32-bit state and approximately 1.0 FLOPs/byte for a 16bit state. This estimate deliberately excludes metadata traffic, output writes, vector loads, and model-specific additional arithmetic; it isolates the inherent cost of eagerly reading and writing the dense state. 3