Papers
arxiv:2611.30634

Rewirable Circuits in Transformers with Loom Attention

Published on Nov 23
· Submitted by
Da Xiao
on Nov 25
#2 Paper of the day
Authors:
,
,

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

Community

Paper author Paper submitter
•
edited about 6 hours ago

Hi everyone! Author here — happy to share LoomFormer, along with our JAX/Pallas training code, PyTorch/Triton inference kernels, and 300B-token 2.8B checkpoints (including a matched mHC-Pythia-2.8B baseline).

TL;DR:

  • Why layer-wise residual routing hits a ceiling: Recent residual-stream mechanisms (HC/mHC, AttnRes, MUDDFormer) share routing ports across all heads of a layer, restricting their head-to-head wiring matrix to rank ≤ 1 (or ≤ 3 in MUDDFormer).
  • Per-token head-to-head rewiring: LoomFormer generates ports per head and per token via normalized and gated linear attention (MRead / MWrite) over a fixed per-token matrix memory M_t of shape [d_k, d], reaching wiring rank 2n in a smaller per-token state (3D) than 4-stream HC/mHC (4D).
  • Scaling & 300B pretraining: Matches Transformers trained with >3× compute across scales. Trained on 300B Pile tokens with only +1.95% FLOPs, LoomPythia-2.8B achieves 1.6× the downstream gain of mHC-Pythia-2.8B, matches Pythia-12B in 0-shot (59.9), and surpasses Pythia-12B in 5-shot (61.6 vs. 60.8) and FLAN ppl (6.94 vs. 7.26), while lifting deep non-sink active heads from ~20% to 74.4%.
  • Wall-clock speed: Sustains 89–92% of Transformer training speed on TPU v5p (fused Pallas kernels) and 84–92% of prefill/decode speed on GPU (fused Triton + CUDA graphs).

Links:

Happy to answer any questions on the circuit theory, ablations, or kernels!

This is an automated message from the ResearchStudio team.

We created an interactive ResearchStudio Reel for this paper. It includes a visual poster, a video, and a blog, all available for download in editable formats.

Visual poster for this paper

Open the ResearchStudio Reel →

Download all files from Hugging Face

Please give this comment a thumbs up if you find the Reel helpful!

Want to explore or create Reels for more papers? Visit the ResearchStudio demo.

Sign up or log in to comment

Get this paper in your agent:

hf papers read 2611.30634
Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash

Models citing this paper 2

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2611.30634 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2611.30634 in a Space README.md to link it from this page.

Collections including this paper 0

No Collection including this paper

Add this paper to a collection to link it from this page.