The question: how do you let the forget gate see the memory state without destroying chunkwise parallelism — and how do you inspect what actually survived inside \(\mathbf{S}_t\)?
Prerequisites: M3, M4, M7 · Runtime: ~3 seconds on CPU.
In DM-1, every single gate — GDN’s \(\alpha_t\), KDA’s \(\mathbf{D}_t\), GDN-2’s \(\mathbf{b}_t, \mathbf{w}_t\), even Stable GDN-2’s symmetric erase — was state-blind: computed purely from the incoming token \(\mathbf{x}_t\) without ever looking at what is currently stored in \(\mathbf{S}_{t-1}\). The reason is hardware: if \(\alpha_t\) depends on \(\mathbf{S}_{t-1}\) at every token, you can no longer unroll a chunk of 64 tokens into parallel matrix multiplies.
This closing module of the Delta Memory track covers two late-2026 breakthroughs that open the black box of \(\mathbf{S}_t\): 1. SDG — State-Dependent Gating at Chunk Boundaries (Deng et al., Oct/Nov 2026): keep intra-chunk updates 100% state-blind and parallel, then compute an element-wise gate \(\boldsymbol\Lambda_{[n]}\) from the chunk memory change\(\Delta\mathbf{S}_{[n]}\) and apply it at the chunk boundary — proving it acts as an element-wise ridge proximal step. 2. How Linear Attention Remembers (Lee et al., Sep 2026): decompose any linear-attention state into the exact sum of every past token’s surviving contribution \(\mathbf{S}_t = \sum_{i=1}^t \mathbf{C}_i^{(t)}\), turning \(\mathbf{S}_t\) from an opaque matrix into an inspectable timeline.
Explain why token-level state-dependent gates break chunkwise parallel training, and why chunk-boundary gating preserves it completely.
Write SDG’s chunk-boundary update \(\mathbf{S}_{[n+1]}^+ = \boldsymbol\Lambda_{[n]} \odot \mathbf{S}_{[n+1]}^-\) where \(\boldsymbol\Lambda_{[n]}\) is computed from \(\Delta\mathbf{S}_{[n]} = \mathbf{S}_{[n+1]}^- - \mathbf{S}_{[n]}^+\), and explain its ridge-proximal interpretation.
Implement the exact per-token contribution decomposition \(\mathbf{S}_t = \sum_{i=1}^t \mathbf{C}_i^{(t)}\) from How Linear Attention Remembers and verify it to machine precision.
Identify the one blind spot SDG still leaves open: reacting to write changes\(\Delta\mathbf{S}_{[n]}\) is not the same as knowing which stored memories are read by queries.
Why it exists (the limitation it fixes)
With an input-only forget gate, the exact same token \(\mathbf{x}_t\) produces the exact same decay \(\alpha(\mathbf{x}_t)\) whether the memory is empty, half-full of critical facts, or overflowing with noise. Gated DeltaNet explicitly noted that it dropped \(\mathbf{S}_{t-1}\) dependence from \(\alpha_t\) solely to keep chunkwise parallel training fast.
SDG (Deng et al., Oct/Nov 2026) spots a clean middle ground. Chunkwise linear attention already splits a sequence into chunks of size \(C\) (typically 64 tokens) and passes the state sequentially across chunk boundaries:
Inside chunk \(n\) (parallel): run your favorite layer (GDN, KDA, GDN-2, or Mamba-3) unchanged to get the pre-gate state \(\mathbf{S}_{[n+1]}^-\).
At the chunk boundary (state-aware): measure how much the chunk changed the state, \(\Delta\mathbf{S}_{[n]} = \mathbf{S}_{[n+1]}^- - \mathbf{S}_{[n]}^+\), pass it through a tiny gating map to produce an element-wise gate \(\boldsymbol\Lambda_{[n]} \in (0, 1)^{d_v \times d_k}\), and shrink:
Because this runs once every \(C\) tokens instead of every token, intra-chunk parallelism is completely untouched.
Reading
SDG (Deng et al., Oct/Nov 2026): Eqs. 3–5, fused kernels for GDN/KDA/GDN-2/Mamba-3, and 1.3B / 100B-token improvements on LM, NIAH, RULER, and LongBench.
How Linear Attention Remembers (Lee et al., Sep 2026): Eqs. 1–5, exact linear-operator decomposition of GLA and GDN states.
1. Chunk-boundary state-dependent gating (SDG) in action
Let’s compare a state-blind scalar gate against a simple chunk-boundary SDG gate on a stream with bursty noise chunks: some chunks carry clean, low-drift signal; other chunks flood specific entries of \(\mathbf{S}\) with large noisy spikes (\(|\Delta S_{ij}|\) large). A state-blind gate has to shrink every entry equally; an element-wise boundary gate \(\Lambda_{ij} = 1 / (1 + \kappa |\Delta S_{ij}|)\) selectively damps the spiked entries while leaving quiet entries untouched!
Look at both panels: the state-blind scalar gate shrinks the quiet fact rows every chunk right alongside the noisy rows, eroding the stored fact (error → 0.90+). SDG sees that ΔS is near zero on the quiet rows (Λ ≈ 1.0) and huge on the noisy rows (Λ ≪ 1.0), so it damps the burst without touching the stored fact — all at the chunk boundary, with zero loss of intra-chunk parallelism.
2. Memory forensics: How Linear Attention Remembers
When a recurrent memory fails, how do you know which past token was erased, and which later token erased it?
How Linear Attention Remembers (Lee et al., Sep 2026) makes a deceptively simple observation. Any linear-attention recurrence has the affine form
where \(\mathcal{T}_t\) is a linear transition operator (for Gated DeltaNet, \(\mathcal{T}_t(\mathbf{S}) = \alpha_t \mathbf{S}(\mathbf{I} - \beta_t \mathbf{k}_t \mathbf{k}_t^\top)\)) and \(\mathbf{W}_t = \beta_t \mathbf{v}_t \mathbf{k}_t^\top\) is the fresh write at step \(t\). Because \(\mathcal{T}_t\) is linear, superposition holds exactly:
Every single past token \(i\)’s write \(\mathbf{W}_i\) has an exact, trackable footprint \(\mathbf{C}_i^{(t)}\) inside the current state \(\mathbf{S}_t\), and its readout contribution to query \(\mathbf{q}_t\) is simply \(\mathbf{C}_i^{(t)}\mathbf{q}_t\)!
Let’s implement this exact decomposition, assert that \(\sum_i \mathbf{C}_i^{(t)} = \mathbf{S}_t\) to machine precision, and plot the survival curves of individual writes under Gated DeltaNet — watching a revisited key get surgically erased while an orthogonal key survives.
torch.manual_seed(1)d =12T =25# Build an orthogonal pair of special keys: kA written at t=2 and OVERWRITTEN at t=14;# kB written at t=4 and never overwritten.Q_orth, _ = torch.linalg.qr(torch.randn(d, d))kA, kB = Q_orth[:, 0], Q_orth[:, 1]vA1, vA2, vB = F.normalize(torch.randn(d), dim=0), F.normalize(torch.randn(d), dim=0), F.normalize(torch.randn(d), dim=0)S = torch.zeros(d, d)contribs = [] # contribs[i] holds C_i^{(t)}surv_A1, surv_B = [], []for t inrange(T):if t ==2: k, v, alpha, beta = kA, vA1, 0.96, 1.0elif t ==4: k, v, alpha, beta = kB, vB, 0.96, 1.0elif t ==14: k, v, alpha, beta = kA, vA2, 0.96, 1.0# overwrite kA!else:# Distractors orthogonal to kA and kB coeff = torch.randn(d -2) k = F.normalize(Q_orth[:, 2:] @ coeff, dim=0) v = F.normalize(torch.randn(d), dim=0) *0.5 alpha, beta =0.96, 0.6# Transition operator T_t(X) = alpha * X @ (I - beta k k^T), write W_t = beta v k^T P = alpha * (torch.eye(d) - beta * torch.outer(k, k)) W = beta * torch.outer(v, k) S = S @ P + W contribs = [C @ P for C in contribs] contribs.append(W) surv_A1.append(contribs[2].norm().item() if t >=2else0.0) surv_B.append(contribs[4].norm().item() if t >=4else0.0)# Exact identity check: sum of surviving token contributions == S_Trecon_err = (sum(contribs) - S).norm().item()print(f"Exact decomposition check ||sum(C_i) - S_T||_F = {recon_err:.2e}")assert recon_err <1e-5print(f"At t=13 (before overwrite): ||C_A1|| = {surv_A1[13]:.3f}, ||C_B|| = {surv_B[13]:.3f}")print(f"At t=14 (after overwrite) : ||C_A1|| = {surv_A1[14]:.3f}, ||C_B|| = {surv_B[14]:.3f}")plt.figure(figsize=(6.8, 3.0))plt.plot(surv_A1, "o-", label="C_2 (kA=vA1, overwritten at t=14)", color="#c85a53", lw=2)plt.plot(surv_B, "s-", label="C_4 (kB=vB, untouched)", color="#1f6f66", lw=2)plt.axvline(14, ls="--", color="gray", alpha=0.7, label="overwrite kA at t=14")plt.xlabel("step t"); plt.ylabel("||C_i^(t)||_F (surviving write norm)")plt.title("How Linear Attention Remembers: exact per-token write survival")plt.legend(fontsize=8); plt.tight_layout(); plt.show()
The identity check passes to 1e-6, and the plot makes the memory’s internal life transparent: C_2 and C_4 decay gently at alpha=0.96 until step 14, when the delta write at kA drops ||C_2|| straight to 0.000 while leaving ||C_4|| completely untouched.
The open door this track ends on. Notice what SDG and How Linear Attention Remembers still do not solve: - SDG’s gate sees write activity (\(\Delta\mathbf{S}_{[n]}\)), not read utility (which stored directions queries actually use). - Every paper in this track (GDN, KDA, GDN-2, Stable GDN-2, KLA, OSDN, MesaNet, EDA, GSA2, Triadic, HOLA, SDG) evaluates single-sequence retrieval and zero of them measure proactive loss of plasticity — whether the memory still absorbs new writes cleanly after hundreds of episodes.
That is the exact question the sibling track Plasticity & Capacity takes up from scratch.
Honest scope. Our SDG demo uses a hand-written magnitude formula \(\Lambda = 1/(1+1.5|\Delta S|)\) rather than Deng et al.’s learned low-rank projection over \(\Delta\mathbf{S}_{[n]}\), and our forensic demo tracks orthogonal keys so the surgical drop is crisp. What this notebook settles is the exact mechanics of both ideas: chunk-boundary gating restores state awareness without losing intra-chunk parallelism, and affine superposition lets you trace every token’s exact survival inside \(\mathbf{S}_t\).
Exit check
Why does a token-level gate \(\alpha(\mathbf{S}_{t-1})\) break chunkwise parallel training, while SDG’s chunk-boundary gate \(\boldsymbol\Lambda(\Delta\mathbf{S}_{[n]})\) keeps it?
What optimization problem is element-wise multiplication \(\boldsymbol\Lambda \odot \mathbf{S}^-\) solving when \(\boldsymbol\Lambda\) is fixed?
Why does the exact decomposition \(\mathbf{S}_t = \sum_i \mathbf{C}_i^{(t)}\) hold for GDN and GLA — and would it still hold for a nonlinear MLP memory like Titans?
What information does SDG’s \(\Delta\mathbf{S}_{[n]}\)not observe that a lifelong memory needs in order to protect old, frequently used facts?