cd /news/large-language-models/twenty-eight-layers-run-twice · home › topics › large-language-models › article
[ARTICLE · art-175367] src=gautamparab.com ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Twenty-Eight Layers, Run Twice

Z.ai published "Toward Generalized Coding with Our First Loop Transformer" on 23 November, launching GLM-5.4, which loops 28 layers of the GLM-5 base model for two iterations so that a group of weight-shared layers runs multiple times to deepen the network without raising the parameter count. Z.ai claims GLM-5.4 reaches "intelligence levels comparable to 2T-3T parameter models" and reports a 30B controlled ablation where the looped version gained 11.3 points on AIME25 and 8.7 on GPQA-Diamond with only ~10% more training compute. The analysis argues the ablation holds parameter count constant rather than compute, since looping 28 of GLM-5's 78 layers means 106 layer passes per token instead of 78 — 36% more layer work — so the shorter outputs do not represent savings.

recommendation

When evaluating looped or weight-shared architectures, compare against equal compute per token, not equal parameter count; GLM-5.4's 28-of-78 loop adds 36% more layer passes per token.

more in playbook: Inference and self-hosting
read9 min views2 publishedNov 23, 2026
Twenty-Eight Layers, Run Twice
Image: Gautamparab (auto-discovered)

On 23 November Z.ai published “Toward Generalized Coding with Our First Loop Transformer,” the launch post for GLM-5.4. The architecture is the news. In a standard transformer each layer runs once per token. In GLM-5.4, the post says, “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.” Concretely: “GLM-5.4 loops 28 layers of the GLM-5 base model for two iterations.”

The post makes two claims about what this buys. The first is that GLM-5.4 reaches “intelligence levels comparable to 2T-3T parameter models.” The second is a controlled experiment on a 30B model, where “with identical parameter counts and only ~10% more total training compute, the looped version showed clear gains.” It also says the looped model writes shorter answers, so “part of the reasoning shifts from explicit output tokens into the implicit depth of the loop.”

I think the engineering is real, and the ablation discloses more than most launches do. But the control in that ablation holds the wrong thing constant, and once you correct for it the shorter answers stop looking like savings.

What the ablation shows #

The table in the post compares a 30B model “with the exact same architecture as our 750B base” against its looped version. Both were “evaluated on the 30B model after 200K long-context SFT, with thinking mode enabled.”

Benchmark Baseline + Loop Change Avg. output length
AIME25 19.17 30.42 +11.3 −635 tokens (−2%)
GPQA-Diamond 47.58 56.26 +8.7 −2,473 tokens (−11.7%)
| AA-LCR | 40.33 | 47.67 | +7.3 | −539 tokens (−9.7%) | 
| MMLU-Pro | 71.65 | 75.05 | +3.4 | −863 tokens (−14.9%) | 

| IFBench | 50.20 | 53.47 | +3.3 | −763 tokens (−13.0%) |

The pattern the post points out is real: the biggest jumps are on math and science reasoning, the smallest on MMLU-Pro and instruction following. Two details complicate the numbers.

AIME25 is 30 problems, so 11.3 points is about three and a half problems’ worth. The post doesn’t say how many times each problem was sampled. Both scores divide out to whole numbers over 240 answers (46 and 73), which fits eight samples per problem, but that is my inference, not something Z.ai states.

And the length column doesn’t quite match the prose. The text says “across most benchmarks like GPQA-Diamond and MMLU-Pro, average output length drops by 10–14%.” In the table MMLU-Pro drops 14.9% and AIME25, the benchmark with the largest gain, drops 2%. Working back from the percentages, the AIME25 answers average roughly 32,000 tokens and the GPQA ones about 21,000, so the loop barely shortened the longest answers in the table.

Identical parameters, different work #

“Identical parameter counts” is true and it is the wrong control. A loop doesn’t add weights; it reuses them. That is exactly why it adds compute: every token goes through the looped layers twice.

GLM-5’s published configuration has 78 transformer layers. Its model card puts it at 744B parameters with 40B active. GLM-5.4 runs 28 of those layers a second time, so a token now takes 106 layer passes instead of 78. That is 36 percent more layer work per token, both in the forward pass and in the sequential chain the hardware has to walk through before the next token can start.

Two caveats on my arithmetic. The second pass is cheaper on attention than the first, since it reuses the first pass’s sparse attention indices and shares most of its KV cache, and the post says “an extra loop only costs one sliding window of KV cache rather than a full context cache.” That is a memory saving. The mixture-of-experts feed-forward work in each looped layer still runs again. And the post gives the 28-of-78 split only for the 750B model. It doesn’t say what fraction of layers the 30B ablation loops; below I assume the same share.

The same unrolling gives a sanity check on “2T-3T.” If you treat the second pass as 28 extra layers with their own weights, 744B becomes about 1T. So the claim has to rest on benchmark results against unnamed larger models, and the post publishes no table for it.

Shorter answers, more work per answer #

This is where the “fewer tokens” finding changes meaning. If each output token costs about 36 percent more layer work and the answer is 11.7 percent shorter, the answer as a whole costs about 1.36 × 0.883 ≈ 1.20 times as much. Applying the same correction to every row:

Read closely, the post’s phrasing admits this: reasoning “shifts” into “the implicit depth of the loop.” Shifted work still has to be done. What the table doesn’t let you do is compare the looped model against an unlooped one that got the same extra 20 to 33 percent of compute some other way, by thinking longer, sampling twice, or being a wider model. That is the comparison that would tell you whether looping is the efficient way to spend the extra work or just one way.

The post also notes that the 30B looped model had “~10% more total training compute” than the baseline. It doesn’t say whether the unlooped baseline got a matching round of continued training. That matters for a reason I’ll come back to.

Neural networks have been run in loops before #

The post credits the 2018 Universal Transformer and recent recurrent-depth work, and concedes that “looped models trained from scratch still lag behind unshared models under the same pre-training compute budget.” The idea is older than that, and so is the control problem.

In 2015 Ming Liang and Xiaolin Hu added recurrent connections to every convolutional layer of an image classifier and unrolled them for one to three iterations. Their recurrent model, RCNN-96, had 0.67 million parameters; the feed-forward control, WCNN-128, had 0.6 million. They matched parameters, as Z.ai did, and the recurrent model won. But they also tested a plain weight-shared stack, which is closer to a straight loop. They wrote that “simply increasing the depth of CNN by sharing weights between layers can result in the same depth and the same number parameters as RCNN, but such a model may not compete with RCNN in performance.” With more iterations, that stack got “lower training error but higher testing error.” It overfit. Reusing weights helped only in the version that kept feeding the original input back in at every step.

GLM-5.4’s gated updates look like an answer to the same problem: the post says that without them, overwriting hidden states causes “activation norms to blow up across iterations.” But the old result is a reminder that iso-parameter wins depend on details of how the loop is wired, and don’t come free with the idea.

The sharper warning is from 2024. Jonathan Chagnon, Markus Hagenbuchner, Ah Chung Tsoi and Franco Scarselli replaced ordinary convolutional layers with recurrent ones in three networks, balancing weights “for a fairer comparison.” The swap “significantly improves the performances of the 4-CL model, but not those of ResNet or DenseNet.” When they turned the shallow model into a ResNet one step at a time to see where ResNet’s advantage came from, they found “the performance improvement is largely driven by the training regime.” The architectural steps “only account for about 6 point of the observed accuracy improvement.”

So the 10 percent matters. In a converted model, the extra round of training is part of the treatment. A control that gets the same continued training without the loop is the only way to separate the two.

Depth shows up as latency #

There’s a cost the ablation can’t capture at all, because it’s about time, not accuracy. A second pass through 28 layers is sequential: the second pass can’t start until the first is done, and the next token can’t start until both are.

Langerman, Johnson, Buettner and George made this point about convolutional networks in 2020. Across 37 networks on eight devices, they found that “the total number of floating-point operations (FLOPs) in a model is an inconsistent predictor of real execution time” on GPUs. What predicted it was the longest chain of dependent operations, because “the data dependencies at a model-level will still result in a serial execution.” A loop lengthens that chain by design.

Z.ai reports that GLM-5.4 “reaches up to 200 tokens/s during off-peak hours and maintains 70–80 tokens/s at peak load,” and that it fused kernels to cut “the fragmented overhead amplified by looping.” It doesn’t give the same figure for GLM-5.3 on the same hardware, which is the number that would show what the loop costs in wall-clock time.

What I’d want to see #

I don’t think any of this makes the architecture a bad bet. Ruben van Bergen and Nikolaus Kriegeskorte argued in 2020 that recurrence is a way to fit deeper computation into fixed hardware, and reusing a trained base instead of pretraining from scratch is a sensible way to try it at 750B. The post is also candid about the limits, including a tendency “to get caught in overly long ‘marathon thinking’ loops.”

But “identical parameters” is a storage claim, and the question a user or an operator has is about compute and time. Three numbers would settle it:

  1. A compute-matched control: the unlooped 30B, given the same continued training, run with enough extra thinking budget to match the looped model’s layer work per answer.
  2. The fraction of layers looped in the 30B ablation, and sample counts per benchmark.
  3. Tokens per second for GLM-5.3 and GLM-5.4 on the same hardware at the same load.

Until then, the honest reading of the table is that the looped model spends roughly a fifth to a third more work per answer and gets 3 to 11 points for it. That might be a good trade. The post just doesn’t show the alternatives.

I ran into the same gap between stored and used parameters in

September, with DeepSeek’s V4.1-Flash card. References

1. Z.ai. “Toward Generalized Coding with Our First Loop Transformer” (GLM-5.4). 23 November 2026. [z.ai/blog/glm-5.4](https://z.ai/blog/glm-5.4)
2. Z.ai. GLM-5 model card and `config.json` (78 hidden layers; 744B parameters, 40B active). Hugging Face, February 2026.[huggingface.co/zai-org/GLM-5](https://huggingface.co/zai-org/GLM-5)
  1. Liang M, Hu X. “Recurrent convolutional neural network for object recognition.” 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) , pp. 3367–3375, June 2015.doi:10.1109/CVPR.2015.7298958
  2. Chagnon J, Hagenbuchner M, Tsoi AC, Scarselli F. “On the effects of recursive convolutional layers in convolutional neural networks.” Neurocomputing 591:127767, July 2024.doi:10.1016/j.neucom.2024.127767
  3. Langerman D, Johnson A, Buettner K, George AD. “Beyond Floating-Point Ops: CNN Performance Prediction with Critical Datapath Length.” 2020 IEEE High Performance Extreme Computing Conference (HPEC) , pp. 1–9, 22 September 2020.doi:10.1109/HPEC43674.2020.9286182
  4. van Bergen RS, Kriegeskorte N. “Going in circles is the way forward: the role of recurrence in visual inference.” Current Opinion in Neurobiology 65:176–193, December 2020.doi:10.1016/j.conb.2020.11.009
── more in #large-language-models 4 stories · sorted by recency
── more on @z.ai 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/twenty-eight-layers-…] indexed:0 read:9min 2026-11-23 · —