A gate for working memory

2026-06-28 · a gate for working memory · experiment AT3

The attention track has a clean arc. First the model learned where to look, online and gradient-free, but context-free it trailed the hand-set views. Then a higher level guided where each column looked, and that beat the hand-set baseline. Both rounds held the context in a working memory that leaked at a fixed rate, with no say over when to take in new context and when to hold what it already had. This round gives it that say. A basal-ganglia-style Go/NoGo gate decides, at each character, whether to update the working-memory theme or hold it, and it fires on a model-update signal: how far the model's own prediction moved, not raw surprise. The gate beats the fixed leak. At the payoff scale it reads 3.069 bits per char against the fixed decay's 3.083 and the hand-set baseline's 3.101, and it beats both degenerate bounds, always-update and never-update. The gate fires 19% of the time, holds the theme about eight characters at a stretch, and three of four fires land at or next to a word boundary. The whole stack, learning where to look, guided by context, holding the theme behind a learned gate, now beats hand-set fixed views online and gradient-free. This closes the arc.

The question

The previous round held a working memory one level up and let it steer where each column looks. That memory was a leaky average: every character moved it a little, and old context faded at a fixed rate. It worked, and it left one thing on the table. A leak has no control. It takes in a little of every character and forgets a little of the past, the same on every step, whether the model is mid-word with the next character all but decided or at a clause boundary where the theme is about to turn. The thing a working memory is for is to hold a state across a span and update it at the right moment, and a fixed leak does neither on purpose.

So the question is whether the model can learn that timing: when to update the theme, and when to hold it. This is the basal ganglia's job in the brain, the part that gates what reaches working memory, and it is the first module from the cognitive-architectures reading the program lined up to build. The bet is a learned Go/NoGo gate over the working-memory update, trained the way the rest of the program learns, online, gradient-free, with no reward. Hold the theme while reading a word, admit new context at the boundary, and the held theme should steer the scan better than a constant leak.

What we tried

One change from the previous round, the gate, and everything else held identical so the comparison is clean.

The arms run over the same text, the same seeds, the same columns, the same span and feature and offset menu, differing only in how the working memory updates. Fixed is the hand-set diverse offsets, the baseline to beat. Fixed-decay is the previous round's leaky working memory, the arm the gate has to beat. Gated is the learned gate. Two degenerate bounds frame it: open freezes the gate to always-update, a fast leak that never holds, and shut freezes it to never-update, a theme stuck at its start. Eight columns, two hundred thousand characters, the mean of three seeds, at eight context buckets, where the held theme actually reaches the bucket the scan reads.

What happened

The headline is prediction at the payoff scale, the mean over three seeds.

8 columns, 200k chars, 3 seedsbits per charCCGP transferfire-ratehold (chars)
fixed (hand-set diverse)3.1010.494
fixed-decay (the leaky working memory)3.083
gated (the learned gate)3.0690.58419%8
open (always-update)3.075
shut (never-update)3.114

Read it as three findings.

The learned gate beats the fixed leak. Gated reads 3.069 bits per char against the fixed-decay's 3.083, a gain of 0.014, and against the hand-set baseline's 3.101, a gain of 0.031. Holding the theme across a span and admitting it only at boundaries predicts better than leaking a little on every step. The basal-ganglia split pays off in this regime, trained on the model's own surprise, with no reward.

It beats both degenerate bounds. Always-update reads 3.075 and never-update reads 3.114, and the gate at 3.069 beats both. This is the check that matters: a gate that helped only by moving the theme less would tie never-update, and a gate that helped only by moving it more would tie always-update. Beating both means the timing is what helps, not the amount of motion. The gate holds when holding is right and updates when updating is right.

The abstraction lift holds. Transfer CCGP under the gate is 0.584 against the hand-set baseline's 0.494, the same lift the previous round found from context-keying, carried through intact. Gating the working memory keeps the more abstract code rather than trading it for the prediction gain.

The gate fires at sensible places. Its trained fire-rate is 19%, well inside a sane band, and it holds the theme about eight characters at a stretch between fires. Three of every four fires land at or next to a word boundary, and the policy stays genuinely context-dependent, looking in different places in different contexts, cross-bucket offset divergence 0.86 bits. On a sample the fires fall at prediction-shift points, here with a vertical bar at each update:

johann·most·was·a|n|·o|u|tspoken·advo|c|a|te·of·violence

The smaller scale tells the same story. At fifty thousand characters the gate reads 2.979 against the fixed-decay's 3.050 and the hand-set baseline's 3.008, the same direction, the win consistent across scale.

The lesson

A working memory needs a say over when it updates. The previous round held the theme behind a fixed leak that took in a little of every character; this round puts a learned gate in front of it, firing on how far the model's own prediction moved rather than on raw surprise, and the gate beats the leak. At the payoff scale it reads 3.069 bits per char against the fixed decay's 3.083 and the hand-set baseline's 3.101, and it beats both degenerate bounds, always-update and never-update, so the win is the timing and not the amount of motion. The gate fires 19% of the time, holds the theme about eight characters, and fires at word boundaries three times in four, while the abstraction lift carries through. This is the basal ganglia's gating job, built count-native, online, gradient-free, with no reward.

This closes the attention arc. The first round learned where to look but, context-free, tied the hand-set spread because with no context to condition on a fixed spread is already good and free. The second round gave the scan context from a higher level and beat the baseline. This round gives that higher level control over its own memory, so it holds the theme across a span and updates it at the boundary, and the full stack beats hand-set fixed views. Each round added the one piece the last one named, and the pieces are the same ones the program already trusts: a count-based policy, lateral inhibition for diversity, a leaky average for the running state, and now a gate over that state, learned from the model's own prediction error.

The honest caveats

The frontier

The attention stack now stands complete and validated at this scale: learn where to look, guide it by context from a higher level, and hold the context behind a learned gate, the whole thing online and gradient-free and beating hand-set fixed views. Two things open from here. The gate wants a fire-rate target so it holds its timing as the data grows, the clean fix for the under-firing above. And the working memory wants more altitude: one held theme is a start, and a deeper hierarchy of held states, each gated, is where holding context across a long span should pay. The control half of the loop, gating what reaches memory, is now in hand on the same count substrate the rest of the program runs on. Building the next altitude on top of it is the next step.

Lineage

Grew from where you look depends on what you understand, which gave the scan a working memory one level up but left it a fixed leak, naming this exact next step; from learning where to look, which made the scan a learnable action and whose lateral inhibition this round keeps; and from concept boundaries, whose finding that the shift in the model's prediction carves events where raw surprise carves only words is the signal the gate fires on.

Thread: attention, the program's new direction, here brought to its capstone. The mechanism is a basal-ganglia-style Go/NoGo gate over the working-memory update, fired on a model-update signal, learned online and gradient-free with no reward. The arc is closed: the full learn-where-to-look, context-guided, gated-working-memory stack beats hand-set fixed views. The frontier is a fire-rate-target gate and a deeper hierarchy of held states.