Switching Linear Attention
Summary
Switching Linear Attention (SwiLA) is a sequence layer from Stanford (Lee, Gonzalez, Zucchet, Buchanan, Fox, Linderman) that tries to close linear attention's expressivity gap while keeping its fixed-size recurrent state (no growing KV cache). Derived in the test-time regression framework, the state is a mixture of J linear regressors (state O(JD²)) fitted online by expectation–maximization: posterior responsibilities computed from each component's prediction error plus a learned gating prior weight a delta-rule update per component. Because each output dimension selects its component independently, the layer realizes J^D piecewise-linear maps and its recurrence is nonlinear in the state — unlike Mixture-of-Memories, whose router is state-independent. Variants add temporal persistence in the assignment prior (Temporal SwiLA) and input-dependent gating (Gated SwiLA). At 374M parameters pretrained on 15B FineWeb-Edu tokens with state size matched across recurrent baselines, Gated SwiLA variants average 45.4 on a commonsense suite vs 45.3 for Transformer++ and 43.7 for DeltaNet (KDA leads the linear family at 46.6); on six recall-intensive tasks Gated Temporal SwiLA's 20.6 is the best pure-recurrent average (DeltaNet 17.3) though softmax models still lead (FoX 33.7), and Hybrid Temporal SwiLA (3:1 recurrent:softmax interleave) reaches 31.8, beating Hybrid GDN (29.5) and Transformer++. Profiled at 1.3B, SwiLA gets 4–5× the Transformer's end-to-end inference throughput (batch-size effect of having no KV cache) but trains ~2× slower than Gated DeltaNet with a sequential Triton kernel; a chunkwise parallel Newton training algorithm is derived but not yet implemented. Ablations (115M): temporal persistence helps consistently, load balancing prevents expert collapse in vanilla SwiLA, and more experts (4→16) slightly hurt at fixed state budget.
- Venue
- arXiv:2609.39034 (cs.LG); COLM 2026
- Source
- arxiv
- Access
- free
- Language
- en
- Added
- Oct 11, 2026
- Verified
- Oct 11, 2026
- Found via
- #SMishra61
Research notes
- Discovery: @SMishra61 X post 2026-10-11 ~9:12 AM ET (~1.8K views, 40 likes, 35 bookmarks at read); tweet's description verified against the paper. Relevance: (1) the paper's hybrid baseline uses the same 3:1 recurrent:softmax layer ratio as the user's 3:1 SWA:full-attention hybrid (his full layers are SWA+FlashAttention, theirs full softmax — transfer is extrapolation unless measured); Hybrid Temporal SwiLA beating Hybrid GDN at that ratio is the comparison to watch. (2) Speed profile rhymes with his standing Gated DeltaNet observation (not faster than his Transformer baseline until ≥16K context): SwiLA's headline inference number is a batch-size effect vs softmax, while per-step it is slower than GDN and parallel training is future work. Cluster: linear-attention/DeltaNet family — DeltaNet, Gated DeltaNet, KDA, MoM are its baselines; TTR framing (Wang et al. 2025) is the design lens. Caveats: single-scale evidence (374M LM, 115M ablations, 1.3B profiling only); KDA still beats SwiLA on commonsense average; code repo URL unconfirmed at catalog time.
- License: CC BY 4.0
- Code: available per the paper (GitHub repo linked from the paper, "switching-linear-attention"); exact repo URL unconfirmed at catalog time. No weights announced.
Similar entries
- Paper Dynamic Linear Attention
- Paper Native Hybrid Attention for Efficient Sequence Modeling
- Paper Triadic Linear Attention: Three-Dimensional Recurrent States for Long-Context Sequence Modeling
- Paper Block Sparse Attention with Log-Linear Complexity
- Paper Gated DeltaNet-2: Decoupling Erase and Write in Linear Attention
- Model LT2: Linear-Time Looped Transformers