
What Are Looped Transformers? Why GLM-5.4 and Inkling 2 Reuse Their Layers
Looped transformers run the same layers more than once per token to get more depth without more parameters. What GLM-5.4 and Inkling 2 Mini changed, the trade-offs, and how to read model sizes now.
In a normal transformer, every layer runs exactly once for every token. Layer 1, then layer 2, all the way to the top, and you're done. But in November 2026, two new models did something that sounds almost like cheating: they run some of their layers more than once for every token, using the very same weights.
Let's understand what changes, why labs are doing it now, and what it means when you read a model card.
First, a quick recap: what does a normal transformer do?
A language model is a stack of identical-looking blocks. Each block has two parts: attention, where each token pulls in information from other tokens, and a feed-forward network (MLP), where each token is processed on its own. Around both there is a residual connection, so each layer adds to the meaning instead of replacing it.
Crucially, each block has its own weights. If a model has 80 layers, it has 80 different sets of attention and MLP weights, and each one is used once per token. So in a standard transformer, "more depth" always means "more parameters".
If you want a refresher on this part, I explained the full architecture in the course lecture The Transformer Architecture Explained in Plain English, and attention specifically in the Short What Is Attention Mechanism.
What exactly is a looped transformer?
Z.ai describes it in one sentence in its GLM-5.4 announcement: in a loop transformer, "a group of weight-shared layers runs for multiple iterations, refining the hidden states from the previous pass. This gives us a deeper network without increasing the parameter count."
Here is the idea in a few lines of PyTorch-style pseudocode:
# Standard transformer: every layer runs once
for layer in layers: # e.g. 80 different layers
h = layer(h)
# Looped transformer: a middle block runs several times
for layer in early_layers:
h = layer(h)
for _ in range(num_loops): # e.g. 2 or 3 passes
for layer in looped_block: # the SAME weights every pass
h = layer(h)
for layer in late_layers:
h = layer(h)Think of an editor reading a difficult paragraph. A standard transformer is like passing the draft through a line of different editors, one after another — more editors means more salaries. A looped transformer is like asking the same team of editors to read the draft again, now that they already understand it a little better. You don't hire anyone new. You just spend more time.
Which models are doing this?
- GLM-5.4 (Z.ai, 23 Nov 2026). Z.ai calls it its first flagship model built on the Loop Transformer architecture. It loops 28 layers of the GLM-5 base model for two iterations. Z.ai claims it reaches intelligence levels "comparable to 2T–3T parameter models" — that is a company claim, and the weights are not yet open, so it cannot be independently checked today.
- Inkling 2 Mini (Thinking Machines Lab, 20 Nov 2026). As quoted by Simon Willison, Thinking Machines says it runs the middle layers of the model three times for every token, which lets it "apply more reasoning and reach the right answer with fewer tokens".
Is this a new idea?
No — and Z.ai says so itself. The Universal Transformer (2018) proposed weight-shared depth, and ALBERT (2019) shared parameters across layers to make models much smaller. Research on recurrent depth and looped models has also shown gains at small scales.
What is new is doing it at frontier scale. Z.ai points out a known problem: looped models trained from scratch still lag behind normal models under the same pre-training compute budget. So instead of training from scratch, it converted an already pre-trained base model into a looped one through continued training.
What did Z.ai have to change to make it work?
This is where it gets interesting for engineers, because "just run the layers twice" breaks in practice. According to the GLM-5.4 post:
- Gated progressive updates. Simply overwriting the hidden states on each pass made activation norms blow up. GLM-5.4 adds per-token gates that control how much each pass writes back. Z.ai reports that the first pass learned to write conservatively and the second pass to write full updates — and that harder tokens get more aggressive first-pass updates.
- A hybrid KV cache. A naive implementation keeps a full KV cache for every loop, multiplying memory by the loop count. GLM-5.4's second pass reuses the cache selected in the first pass and keeps only a local sliding window of its own, so an extra loop costs one sliding window of KV cache instead of a full context cache.
- Reusing sparse attention indices. The second pass reuses the attention indices from the first, which Z.ai says performs nearly identically to recomputing them.
Does it actually help?
Z.ai reports a controlled comparison on a 30B model: with identical parameter counts and about 10% more total training compute, the looped version showed clear gains, mostly in math, scientific reasoning and long-context tasks. It also reports that average output length dropped by 10–14% on most benchmarks, mainly from shorter chains of thought. In Z.ai's words, part of the reasoning moves from explicit output tokens into the implicit depth of the loop.
What are the trade-offs?
- Parameters stay the same, compute does not. Every extra loop is extra work on every token. You save memory for weights, not computation.
- Memory still needs care. Without tricks like GLM-5.4's hybrid KV cache, each loop would add its own cache.
- Overthinking. Z.ai lists a limitation: the model tends to get caught in overly long "marathon thinking" loops — though it says this extra reflection still improves accuracy.
- Fixed vs adaptive depth. Today these models use a fixed number of loops. Z.ai says it is exploring adaptive compute, where harder tokens get more iterations. That is still an open question.
What does this mean for you?
The most practical lesson: parameter count is no longer a complete description of a model's size. For years, "70B" told you roughly how much memory and compute a model needs. With looped models, two models with the same parameter count can do very different amounts of work per token. So when you see a new model card, ask three questions:
- How many parameters does it have? (memory for weights)
- How many times do its layers run per token? (compute and speed)
- How is the KV cache handled across loops? (memory at long context)
Conclusion
A looped transformer is the same brain thinking about the same token more than once. It is an old idea that has suddenly become practical at scale, and it changes how we should read "model size". Whether it becomes the default architecture is still uncertain — but after GLM-5.4 and Inkling 2 Mini, it is no longer just a research curiosity.
References
- GLM-5.4: Toward Generalized Coding with Our First Loop Transformer — Z.ai, 23 Nov 2026.
- GLM-5.4: Toward Generalized Coding with Our First Loop Transformer (link post) — Simon Willison, 23 Nov 2026.
- Universal Transformers — Mostafa Dehghani et al., 2018.
- ALBERT: A Lite BERT for Self-supervised Learning of Language Representations — Zhenzhong Lan et al., 2019.