# Stable GDN-2: How Symmetric Erasure Fixes a Hidden Training Failure in Linear Attention

> Source: <https://dev.to/prabhakar_chaudhary_7afe4/stable-gdn-2-how-symmetric-erasure-fixes-a-hidden-training-failure-in-linear-attention-2pen>
> Published: 2026-11-27 17:04:03+00:00

**Recommendation:** If you train linear attention models like GDN-2, align the erase and read directions with a symmetric rank-1 erase operator to prevent silent recurrent-state blowup mid-run.
More in the playbook "Fine-tuning and data": <https://wpnews.pro/playbooks/training-data>

Linear attention models have been gaining traction as a practical alternative to standard transformers for long-context tasks. They promise linear-time inference and constant-memory recurrent computation — properties that matter a lot when you're processing sequences of tens or hundreds of thousands of tokens. But a paper published this week on arXiv reveals that one of the most capable linear attention architectures, Gated DeltaNet-2 (GDN-2), carries a subtle flaw that causes training to silently collapse — and proposes a clean fix.

The paper is [Stable Gated DeltaNet-2: Understanding and Mitigating Recurrent State Instability](https://arxiv.org/abs/2611.34051), and it's worth understanding both the problem and the solution in detail.

DeltaNet is a family of linear attention models that use a delta rule for memory updates: rather than simply adding new information to a recurrent state, the model first erases a portion of what's already there, then writes new content. This erase-then-write pattern gives the model more expressive control over its memory than simpler linear attention variants.

Gated DeltaNet-2 (GDN-2) extended this idea by introducing independent channel-wise gates for the erase and write operations. The intuition is sound: decoupling the two operations lets the model learn different policies for forgetting and remembering, which improves in-context retrieval and state-update expressiveness. GDN-2 showed strong results on standard benchmarks and became a component in several hybrid architectures, including [MemT-1.0](https://huggingface.co/papers?q=MemT-1.0) and [Qwen3.8-27B](https://huggingface.co/papers?q=Qwen3.8-27B).

The instability the authors discovered is rooted in a geometric mismatch. In GDN-2, the erase gate operates on a key vector that has been modified by the gate, but the modification itself happens along the original, unmodified key direction. These two directions are not aligned.

This misalignment creates what the authors call a *non-normal* erase operator — a matrix whose transpose is not its inverse. Non-normal matrices can amplify certain directions in the state even when their spectral norm is bounded. In practice, this means the recurrent state can grow exponentially across tokens, even when no new information is being written. The state doesn't need to receive bad inputs to blow up; it can do so on its own.

The authors found this wasn't a theoretical edge case. In their experiments, the original GDN-2 baseline failed in **3 of 8 pretraining runs** and **4 of 8 post-training runs** with NaN errors. In one traced run, the recurrent state overflowed at token 52,736 — mid-sequence, during what looked like normal training. The state values exceeded $10^{36}$ before the run crashed.

This kind of failure is particularly insidious because it doesn't always appear immediately. A model can train stably for thousands of steps before the accumulated directional gain in the recurrent state crosses a numerical threshold.

Stable GDN-2 addresses the instability with two modifications that work together.

The core fix is to make the erase operator symmetric. Instead of erasing along the original key direction while reading along a gated key direction, the authors define a unified vector $\mathbf{u}_t = \sqrt{\mathbf{b}_t} \odot \mathbf{k}_t$ and construct the erase operator as:

$$\mathbf{A}_t^{\text{sym}} = \mathbf{I} - \mathbf{u}_t \mathbf{u}_t^\top$$

This is a rank-1 update to the identity — a Householder-style reflection. Because reading and modification now happen along the same direction, the operator is symmetric, and symmetric matrices are always normal. The authors prove that this guarantees $|\mathbf{A}_t^{\text{sym}}|_2 \leq 1$, bounding state propagation to be non-expansive. The theoretical result is an $O(\sqrt{T})$ upper bound on recurrent state growth across a sequence of length $T$.

Symmetric erasure solves the stability problem but introduces a new constraint: the erase and write directions are now coupled, which reduces the model's flexibility in channels where the erase gate is small. To recover that flexibility, the authors add a residual writing path:

$$\mathbf{r}_t = \sqrt{1 - \mathbf{d}_t^2} \odot (\mathbf{k}_t - \mathbf{u}_t)$$

This path is modulated by the decay factor $\mathbf{d}_t$, which controls how much energy the residual write can inject into the state. When the erase gate is small (meaning the model wants to preserve existing state), the residual path can still write new information without destabilizing the recurrent dynamics.

Crucially, both modifications are compatible with chunkwise parallel computation — the standard technique for training linear attention models efficiently on GPUs. The fix doesn't require switching to a slower training regime.

The authors evaluated Stable GDN-2 on approximately 1.6B parameter models pretrained on sequences up to 64K tokens.

**In the recurrent setting** (pure linear attention, no full-attention layers), Stable GDN-2 improved the average [RULER](https://arxiv.org/abs/2404.06654) score at 128K context by **6.80 points** compared to the original GDN-2 baseline. RULER is a suite of long-context retrieval tasks that stress-tests a model's ability to locate and use information from distant positions in the sequence.

**In the hybrid setting** (a 3:1 ratio of linear to full-attention layers, ~1.55B parameters), Stable GDN-2 achieved a **0.62-point improvement** in average accuracy across nine downstream tasks. The hybrid architecture is the more practically relevant configuration — most production deployments of linear attention models use a mix of linear and full-attention layers to balance efficiency and capability.

The stability improvement was categorical: Stable GDN-2 completed all training runs without NaN failures, while the original GDN-2 failed in the majority of long-context post-training runs.

If you're working with hybrid linear-attention architectures — or evaluating whether to adopt one — this paper surfaces a real operational risk. GDN-2 is used as a component in several open-weight models, and the failure mode it carries is not always visible during short-context training. A model that trains cleanly on 8K sequences may still fail when you extend context to 64K or 128K.

The fix is also instructive beyond GDN-2 specifically. The authors' analysis of non-normal operators as a source of training instability applies to any recurrent architecture where erase and write operations are decoupled. If you're designing a custom linear attention variant, checking whether your erase operator is normal — and whether its spectral norm is bounded — is now a concrete design criterion to add to your checklist.

The [paper](https://arxiv.org/abs/2611.34051) includes full proofs of the stability bounds and ablations comparing symmetric erasure alone versus the full Stable GDN-2 configuration. The [HuggingFace paper page](https://huggingface.co/papers/2611.34051) has community discussion and links to related work on linear attention stability.

Stable GDN-2 is a focused, technically precise contribution. It identifies a specific failure mode in a widely-used architecture, explains the geometric reason it occurs, and proposes a minimal fix that preserves the architecture's computational properties while eliminating the instability. The 6.80-point RULER improvement at 128K context is a meaningful gain, but the more important result is the one that's harder to put a number on: training runs that complete instead of crashing.

For anyone building or deploying long-context linear attention models, this paper is worth reading carefully before your next pretraining run.
