Kimi K3 · mechanism 01 · executable lesson

A memory that can forget, correct, and retrieve

Kimi Delta Attention replaces a growing list of past keys and values with a fixed matrix. Follow one real PyTorch trace as each token transforms that memory.

The problemSoftmax attention keeps a KV entry for every past token. KDA asks whether a fixed state can retain the useful associations—and revise them when new evidence arrives.
St−1S̄ = Diag(α)Sp = S̄ᵀke = v − pΔS = βkeᵀSt = S̄ + ΔSy = Stᵀqhandoff

×

+

changing valuecomputed resultactive vector component