Back to articles

LoomFormer Lets Transformer Attention Rewire Its Circuits

3 min read

A Transformer’s residual stream carries information between layers, but the routes by which attention heads exchange their intermediate outputs are often comparatively constrained. LoomFormer proposes a different arrangement: Loom attention lets each head dynamically access outputs from earlier heads at a given token position, while retaining ordinary attention across positions in the sequence.

How the design works

  • Attention across two axes. Horizontal attention handles relationships among tokens. Vertical attention operates among earlier heads at the same token position, helping a head form its query, key, and value from prior head outputs. The model can therefore adjust both which tokens it reads and which earlier computations it uses.
  • A matrix memory for head outputs. LoomFormer uses normalized, gated linear attention to read from and write to a per-token matrix memory. The memory stores compressed head outputs and acts as a second information stream alongside the conventional vector residual stream. The authors describe the vector stream as carrying content and the matrix stream as handling control and routing.
  • Routing that varies by head and token. The paper argues that some existing residual-routing methods share routing ports across a layer, limiting the possible head-to-head connections. Loom instead generates ports per head and per token. In the authors’ analysis, its wiring matrix can reach rank 2n, with a per-token state of 3D—smaller than the 4D state attributed to the four-stream HC/mHC comparison.

What the reported experiments show

The authors say LoomFormer matches Transformers trained with more than three times the compute across model scales and training-token budgets, and compares favorably with several residual-stream baselines trained with roughly 1.7–2.8 times the compute. In one reported comparison, LoomPythia-2.8B and mHC-Pythia-2.8B were each trained on 300 billion Pile tokens. LoomPythia used about 1.95% more FLOPs and achieved around 1.6 times the downstream average gain of the mHC model, according to the authors.

The supplied results also put LoomPythia-2.8B at 59.9 in a zero-shot evaluation, matching Pythia-12B, and at 61.6 in a five-shot evaluation, compared with 60.8 for Pythia-12B. Its reported FLAN perplexity is 6.94 versus 7.26 for that larger model. The authors further report that the share of active, non-sink heads in deep layers rises from about 20% to 74.4%. The material does not specify all task definitions, evaluation protocols, or uncertainty estimates, so these figures should be treated as reported findings rather than a guarantee of broad superiority.

The added routing also has an implementation cost. The authors report training at 89–92% of standard Transformer speed on TPU v5p, and prefill/decode speeds at 84–92% on GPU. These figures suggest that optimized kernels can limit, but do not eliminate, the speed trade-off.

If independently confirmed, Loom attention offers more than another memory component: it makes communication among heads a token-dependent part of the computation. That is a useful alternative direction for designing information flow in Transformers. Whether it scales reliably to larger models, different data, and production settings remains an open question requiring fuller experimental scrutiny.

Hugging Face Daily Papers

Comments

Checking sign-in status...

Loading comments...

Related articles