Manuscript Offprint

arXiv:2608.22354

SANE: State Anomaly Neutralization for Stable Extreme-Context Delta-Rule Models

Qingwen Lin, Boyan Xu, Xiao Liu, Zhifeng Hao, Ruichu Cai

Abstract

Delta-Rule recurrent models maintain a fixed-size state, enabling O(1)O(1) inference memory but potentially becoming unstable under extreme-context extrapolation. By tracking RWKV-7 over sequences of up to 100M tokens, we empirically identify a distinct failure pattern: localized norm explosion atop a relatively sparse substrate, rather than global state saturation. Analysis of the recurrent update suggests that persistent decay keeps weakly updated entries small, whereas uneven injections allow a few channels to accumulate extreme values. Motivated by this diagnosis, we propose State Anomaly Neutralization (SANE), which applies adaptive tanh compression at chunk boundaries while preserving the intrachunk parallel structure. Within a safe threshold range ( 3≤α≤53 \leq \alpha \leq 5), SANE matches the baseline on 11 short-context reasoning benchmarks with no statistically significant degradation. After a 100M-token prefix, which exceeds the training length by over 24,000×24,000\times, SANE retains functional reasoning (33.46–35.56) while the baseline encounters numerical overflow. In contrast, overly permissive thresholds ( α≥8\alpha \geq 8) remain numerically stable but lose reasoning capability entirely, showing that numerical stabilization alone does not guarantee functional reasoning and revealing a capacity–stability trade-off in state compression.

1 Introduction

In recent years, Delta-Rule-based recurrent models, including RWKV-7 (Peng et al., 2023, 2025, 2024), GDN (Yang et al., 2026; Cai et al., 2026), and KDA (Team et al., 2025; Zhang et al., 2026), have achieved competitive sequence modeling performance in large language models, establishing an important direction within linear recurrent architectures (Qu et al., 2024; Yang et al., 2025). Their shared principle is to replace the Transformer KV cache with a fixed-size recurrent state

Figure

mixed_chat - State Frobenius Norm

Figure 1: Extreme-context degradation of RWKV-7 on mixed_chat. Top: Local perplexity and its 50-token moving average. Bottom: State Frobenius norm, which eventually exhibits runaway growth beyond 101910^{19}.

matrix StS_{t}, commonly updated in the affine form St=St−1Mt+KtS_{t} = S_{t-1}M_{t} + K_{t}. Because the state size is independent of the processed sequence length L, these models require O(1)O(1) recurrent-state memory during inference. Moreover, unlike standard Transformers, they typically avoid explicit positional encodings and normalized softmax attention over the growing token history, and are therefore not directly subject to the same positional extrapolation and attention-distribution failures (Aguilar et al., 2026; Chen et al., 2025; Shang et al., 2025; Liu et al., 2025c). These properties make Delta-Rule models natural candidates for long-context extrapolation, but whether their fixed-size states remain stable at lengths orders of magnitude beyond training remains poorly understood.

  • Corresponding author

This structural potential does not automatically translate into stable extreme-context behavior. As shown in Figure 1, the perplexity of RWKV-7 progressively deteriorates beyond its training context, while the state norm eventually enters a runaway growth phase and exceeds 101910^{19} near 20M tokens, after which the model encounters numerical overflow. Increasing the training length may delay this failure, but scaling training by several orders of magnitude would incur prohibitive costs. Meanwhile, most existing extrapolation methods modify positional encodings or attention distributions (Chen et al., 2025; Shang et al., 2025; Huo, 2026; Rahman et al., 2025) and do not directly address instability in fixed-size recurrent states.

Because the recurrent state is the principal persistent carrier of information across token positions, we systematically examine its evolution under extreme extrapolation. A finer-grained visualization in Figure 2 reveals that the growth is highly non-uniform: within the training context, most state entries have magnitudes below 0.1, while a small fraction reach approximately 10–20; as the sequence grows, the low-magnitude background remains visible, whereas localized hotspots emerge and intensify by several orders of magnitude. We refer to this empirically observed magnitude separation as relative sparsity, which describes a low-magnitude background rather than exact zeros. The expansion of these localized anomalies coincides with the escalation of the global state norm and the degradation of perplexity. Analysis of the RWKV-7 update further suggests that repeated injections and transition-induced amplification can dominate state decay in a small number of directions. We therefore characterize the observed failure mode as localized norm explosion atop a relatively sparse substrate, rather than global state saturation.

Motivated by this diagnosis, we propose State Anomaly Neutralization (SANE), a lightweight intervention that suppresses localized anomalies while approximately preserving the low-magnitude background. SANE applies an adaptive element-wise transformation, S~=τtanh⁡(S/τ)\tilde{S} = \tau \tanh(S/\tau), to the terminal state of each chunk. The transformation is nearly identical for small ∣S∣/τ|S|/\tau but progressively compresses values approaching or exceeding the input-dependent threshold τ\tau. Applied only during inter-chunk state transfer, SANE prevents extreme values from being repeatedly carried forward while leaving the intra-chunk affine recurrence and associative-scan structure unchanged. It adds fewer than 0.1% parameters and imposes an adaptive element-wise cap at every chunk boundary.

We evaluate SANE on RWKV-7 (0.4B) as a proof of concept by introducing it into a pretrained checkpoint through supervised fine-tuning. Across 11 short-context mathematical reasoning benchmarks, SANE matches the baseline with no statistically significant difference for α≥3\alpha \geq 3 (43.30–44.23 vs. 43.88, all p≥0.154p \geq 0.154), while overly aggressive compression at α≤2\alpha \leq 2 impairs short-context performance ( p≤0.006p \leq 0.006). After a 100M-token prefix—over 24,000×24,000 \times the training context length—the baseline encounters numerical overflow, whereas SANE's average accuracy decreases monotonically with increasing α\alpha (Figure 6): within the safe regime ( α≤5\alpha \leq 5) it retains functional reasoning (33.46 at α=5\alpha=5), followed by a steep decline at α=6−7\alpha=6-7 (18.45 at α=7\alpha=7) and a complete collapse to near zero for α≥8\alpha \geq 8. In contrast, configurations with α≥8\alpha \geq 8 remain numerically stable but lose reasoning capability entirely, showing that numerical stabilization alone is insufficient and revealing a capacity-stability trade-off in state compression. In summary, the main contributions of this paper are as follows:

• We diagnose the state evolution of RWKV-7 under extreme extrapolation of up to 100M tokens and empirically identify localized norm explosion atop a relatively sparse substrate, together with a structural interpretation based on recurrent injection, amplification, and decay.

• We propose State Anomaly Neutralization (SANE), an adaptive chunk-boundary intervention that suppresses extreme state values while preserving the intra-chunk affine recurrence and parallel structure with fewer than 0.1% additional parameters.

• We show that SANE preserves short-context reasoning and retains functional accuracy after a 100M-token prefix, while contrasting threshold scales reveal that numerical stability does not necessarily imply functional health.

References (28)