Exea LabsBlog
日本語Japanese version

Day 2 ·

Agents learn to talk. The model builds its own RAG.

Agents pass facts over the board 99.8% of the time. The model finds the right fact among 1,024 it has never seen.

Date
2026-11-11
Read
5 min read
Topics
Swarms, Retrieval, Tokenizer
By
The Exea team
99.8%

relay accuracy through the board; chance is 1.6%

100%

lookup accuracy over 1,024 unseen facts

0.012

bits per byte swarms gain on real text at least, 2 seeds, after correcting for a leak (0.014 as first reported)

Day 1 put two new circuits into TONN: a message board shared by copies of the model (AG) and retrieval from a library (RG). Day 2 asked whether either one learns anything. Each test below is built so that only the new circuit can solve it. Each has a control that removes the circuit.

All runs are on one Mac Studio GPU (Apple M3 Ultra). The models are small, from 0.8M to 13M parameters, so these results test mechanisms, not the final model.

01The relay: agents must talk to score

Task. The information is split across a swarm. Fact holders read chunks like [FACT, key, value]. The asker reads questions like [ASK, key, ?] about those facts. Only the asker is scored. Values are drawn at random for every example, so the asker can beat chance (1 in 64) only if the fact holders pass the facts over the board.

The fact holders get no loss of their own. Everything they learn to post comes from the asker's errors, flowing back through the board.

Every agent reads its first chunk.

BoardnothingAgent 1FACT k7 42FACT k2 61Agent 2FACT k3 19FACT k9 30Agent 3FACT k5 8FACT k1 5AskerASK k7 ?ANS …chunk 1chunk 2
How the board works, slowed down. Four agents read their chunks in parallel. At the end of each chunk, each agent posts one message (a dot on the board). In the next chunk, each agent reads the earlier posts on the board with attention; the lines show where the asker's attention goes. The empty entry at the top of the board is the option to read nothing. Switch to a cut board to see the control.

Result. Trained as a swarm, the asker answers 99.8% of questions correctly, on all three seeds. Cut the board at test time and it falls to 1.5%, which is chance. The same model trained alone stays at chance (1.4% to 2.2%).

Trained as a swarm, board sharedSame model, board cut at test timeTrained alone
0%25%50%75%100%05001,0001,5002,0002,5003,000chance (1.6%)100%
Relay accuracy during training, seed 0, 2 agents and 4 facts. With the board shared, the asker passes 98% by step 250. With the board cut at test time, the same model is at chance (1.6%, dashed). A model trained alone never leaves chance.

The board also scales a little. With 4 agents, 3 fact holders with 4 facts each and one asker asking about all 12, accuracy is 99.8%. With 16 facts per agent it is 99.9%.

What this does not show is that a board helps on ordinary text. That needs a different test.

02Swarms on real text

Setup. FineWeb-Edu as raw bytes. In a split swarm, 4 agents read 4 consecutive windows of one stretch of text, so each agent could use what the agents before it read. The control is the same batches with the board cut during training. Every model is scored on the same held-out swarms, in .

On pure TONN (5.2M parameters), the board gains 0.006 bits per byte. On the that became the default later on day 2, the gain more than doubles:

Swarm, board sharedSwarm, board cut at test timeControl, board cut in training
1.6101.6201.6301.6401.650agent 1agent 2agent 3agent 4gain over control: 0.014
Swarms on real text, hybrid model, 4,000 steps. Bits per byte on held-out text, lower is better. The swarm beats the matched control on both seeds, by 0.015 and 0.012. Even with its board cut, the swarm-trained model beats the control by 0.010 on average.
  • Swarms beat the matched control by 0.014 bits per byte on average (about 0.8%), on both .
  • Every position in the swarm gains.
  • The swarm-trained model is better than the control even with its board cut, by 0.010. Training as a swarm improves each agent on its own, beyond what it reads.

Split batches have a cost. A batch of 32 rows read in swarms of 4 holds 8 independent stretches of text instead of 32. On pure TONN the control trained on split batches is 0.021 worse than ordinary training. Pretraining will need more rows per batch, or swarms that read related documents instead of one stretch.

03The model builds its own RAG

Task. A library of facts [FACT, k1, k2, value], with two-token keys and values drawn fresh at every training step, so nothing can be memorized in the weights. The model reads a question [ASK, k1, k2] and must give the answer [ANS, value] in the next chunk. Chance is 1 in 64.

To beat chance, the model has to learn every part of retrieval by itself: its own embeddings for the library, what to search for, which result to trust, and how to read the answer out of it.

Result. With the library attached, the model answers 100% of questions over 1,024 facts it has never seen. With the library removed it falls to 1.5%. The same model trained without a library reaches 2.3%.

Library attachedSame model trained without a library
0%25%50%75%100%01,0002,0003,0004,00032 facts64 facts128 facts256 facts1024 facts
Lookup accuracy during training. The training library starts at 16 facts and doubles every 400 steps up to 1,024. Each point is scored on a fresh library of the size reached at that step. The model reaches 93% by step 1,000 and 99.6% by step 2,000.

04Three fixes before retrieval learned anything

The first design never learned. For 4,000 steps, accuracy sat at chance. Small diagnostic runs found three separate blockers. Each one alone was enough to stop learning.

  1. The query and the stored keys lived in unrelated spaces. The query came from the circuit's own stream; the keys came from a separate encoder. The search was no better than random. Fix: the query for chunk c is the same encoder applied to chunk c-1, plus a learned share of the circuit's own stream that starts at zero.
  2. An output gate scrambled the retrieved value. The read was multiplied by a gate computed from the reading position. A linear probe recovered the value from the read 68% of the time before the gate and 2.5% after it. Fix: no gate.
  3. A zero-initialized matrix drowned the retrieved tokens' identity. It added the encoder's in-chunk states to each retrieved token. Adam moves every entry of a zero matrix by about the learning rate per step, whatever the gradient, so within 100 steps the added noise swamped the token identity the match depends on. Fix: retrieved tokens are plain token embeddings, read through the layer's own input projection.
TheThamesflowseastthroughcentralLondonto… 64

Retrieval runs once per 64-token chunk.

The retrieval circuit after the fixes. The previous chunk is encoded into a query. The library's keys come from the same encoder, so both live in one space. The top 4 chunks are scored again with the current encoder. Their tokens enter as plain embeddings, read through the layer's own input projection, with no gate. Step through the stages with the buttons.

Two smaller choices helped. The keys look one token back, so "find the key, take the token after it" is one attention step. And the weighting of the 4 retrieved chunks starts soft, so all four get gradient early on.

Controls along the way confirmed where the problem was. The same model learned the lookup with the facts in its own context (95% in 1,000 steps), so the task was learnable; the failure was in retrieval. With two fixed libraries, the broken design could still fit answers that differ only in the library, so gradients were flowing.

05Also decided: a 32k tokenizer

Byte-level BPE with 32k, 49k and 64k tokens, trained on 200 MB of English, 160 MB of Japanese and 80 MB of code. Bigger vocabularies pack more text into each token. But at a fixed number of training tokens, their extra embeddings are seen less often. They also cost parameters.

Bytes per token (higher packs more text)
English
32k
4.38
48k
4.55
64k
4.66
Japanese wiki
32k
4.28
48k
4.54
64k
4.72
Japanese web
32k
5.36
48k
5.75
64k
6.03
Code
32k
2.67
48k
2.77
64k
2.83
Bits per byte of a 13M model (lower is better)
English
32k 1.489
48k 1.484
64k 1.487
Japanese wiki
32k 1.575
48k 1.586
64k 1.613
Japanese web
32k 1.433
48k 1.434
64k 1.446
Code
32k 1.949
48k 1.982
64k 2.062
Tokenizer size against quality. Left: bytes of text per token (higher packs more text). Right: bits per byte of a 13M model trained on the same 49M tokens with each tokenizer (lower is better). 32k wins or ties on every kind of text and is clearly better on code and Japanese Wikipedia.

At 0.1B, 32k instead of 49k frees 10.5M parameters, about 10% of the model. The tokenizer is on Hugging Face.

06What this does not show

The relay and the lookup prove the circuits can learn. They do not show that retrieval helps on real text. That test, with a result we had to correct, is in Retrieval on real text needs a better search.

07

Who did the work

Avneh Bhatia@AvnehSBhatia
Ran the relay, swarm, lookup and tokenizer experiments on the Mac Studio. Traced the three retrieval blockers.
Aaron Chu@aarochu
Found the split-swarm seam leak while building the swarm-vs-solo harness (PR #5). Fixed it in PR #7. Added the board statistics (PR #4) that show how agents use the board.
08

Sources