Rewirable Circuits in Transformers with Loom Attention
Da Xiao, Qingye Meng, Shengping Li, Xingyuan Yuan
Beijing University of Posts and Telecommunications · ColorfulClouds Technology
Published November 23, 2026 · on the feed November 25, 2026 · ▲ 95 · arXiv 2611.30634
The abstract
We propose loom attention, which allows a Transformer to dynamically rewire its circuits at every token by interweaving a head's vertical attention over the outputs of earlier heads (to obtain its query, key and value) with its horizontal attention over tokens. We instantiate vertical attention efficiently with normalized and gated linear attention over a per-token matrix memory, which stores the compressed head outputs and serves as a second residual stream. This yields LoomFormer, a dual-stream architecture that splits control and content between the vector and matrix streams. Across model sizes and training token budgets in language modeling and downstream tasks, LoomFormer matches Transformers trained with over 3x compute and recent residual-stream baselines (HC/mHC, MUDDFormer, AttnRes) trained with ~1.7-2.8x. For example, trained on the same 300B tokens with only 2% extra FLOPs, LoomPythia-2.8B achieves ~1.6x the average downstream gain of mHC-Pythia-2.8B over Pythia-2.8B, and matches (0-shot) or surpasses (5-shot) Pythia-12B. Code is available at https://github.com/Caiyun-AI/LoomFormer
The Brief
1:59A short podcast summary of the paper. Written and voiced by AI.
Transcript
Rewirable Circuits in Transformers with Loom Attention. By Da Xiao and three others, from Beijing University of Posts and Telecommunications and ColorfulClouds Technology. Published on the twenty-third of November.
An attention head in a Transformer looks across tokens. The question here is about the other direction: how heads connect to one another, which earlier head's output feeds which later one. The authors want those circuits to be rewirable, able to change at every token.
Their proposal is loom attention, named for the way it interweaves two directions of attention. Horizontal attention is the familiar kind, over tokens. Vertical attention runs over the outputs of earlier heads, and a head uses it to obtain its own query, key and value. Weaving the two together lets a Transformer dynamically rewire its circuits token by token.
Vertical attention is made efficient with normalized and gated linear attention over a per-token matrix memory. That memory stores the compressed outputs of the heads and acts as a second residual stream. The result is LoomFormer, a dual-stream architecture: a vector stream and a matrix stream, with control and content split between them.
Results span several model sizes and training token budgets, in language modeling and downstream tasks. LoomFormer matches Transformers trained with more than three times the compute. Against recent residual-stream baselines, named as HC, mHC, MUDDFormer and AttnRes, it matches versions trained with roughly one point seven to two point eight times the compute.
One concrete case. Trained on the same three hundred billion tokens, with only two percent extra FLOPs, LoomPythia-2.8B delivers about one point six times the average downstream gain that mHC-Pythia-2.8B achieves over the plain Pythia-2.8B. It also matches Pythia-12B in the zero-shot setting and surpasses it in the five-shot setting.
Of all those numbers, the comparison with Pythia-12B carries the argument. Give a smaller model a second stream through which its heads can read one another's outputs, let each head choose its inputs at every token, and on the same data it keeps pace with a much larger sibling.
Paper Quest · 7 chapters · about 41 min
Play this paper
Learn it by doing: make the calls the authors made, guess the result before you see it, and defend it in a viva graded on your own words. Chapter 1 is right here.
Chapter 1 🧩 · The problem
Attention chooses which tokens to read. It cannot choose which heads. Start there.
Inside a language model, attention heads pass features to later heads, which pick them up into their own queries, keys and values. Which earlier head feeds which later one is set by fixed weights after training.
The road ahead
- 1 · The problem ~7 min Attention heads pass features to later heads, but which head feeds which is frozen by trained weights and cannot change with the input.
- 2 · What came before ~3 min
- 3 · The key idea ~9 min Give each head a second attention, over earlier heads' outputs at the same token, so the wiring between heads can change at every token.
- 4 · Choose your own research ~3 min
- 5 · Build the method ~8 min Heads write compressed outputs into a per-token matrix memory, later heads read it to build query, key and value, then attend over tokens.
- 6 · The experiment ~6 min You’ll guess: Trained on the same tokens, how did LoomPythia-2.8B fare against the much larger Pythia-12B?
- 7 · The viva ~5 min Three questions from the examiners, answered in your own words. Win it for the paper’s trophy.
Free, with Google or an email address. Your stars and progress are kept.