How the memory works
Both memories start empty for every request, read the user's last 20 events in order, and are then asked one question: given this user's long-term profile, which way should their taste be nudged right now?
1 · What is stored
The network's private numbers are W1's changes (32 × 65) plus W2 (64 × 32). In the code it is UnifiedAssociativeMemory.
2 · One request
Highlighted boxes differ between models. Everything else is shared.
3 · Building and updating
Start empty, correct the error
Both grids start at zero. For each event, a small trained writer turns it into a key, a value and a strength. The grid predicts the value from the key, then adds a correction for the miss, scaled by the strength. Older content fades by a decay factor.
Start from a learned guess, take one step
W1 starts from values learned in training; W2 starts at zero, so an empty memory reads zero. For each event the network takes one gradient step to predict the value from the key plus a like or dislike sign. Its private changes fade the same way.
4 · The fundamental difference
A linear map: similar items always get proportionally similar answers. With no hidden layer, the network code reduces exactly to the grid.
A curved map (tanh), so it can store conditional patterns. One memory serves likes and dislikes, using half the storage.
A grid step moves its answer a known fraction toward the target. A network step's effect depends on its current weights, so it can overshoot; steps are shrunk when the network is sensitive.