Summary (Overview)

  • Core contribution: The paper introduces Complex KDA (CKDA), an extension of Kimi Delta Attention (KDA) that combines two existing range extensions—signed channel-wise gates αt∈[−1,1]n\alpha_t \in [-1, 1]^n and delta-rule coefficient βt∈[0,2]\beta_t \in [0, 2]—to enable 2D rotations and complex eigenvalues within a single diagonal-plus-rank-one (DPR1) transition.
  • Key theoretical result: Every orthogonal diagonal-plus-rank-one matrix is exactly a CKDA transition matrix (Theorem 1), and a single CKDA layer can track every finite group isomorphic to a subgroup of SO(3), including S3S_3, S4S_4, and A5A_5 (Theorem 3).
  • Expressivity improvement: CKDA achieves state-tracking expressivity comparable to DeltaProduct₂ but with a single delta-rule update per token, using one fewer layer than (Gated) DeltaNet for many state-tracking results.
  • Empirical findings: CKDA demonstrates the strongest length extrapolation among tested KDA range settings on S3S_3, S4S_4, and periodic audio continuation; at 1.3B parameters, it performs on par with KDA while outperforming Transformers and other linear RNNs.
  • Efficiency: The implementation retains approximately 96–97% of standard KDA's throughput, requiring only minor modifications to existing KDA recurrence kernels.

Introduction and Theoretical Foundation

Background

Linear recurrent neural networks (RNNs) offer efficient sequence modeling with linear scaling in sequence length and fixed-size recurrent states. Their expressivity depends critically on the structure of their state-transition matrices:

  • Diagonal transitions (Mamba-1/2, GLA, mLSTM) support fast computation
  • Non-diagonal transitions using the delta-rule introduce a rank-one correction that mixes information across state coordinates

The state-transition matrix for gated delta-rule models takes the form:

At=(I−βtktkt⊤)Diag⁡(αt)\pmb{A}_t = (\pmb{I} - \beta_t \pmb{k}_t \pmb{k}_t^\top) \operatorname{Diag}(\pmb{\alpha}_t)

Two main variants exist:

  • Gated DeltaNet (GDN): uses a scalar gate αt=αt1\pmb{\alpha}_t = \alpha_t \mathbf{1}
  • Kimi Delta Attention (KDA): allows a separate gate value per channel

Motivation: From Symmetry to Rotation

The paper identifies a fundamental mechanism: signed channel-wise gates combined with Householder reflections produce rotations.

Symmetry analysis: A KDA transition A=HkDA = H_k D (product of two symmetric matrices) is symmetric iff the factors commute:

(HkD−DHk)ij=βkikj(αi−αj)=0for all i,j\left(\boldsymbol{H}_{\boldsymbol{k}} \boldsymbol{D} - \boldsymbol{D} \boldsymbol{H}_{\boldsymbol{k}}\right)_{ij} = \beta k_i k_j (\alpha_i - \alpha_j) = 0 \quad \text{for all } i, j
  • Scalar gate (GDN): αi=α\alpha_i = \alpha always satisfies this condition → real spectrum only
  • Channel-wise gate (KDA): noncommutation possible when β≠0\beta \neq 0 and gate values differ

However, strictly positive gates still yield real spectra (the matrix is similar to a symmetric matrix). Only signed gates enable complex eigenvalues.

Key 2D construction: With β=2\beta = 2, k=(cos⁡θ,sin⁡θ)⊤k = (\cos\theta, \sin\theta)^\top, and Dα=Diag⁡(α,1)D_\alpha = \operatorname{Diag}(\alpha, 1):

Aα,θ=(−αcos⁡2θ−sin⁡2θ−αsin⁡2θcos⁡2θ)\boldsymbol{A}_{\alpha,\theta} = \left(\begin{array}{cc} -\alpha \cos 2\theta & -\sin 2\theta \\ -\alpha \sin 2\theta & \cos 2\theta \end{array}\right)

The discriminant is Δ=(1−α)2cos⁡2(2θ)+4α\Delta = (1-\alpha)^2 \cos^2(2\theta) + 4\alpha. For α<0\alpha < 0, complex-conjugate eigenvalues exist, and at α=−1\alpha = -1, the transition is a composition of two reflections—a rotation by 2θ2\theta.


Methodology

CKDA Definition

CKDA is defined as KDA with:

  • αt∈[−1,1]n\pmb{\alpha}_t \in [-1, 1]^n (signed channel-wise gates)
  • βt∈[0,2]\beta_t \in [0, 2] (extended delta-rule coefficient)

Implementation uses βt=2σ(bt)\beta_t = 2\sigma(b_t) and signed gates rt,i=2σ(at,i)−1r_{t,i} = 2\sigma(a_{t,i}) - 1.

Theoretical Framework

Theorem 1 (DPR1 and CKDA): Every orthogonal DPR1 matrix A=D+uv⊤∈Rn×n\pmb{A} = \pmb{D} + \pmb{uv}^\top \in \mathbb{R}^{n \times n} can be written as:

A=(I−2kk⊤)S,∥k∥2=1,S=Diag⁡(si),si∈{−1,+1}\pmb{A} = (\pmb{I} - 2\pmb{k}\pmb{k}^\top)\mathcal{S}, \quad \|\pmb{k}\|_2 = 1, \quad \mathcal{S} = \operatorname{Diag}(s_i), \quad s_i \in \{-1, +1\}

Proposition 2 (Sign-magnitude decomposition): A CKDA transform decomposes as A=A~Diag⁡(∣α∣)\pmb{A} = \tilde{A}\operatorname{Diag}(|\pmb{\alpha}|) where A~=(I−βkk⊤)S\tilde{A} = (I - \beta kk^\top)S. The restricted block on U=span⁡{k−,k+}\mathcal{U} = \operatorname{span}\{k_-, k_+\} is:

B(β,θ)=(βcos⁡2θ−1−βsin⁡θcos⁡θβsin⁡θcos⁡θ1−βsin⁡2θ)\boldsymbol{B}(\beta, \theta) = \left(\begin{array}{cc} \beta \cos^2\theta - 1 & -\beta \sin\theta \cos\theta \\ \beta \sin\theta \cos\theta & 1 - \beta \sin^2\theta \end{array}\right)

This block is a rotation by 2θ2\theta when β=2\beta = 2, with non-real eigenvalues exactly when β2cos⁡2(2θ)<4(β−1)\beta^2 \cos^2(2\theta) < 4(\beta - 1).

Key Conditions for Complex Eigenvalues

Complex eigenvalues require:

  1. At least two gate coordinates with opposite signs
  2. Key vector spanning coordinates with opposite signs
  3. β>1\beta > 1

Implementation

Three implementation variants:

  1. Compiled PyTorch: absorbs cumulative signs into keys/queries without changing kernels
  2. Triton kernels: fuse signs into normalization and backward pass
  3. TileLang hybrid: combines Triton changes with TileLang backward kernels

Empirical Validation / Results

Expressivity Results (Table 1 Summary)

PropertyCKDAGDNGated DeltaProductRWKV-7/GDN-2
Complex pairs≤ 1 (Thm. 8)0≤ ⌊k/2⌋0
S2S_2 (parity)✓ 1 layer✓ 1 layer✓ 1 layer (k≥1)✓ 1 layer
Zn,Dn\mathbb{Z}_n, D_n (n>2)✓ 1 layer✓ 2 layers✓ 1 layer (k≥2)✓ 2 layers
S4,A5S_4, A_5✓ 1 layer✓ 4 layers✓ 1 layer (k≥2)✓ 4 layers
SnS_n (n≥5)✓ 3 layers✓ 4 layers✓ 3 layers✓ 4 layers

State-Tracking Results

  • CKDA extrapolates well on S3S_3 and S4S_4 while other KDA settings fail (Figure 6)
  • Learned CKDA heads recover the theoretical mechanism: β≈2\beta \approx 2, nearly sign-valued gates, complex-conjugate eigenvalues near the unit circle (Figure 7)
  • A5A_5 requires theory-initialized training (optimization obstacle, not representational)

Audio Continuation

  • CKDA with both range extensions accurately continues periodic waveforms beyond training horizon
  • At length 264 (vs. max training length 136): 38.1 dB SNR for CKDA vs. 2.8 dB for causal Transformer

Language Modeling (1.3B parameters, 100B tokens, FineWeb-Edu)

ModelWiki. ppl ↓LMB. ppl ↓Avg. accuracy (%) ↑
KDA16.8111.6852.28
CKDA (ours)15.7810.0854.06
KDA + attn 3:1 (ours)15.049.9353.92
CKDA + attn 3:1 (ours)15.349.9054.37
Mamba-3 (MIMO)16.4511.6652.39
Gated DeltaNet-215.9011.4153.11

Kernel Throughput

CKDA retains approximately 96–97% of standard KDA throughput on H100 GPUs.


Theoretical and Practical Implications

Theoretical Implications

  1. Characterization of DPR1 expressivity: CKDA captures the entire orthogonal DPR1 family, showing that the non-symmetric uv⊤uv^\top structure in models like RWKV-7 adds no orthogonal transitions beyond what CKDA achieves.

  2. Spectral restrictions: Every nonexpansive DPR1 matrix has at most one non-real conjugate eigenvalue pair on the unit circle (Theorem 9). This is a fundamental limitation of the architecture family.

  3. State-tracking hierarchy: CKDA requires one fewer layer than (Gated) DeltaNet for many state-tracking results (3 vs. 4 layers for general regular languages and WFAs), matching DeltaProduct's expressivity with a single rank-one correction per token.

  4. Spectral obstruction theorem: Non-expansive transitions with at most one complex eigenvalue pair cannot track S5S_5 in one layer (Theorem 4), establishing a fundamental limitation shared by CKDA and DeltaProduct with k≤3k \leq 3.

Practical Implications

  1. Efficient expressivity gain: CKDA achieves DeltaProduct₂-level expressivity without the computational cost of two delta-rule updates per token.

  2. Length extrapolation: Signed gates and extended β enable better extrapolation on group word problems and periodic waveform continuation—useful for tasks requiring long-range periodic structure.

  3. Language modeling: CKDA matches or slightly exceeds KDA baselines while providing additional expressivity, with no significant throughput penalty.

  4. Learned mechanisms: Analysis of trained models confirms that language models actively learn to use negative gates and extended β ranges, particularly in early layers, suggesting these mechanisms serve functional roles in sequence processing.


Conclusion

Main Takeaways

  • CKDA combines signed channel-wise gates (α∈[−1,1]n\alpha \in [-1, 1]^n) with extended delta-rule coefficient (β∈[0,2]\beta \in [0, 2]) to enable planar rotations and complex eigenvalues within a single non-expansive DPR1 transition.
  • Every orthogonal DPR1 matrix is exactly a CKDA transition, establishing CKDA's completeness within this important matrix family.
  • State-tracking expressivity matches DeltaProduct while using one fewer layer than (Gated) DeltaNet for many tasks.
  • Empirical validation confirms the theoretical mechanism in both state tracking and language modeling, with CKDA achieving the strongest length extrapolation among KDA variants.

Limitations

  • Rank-one structure limits transitions to at most one persistent complex-conjugate eigenvalue pair
  • Expressivity results do not imply learnability (A5A_5 requires theory-initialized training)
  • General WFA construction requires β>2\beta > 2, sacrificing guaranteed non-expansiveness
  • No inherent computational advantage over (Gated) DeltaProduct₂

Future Work

  • Combine CKDA with separate gates (as in GDN-2) controlling additive terms and state forgetting
  • Mechanistic analysis of how learned gates and β ranges function in language models
  • Investigation of the functional roles of negative gates and extended β in trained models

Related papers