Pair-Targeted Kronecker Delta Memory Updates
Hebbian writes can bury an old association and ordinary delta updates can disturb overlapping pairs; the Kronecker Delta Rule corrects one pair’s scalar association along that pair’s rank-one direction.
What it is
- Pair score A memory can be queried for how strongly it links a particular key with a particular value.
- Targeted correction Instead of adding another association or changing a whole retrieved vector, adjust that pair’s score toward a chosen target.
- Rank-one update The change follows the presented pair’s own value-by-key pattern, so unrelated directions are less disturbed.
Why it matters
Ordinary additive writes can bury old associations, while vector-valued corrections can affect other pairs that share a key. Pair-targeted scalar correction offers revision and erasure with interference gated by both key and value overlap.
Before getting into the mechanics, here is the short version: this rule treats a key–value pair as an address for one scalar score. If the score is wrong, it changes the memory in the direction made by that same pair, rather than letting the memory’s current contents decide where the correction goes. That makes revision more targeted, though overlapping pairs can still interfere.
-
Revision: A basic linear-attention memory adds an outer product for each new pair. Think of it as keeping notes: adding a new note does not go back and correct the old one, and enough later notes can bury it. The canonical example is presenting the same key and value again with a different desired association. An additive write just adds more; a revision rule needs to compare what the memory currently says with what you want it to say. The notebook analogy is limited because the memory is a matrix, not a set of separate pages.
-
Choose what to correct: The ordinary Delta Rule corrects a retrieved value vector: it checks what the memory returns for a key and pushes that vector toward the desired value. That can alter other associations that share some of the key’s direction. Here the canonical example is a key that overlaps with another stored key: changing the retrieved vector for the first can tug on the second. So the real question was never just whether memory can revise; it was whether the correction can be aimed at one pair’s own association.
The Kronecker Delta Rule makes that choice by asking for one scalar: how strongly does this memory link this key with this value? In symbols, the score is — the value vector probes the memory’s response to the key. In words, it is one number measuring this pair’s current association, not the entire retrieved vector. The rule moves that number toward a target. For example, a target of zero means “erase this pair’s score”; a nonzero target says how strong the association should be.
- Limit the collateral change: Imagine a memory update as changing one pattern in a notebook rather than erasing a whole page. The pattern here is the pair’s value-by-key outer product, and the scalar error determines how much to change it. The formula is . In words, subtract the current score from the target, then add that error times the pair’s own pattern. The step size is the knob: a small step makes a smaller correction. This is like choosing what not to carry to the next town, except the analogy breaks because non-orthogonal patterns can overlap rather than being cleanly separate items.
That overlap is the important caveat. Another pair is protected if either its key direction or its value direction is orthogonal to the updated pair; otherwise both overlaps can contribute to interference. Overall, I like the precision of this update, but it does not make arbitrary associations independent. So the remaining question is: how much overlap can a particular collection of pairs tolerate before the memory stops behaving like separate addresses?
Read the deep dive
Why People Wanted It
A matrix memory can store key–value associations by adding each pair’s outer product. But additive writes do not revise an association; later writes can bury it. The ordinary Delta Rule does revise, yet its correction depends on the memory’s current retrieval, so a write can disturb other associations whose keys overlap. The real question is whether you can correct the score of one chosen pair without letting the memory’s other contents choose the direction of that correction.
The Core Move
Correct the scalar score for the presented key–value pair, and move the memory only along that pair’s outer product:
Here is the pair’s current score, is its target, and controls the correction size. The update is rank one: the pair itself supplies the direction, while the scalar residual says how far to move.
Why the Scalar Score Changes the Correction
Here is the part that gets technical: the key distinction is between correcting a whole retrieved value and correcting one scalar association. A matrix memory maps a key to a value-like vector . The ordinary Delta Rule compares that vector with the desired value, using residual . The Kronecker Delta Rule instead asks for the scalar bilinear score and compares it with scalar target .
Write and . Then , so the update becomes . In words, this is a scalar error-correction step along the feature vector belonging to the pair. The target sets the desired score; the memory’s other entries do not set the direction.
For a repeated pair, the scalar error contracts by the factor . Thus a positive step size below contracts the error, and the step size reaches the target in one update. What does making the direction pair-specific buy when other associations are present?
Why the Rank-One Direction Limits Interference
Now the version for readers who want more of the machinery: the update matrix is always a scalar multiple of , so it changes only in that rank-one direction. For a test pair , the change in its read-out is proportional to times the current pair’s scalar residual. In words, both the key overlap and the value overlap must be present for this update to alter that other pair’s score.
That gives an exact protection condition: if either or , the test pair’s bilinear read-out is unchanged. This is more selective than interference controlled by key overlap alone. It is not universal isolation: non-orthogonal pairs can still interact, and an inaccurate current score leaves a residual that can produce that interaction. So what if the goal is not merely to revise a score, but to erase it?
Why the Target Enables Erasure
Here is the deeper consequence: setting asks the update to drive the presented pair’s scalar score to zero, rather than to store a particular output vector. For the same pair, this is the same contraction of its scalar error toward the chosen target; with the one-step size , the score reaches that target in one update.
The update can also be split into an erase term and a write term by expanding the residual: . The first term subtracts the pair’s current contribution along its direction; the second adds the target-scaled pair direction. This is targeted erasure of a bilinear association, not a guarantee that every other non-orthogonal association is untouched. How much protection and capacity do you get from this pair-addressed view?
Minimal Causal Code
The loop below exposes the state change directly; it is intentionally not optimized.
import torch
def kronecker_delta(memory, keys, values, targets, beta):
# memory: [value_dim, key_dim]
for key, value, target, step_size in zip(keys, values, targets, beta):
current_score = value @ memory @ key
residual = target - current_score
memory = memory + step_size * residual * torch.outer(value, key)
return memory
Each iteration measures one pair’s score, forms its scalar error, and adds only the pair’s outer-product direction to memory.
What You Gain, and What You Lose
You gain a revision rule whose correction direction is determined by the presented pair, scalar error correction for that pair, and doubly gated interference: both key and value overlap matter. You can set the target to zero to erase that pair’s score. In a vectorized view, each pair imposes one scalar linear constraint on the memory, so independent pair features can represent scalar associations.
You do not get perfect isolation for arbitrary pairs: overlapping keys and values can still cause crosstalk. Nor is this the same objective as retrieving a whole value vector; it targets the scalar bilinear association. Step size still matters, and this rule by itself says nothing about a complete sequence-mixer architecture or its execution strategy.
The Kronecker Delta Rule revises a pair’s scalar score by moving memory only along that pair’s own outer-product direction.