LLM & Transformer Fundamentals·Question 67 of 109Advanced

Linear attention was written off for years. What do gated delta-rule layers like Gated DeltaNet change, and why are they showing up in hybrid models?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Gated delta-rule layers fix the reason linear attention lost: its memory could only accumulate, never overwrite or forget.

Full worked answer

Gated delta-rule layers fix the reason linear attention lost: its memory could only accumulate, never overwrite or forget.

Linear attention drops the softmax so attention becomes a running state: o_t = S_t q_t, with S_t = S_{t-1} + v_t k_t^T, a matrix accumulating key-value outer products. Memory per token is constant, there is no growing KV cache, and training still parallelises. But the update only adds. Every new pair is written on top of all earlier ones, so the fixed-size state fills with interference and recall degrades as context grows.

Two fixes, now combined:

  • Gating. Multiply the state by a data-dependent decay alpha_t between 0 and 1 each step: S_t = alpha_t S_{t-1} + v_t k_t^T. This is the Mamba-2 and GLA idea. The model can clear memory, but only by fading everything, not by targeting one entry.
  • The delta rule. Before writing, read what the state currently returns for this key, v_old = S_{t-1} k_t, and write only the correction: S_t = S_{t-1} + beta_t (v_t - v_old) k_t^T. That is one step of online gradient descent on the loss ||S k_t - v_t||^2, so the layer replaces the value bound to a key instead of stacking a second one on top. It directly targets the associative-recall weakness of earlier linear models.

Gated DeltaNet uses both: alpha_t for fast bulk forgetting, beta_t for precise edits. What made it practical is a chunkwise parallel algorithm, using a WY-style factorisation of the chained rank-one updates, so training runs as matrix multiplies on tensor cores rather than a slow sequential scan.

Where it shipped: Qwen3-Next interleaves Gated DeltaNet with full attention at about 3:1, and Kimi Linear's KDA refines it with finer-grained, per-channel gating. Full-attention layers stay because a fixed-size state is still lossy however clever the update; the hybrid gets exact retrieval from a few layers and near-constant memory from the rest.

The framing interviewers like: the delta rule turns a recurrent layer into a test-time learner, a fast-weight memory trained online during the forward pass. That links it to test-time training work and explains why the update rule, not the state size, became the design frontier.

What a good answer covers

  • Gated delta-rule layers fix the reason linear attention lost
  • Linear attention drops the softmax so attention becomes a running state
  • Memory per token is constant, there is no growing KV cache, and training still parallelises
  • Every new pair is written on top of all earlier ones, so the fixed-size state fills with interference…
  • Gating

Interviewer follow-ups to expect

  1. Show that the delta-rule update is one gradient step on ||S k - v||^2. Why does gating alone not fix associative recall?

  2. What does a recurrent state, rather than a KV cache, do to prefix caching in an agent workload?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep