From 'Attention Is All You Need' to Looped Transformers: DCA, Attention Residuals, and the Road to Small Looped Models
Sources: Vaswani et al. 2017; Heddes et al. 2025 (arXiv:2502.06785); Kimi Team (Attention Residuals, 2026); Z.ai GLM-5.4 (2026-11-23); Thinking Machines Lab Inkling 2 Mini (2026-11-20); SenseTime SenseNova-Loop-9B (2026).
1. Executive summary
The Transformer of 2017 made depth cheap by stacking unique layers, each run once. Nine years of follow-ups have attacked the same cost problem from different angles:
- DeepCrossAttention (DCA, 2025) attacks residual dilution: instead of summing previous layer outputs equally, it learns input-dependent, depth-wise mixing — and shows a 30-layer DCA beating a 42-layer transformer.
- Attention Residuals (Kimi, 2026) generalizes the residual stream itself into depth-wise attention over blocks, so each layer reads a learned mix of earlier blocks instead of one running sum.
- Looped Transformers (2026, production) break the 1:1 link between parameters and compute depth: a shared middle block runs 2–3 times per token, giving ~1.3–1.5× depth per parameter with no new weights.
The 2026 result that matters for small models: looping is now a retrofit, not a from-scratch recipe. Z.ai converted a pretrained GLM-5 base into a looped 750B model with continued training; Thinking Machines derived Inkling 2 Mini (26.4B) from its mainline scaling ladder. Both report that looped models trained from scratch lag standard models at equal pretraining compute.
So the answer to "when do we get SLM looped models like GLM-5.4?" is: we already have them (Inkling 2 Mini at 26B, SenseNova-Loop-9B at 9B), and the remaining gap — 1–7B on-device models — is an engineering and distillation problem, not a research blocker. My estimate: routine 7B-class looped checkpoints within 1–2 quarters, 1–3B on-device within 6–12 months.
2. The lineage
2.1 "Attention Is All You Need" (2017)
The original Transformer replaced recurrence with self-attention plus residual connections: x_{t+1} = x_t + Sublayer(x_t). The residual sum is what made deep stacks trainable. It is also the bottleneck everything below attacks.
2.2 DeepCrossAttention (2025)
DCA replaces the uniform residual sum with three learnable, input-dependent GRN instances per block (producing Q/K/V), so attention inputs are composed from arbitrary previous depths. Empirically: lower perplexity for the same params, ~3× faster to a target perplexity with k = 2, fewer loss spikes, and safe retrofitting because it is identity-equivalent at init.
2.3 Attention Residuals (2026)
Inkling 2 Mini uses block attention residuals: instead of one running sum, each layer reads a learned, input-dependent mix over block outputs (each block sums 6 layers). This is the same family as DCA — depth-wise selective routing instead of uniform accumulation — and is what lets information pass across loops cleanly in a looped model.
2.4 Universal Transformer → looped transformers (2018 → 2026)
The 2018 Universal Transformer proposed weight-shared depth. It stayed an academic curiosity until 2026, when two things changed: (a) retrofitting via continued training made it compute-cheap, and (b) serving stacks (vLLM, SGLang) learned to handle per-pass KV caches.
3. What looped transformers actually do
A standard decoder is an assembly line: layer 1 → 2 → … → L, each with unique weights. A looped transformer splits into three stages:
- Prelude (first N layers): run once — translate tokens into internal representations.
- Looped core (middle M layers, shared weights): run T times, each pass refining the hidden state from the previous pass.
- Coda (last K layers): run once — decode to output.
Total layer applications per token: N + M·T + K. Parameters: N + M + K. So you get ~1.3–1.5× depth per parameter.
Concrete 2026 layouts:
| Model | Stored layers | Looped block | Passes | Layer apps/token | Scale |
|---|---|---|---|---|---|
| GLM-5.4 | 78 | layers 27–54 (28) | 2 | 106 | 750B |
| Inkling 2 Mini | 24 | layers 6–17 (12) | 3 | 48 | 26.4B (3.4B active) |
| SenseNova-Loop-9B | 32 | layers 4–27 (24) | 2 | 56 | 9B |
GLM-5.4 adds three engineering fixes to make the second pass affordable at 750B: gated progressive updates (per-token gates; first pass writes conservatively, second pass writes fully), a shared KV cache with a 128-token sliding window, and reused sparse-attention indices.
Inkling 2 Mini instead uses cross-loop messages: all three passes start from the prelude output, and pass p+1 reads the previous pass only through gated messages (separate Q/K/V/MoE readers with rank-64 gates). Its variable-loop research checkpoint lets you choose pass count at inference time (1–3, or up to 10 in research).
4. Why this is a residual-connection story
Looping only works if information survives repeated passes without exploding. Two of the three 2026 designs borrow directly from the DCA/Attention-Residuals family:
- GLM-5.4's gates are a per-token residual write control — exactly the "don't blindly overwrite the residual stream" lesson from DCA's input-dependent weighting, now applied across time (passes) instead of across depth.
- Inkling 2 Mini's Attention Residuals replace the single running sum with depth-wise attention over block outputs, so cross-loop messages can be read selectively rather than accumulated.
In other words: DCA (2025) showed that selective residual mixing beats uniform sums. Looped transformers (2026) need the same property across passes. The two ideas are converging.
5. The "when" question: SLMs with loop architecture
Already here (SLM scale)
- Inkling 2 Mini — 26.4B total, 3.4B active, Apache 2.0, runs on a 32 GB MacBook. Open weights, day-0 vLLM/SGLang support.
- SenseNova-Loop-9B — 9B, Apache 2.0, with mHC (two residual streams) inside the loop.
Together, 9–26B looped, open-weight models are already shipping.
So the premise "we don't have SLM looped models yet" is false as of late November 2026. What we do not yet have is 1–7B on-device looped models and open GLM-5.4-class weights.
Why retrofitting, not from scratch
Both labs report the same finding: looped models trained from scratch trail standard models under the same pretraining compute budget. The economical route is:
- Take a strong pretrained base.
- Loop a middle block.
- Continue-train (Z.ai: +~10% training compute on a 30B testbed for +11.3 AIME25 / +8.7 GPQA-Diamond).
- Add gates + cache sharing for serving.
This means SLM looped models will appear when a lab decides to retrofit an existing SLM base, not when someone trains one from scratch. The gating factors are organizational, not technical:
- Open weights (GLM-5.4 weights are pending safety hardening).
- Continued-training recipes at small scale (Z.ai validated 1B/4B/30B/750B; Inkling derived from its mainline ladder).
- Serving support (already there: vLLM, SGLang, llama.cpp, MLX).
My estimate
| Target | Estimate | Basis |
|---|---|---|
| 7B-class open looped checkpoint | 1–2 quarters | Retrofit of existing 7B bases; recipes proven at 9B |
| 1–3B on-device looped model | 6–12 months | Needs distillation + quantization (NVFP4/MXFP8) recipes to mature; variable-loop for speed/quality tradeoffs |
| GLM-5.4-class open weights | pending safety hardening; likely Q1 2027 | Z.ai stated "planned, after safety hardening" |
| Loop + DCA/Attention-Residuals combined | 2027 | Both ideas in production separately; composition not yet published |
The bottleneck is not architecture — it is continued-training data, distillation, and open-weight release cadence. The serving infrastructure is already ready.
6. Practical paths for builders
- Use Inkling 2 Mini today (26B, Apache 2.0) for local agentic coding; it is the closest thing to a "small GLM-5.4" available now, and vLLM/SGLang support it day-0.
- Experiment with variable-loop checkpoints to trade speed for quality without retraining.
- Retrofit your own SLM: take a pretrained 7B, loop 25–40% of middle layers twice, add per-token gates, continue-train for ~10% extra compute. Gate on reasoning benchmarks (AIME, GPQA, SWE-bench), not just perplexity.
- Combine with DCA/Attention Residuals if cross-pass information flow degrades — the 2026 looped models already use gated residual writes; DCA-style depth mixing is the natural next step.
- Measure monitorability, not just accuracy: Inkling's no-CoT time horizon improved 16 s → 37 s with more loops while CoT stayed legible — a property you should verify for your own looped model.
7. Caveats
- Looped models can get stuck in "marathon thinking" loops (GLM-5.4's own admission); monitor output length.
- Extra pass count raises effective active parameters and KV-cache cost even if stored params stay flat.
- Open weights for the largest looped models are not yet available; plan around API or 9–26B open models.
- From-scratch looped training still underperforms at equal compute — do not start from scratch.
References
- Vaswani, A. et al. Attention Is All You Need. NeurIPS 2017.
- Heddes, M. et al. DeepCrossAttention. ICML 2025, arXiv:2502.06785.
- Dehghani, M. et al. Universal Transformers. ICLR 2019 (arXiv:1807.03819).
- Kimi Team. Attention Residuals. 2026.
- Z.ai. GLM-5.4: Toward Generalized Coding with Our First Loop Transformer. 2026-11-23.
- Thinking Machines Lab. Inkling 2 Mini. 2026-11-20.
- SenseTime. SenseNova-Loop-9B. 2026.
- vLLM. Inkling 2 Mini day-0 support. 2026-11-20.