Skip to main content
Loop Architecture Explained: Why Looped Transformers Are Suddenly Everywhere

Loop Architecture Explained: Why Looped Transformers Are Suddenly Everywhere

· 14 min read
Technical writer

Within three days in November 2026, two very different AI labs shipped major models built around the same architectural bet. On November 20, Thinking Machines Lab released Inkling 2 Mini, a 26.4B open-weights multimodal model sized to run locally on a 32GB Mac. On November 23, Z.ai launched GLM-5.4, a 750B flagship coding model.

Both use a loop architecture — often called a looped transformer, LoopLM, or recurrent-depth transformer. Instead of running a token once through a tall stack of unique layers, the model runs a shared block of layers multiple times before producing its next token. After eight years as an academic curiosity, looping just crossed over into production at both ends of the hardware spectrum.

What loop architecture actually is​

A standard decoder-only transformer is a fixed assembly line. Every token enters at layer 1, passes once through layers 2, 3, and so on up to layer L, and exits as a next-token prediction. Every layer has its own unique weights. If you want the network to perform more sequential steps of computation per token, you stack more layers — which means more parameters, more VRAM, and more bytes moved from memory on every generated token.

A looped transformer breaks the 1:1 link between physical parameters and computational depth. Most recent implementations split the model into three stages:

  1. Entry layers (prelude): Run once to turn token embeddings into initial hidden representations.
  2. A looped core block: A middle stack of layers whose weights are reused T times in a row. The hidden state coming out of the block gets fed back into the bottom of the same block for another pass.
  3. Exit layers (coda): Run once to project the refined hidden state back into vocabulary logits.
Standard Transformer (e.g., 78 layers)          Looped Transformer (e.g., GLM-5.4)

Input token Input token
│ │
[ Layers 1..78 ] (run 1×) [ Early layers ] (run 1×)
│ │
Next token ┌─►[ 28-layer core ]──┐
│ (run 2×) │
Physical layers: 78 └─────────────────────┘
Effective depth: 78 │
[ Final layers ] (run 1×)
│
Next token

Physical layers: 78
Effective depth: 106

Inkling 2 Mini takes the same idea even further at small scale: it has 24 physical decoder layers, runs layers 0–5 once, loops layers 6–17 three times with shared weights, and runs layers 18–23 once. On disk, it is a 24-layer model. Computationally, every token gets 48 layers of sequential processing (6 + 3 × 12 + 6).

Why loop architecture is interesting​

Reusing weights sounds like a simple compression trick, like sharing parameters to save disk space. That is only a fraction of why labs are suddenly adopting it. Four deeper pressures are driving the shift.

1. Separating memory storage from reasoning depth​

Parameters in a transformer do two very different jobs: they store world knowledge (syntax, facts, APIs) and they execute step-by-step computation (tracking state, composing constraints, following logic). In a standard model, scaling one forces you to scale the other.

Controlled experiments from ByteDance Seed's Ouro paper showed that looping does not magically cram more memorized facts into a small model. Instead, it dramatically improves knowledge manipulation — combining facts the model already knows across multiple reasoning hops. That maps directly onto real developer workloads. When a coding model introduces a subtle bug across four files, it rarely forgot how async/await works. It ran out of serial computation depth to trace the state transitions before committing to a token.

2. Thinking in latent space instead of burning text tokens​

Over the past two years, the dominant way to get better reasoning has been explicit Chain-of-Thought (CoT): train models with RL to write thousands of "thinking" tokens before answering. CoT works because it turns the context window into external scratchpad memory.

It is also a clunky bottleneck. Every intermediate thought has to be compressed down to a discrete English token, appended to the KV cache, and re-read by attention on the next step. Many geometric, spatial, algorithmic, and code-structure problems do not serialize cleanly into prose.

Looped transformers let the model iterate inside continuous, high-dimensional hidden vectors before emitting a single token. That does not replace CoT — GLM-5.4 and Ouro-Thinking still pair looping with explicit reasoning — but it reduces how much babbling the model needs to do. In Z.ai's 30B scaling tests for GLM-5.4, adding the loop cut average output lengths by 10% to 14% on GPQA-Diamond and MMLU-Pro while raising accuracy.

3. Working around the memory-bandwidth wall​

During single-user or small-batch decoding, LLMs are overwhelmingly memory-bandwidth bound, not compute bound. Your GPU or Apple Silicon chip spends most of its time streaming gigabytes of model weights from memory into compute units, doing a quick matrix multiply, and throwing them away.

When you loop a block of layers, you keep the same weights resident and do more useful arithmetic per gigabyte of parameter storage. You get the reasoning depth of a much taller model without paying its VRAM footprint. That is how Thinking Machines fit a 48-effective-layer multimodal coding model into a ~20 GB checkpoint that runs comfortably on a 32GB laptop, and how Z.ai kept GLM-5.4 at 750B parameters while targeting the reasoning ceiling of 2T–3T parameter models.

4. A third axis for test-time compute​

Until recently, scaling a model meant turning one of two dials: more parameters (bigger dense or MoE models) or more output tokens (longer reasoning chains). Loop depth adds a third dial: more serial computation per token.

In research architectures like Huginn, Mixture-of-Recursions, and Ouro, that dial does not even have to be fixed. Easy tokens like punctuation or boilerplate syntax can exit after one pass, while hard tokens — a tricky branch condition, a math pivot, a tool call — loop deeper before committing.

How Z.ai made it work at 750B scale in GLM-5.4​

A naive loop (for _ in range(2): x = layers(x)) breaks down fast at frontier scale. Activation norms drift and explode when hidden states are overwritten across passes, training from scratch wastes compute, and naive caching doubles your KV memory bill.

Z.ai's GLM-5.4 technical post is notable because it documents the exact engineering compromises required to ship a Loop Transformer at 750 billion parameters.

First, Z.ai did not train GLM-5.4's loop from scratch. Across validation runs at 1B, 4B, 30B, and 750B scales, they found that looped models trained from scratch trailed standard unshared models under the same pretraining compute budget. Instead, they took an already-pretrained GLM-5 base model, looped 28 middle layers twice (pushing effective depth from 78 to 106 layers), and adapted it via continued training. On their 30B testbed, this added roughly 10% training compute while delivering noticeable gains in math, scientific reasoning, and long-context tasks.

Second, to keep the 750B model stable and affordable to serve, Z.ai introduced three structural mechanisms:

  • Gated progressive updates: Independent per-token gates regulate how much each loop iteration writes back into the residual stream, preventing activation norms from blowing up across passes and keeping representations inside the scale downstream layers expect.
  • Sparse attention index reuse: Instead of recomputing global sparse attention patterns from scratch on the second pass, the second loop reuses the sparse attention indices and global KV cache selected during the first pass.
  • A local sliding-window cache: Alongside that reused global cache, the second pass maintains a lightweight local sliding window for fresh representations. The model attends to both first-pass global context and refined local states without doubling the full 1M-token KV cache.

Combined with native vision support and a 1M-token context window, Z.ai positioned GLM-5.4 for "generalized coding" beyond standard web apps — covering 3D shaders, game engines, CAD modeling, and video logic. It launched first inside Z.ai's GLM Coding Plan (ZCode and Z.ai Chat), with API access and open weights slated to follow safety evaluations.

Everything else recent using loop architecture​

GLM-5.4 is the largest public Loop Transformer so far, but it did not appear out of nowhere. Over the past 18 months, looped architectures progressed from university proof-of-concepts to compact open-weight releases to frontier-scale models.

Model / PaperOrganizationDatePhysical → Effective DepthScaleKey Contribution
Universal TransformersGoogle BrainJul 2018Shared block, dynamic haltingResearch scaleOriginal blueprint combining weight-shared attention with adaptive halting
Huginn-3.5B (huginn-0125)UMD / LLNLFeb 2025Prelude + looped core + Coda (variable, e.g., 32+ steps)3.5BRandom-depth pretraining; showed latent test-time scaling without CoT data
Mixture-of-Recursions (MoR)Google DeepMind, KAIST, MilaJul 2025Shared block, token-level routing135M–1.7BPer-token dynamic loop depth and selective KV caching for active tokens only
OuroByteDance Seed & collaboratorsOct 2025Shared stack, up to 4 recurrent steps1.4B, 2.6BPretrained on 7.7T tokens with entropy-regularized exit; matched dense models up to 12B
Nanbeige4.2-3BNanbeige LLM LabJul 202622 layers × 2 → 44 layers3BTrained from scratch on 28T tokens; strong agentic/tool-use scores vs. 9B–12B models
LoopCD / Apple LoopCDAcademic & Apple researchersSep–Oct 2026Inference-time decoding over existing LoopLMsVariousContrasts earlier and final loop passes (training-free) to boost accuracy or halve loops
Inkling 2 MiniThinking Machines LabNov 202624 layers (middle 12 × 3) → 48 layers26.4B total (3.4B base / 5.4B eff. active MoE)Apache 2.0 multimodal local model (~20 GB NVFP4/MXFP8); 48.2% DeepSWE v1.1
GLM-5.4Z.ai (Zhipu AI)Nov 202678 layers (28 × 2) → 106 layers~750BFirst frontier-scale Loop Transformer via continued training + gated updates & cache reuse

A few of these deserve closer attention because they highlight very different bets on how to build with loops.

Inkling 2 Mini: Looped MoE for local hardware​

Released by Mira Murati's Thinking Machines Lab on November 20, 2026 under an Apache 2.0 license, Inkling 2 Mini combines sparse Mixture-of-Experts (routing 8 of 128 experts per layer) with three-pass middle-layer looping.

To keep signals clean across three passes through layers 6–17, Inkling 2 Mini uses inter-pass messages, attention-residual queries, and learned loop controllers. It was trained natively in low-precision formats (NVFP4 for routed experts and MXFP8 for the final layers), bringing the checkpoint down to roughly 20 GB with a 1M-token context window.

The payoff shows up in agentic coding benchmarks: 48.2% on DeepSWE v1.1 (leading open-weights models under 100B parameters), ~78% on SWE-bench Verified, and general intelligence scores comparable to ~27B dense models at a fraction of the memory footprint. Just as important for adoption, Thinking Machines shipped day-zero support across vLLM, SGLang, llama.cpp, and Unsloth.

Nanbeige4.2-3B: The from-scratch counterexample​

Z.ai argued that looping from scratch underperforms under equal compute. In July 2026, Nanbeige LLM Lab's Nanbeige4.2-3B (paper) showed the flip side: if you are willing to throw a massive token budget at a very small model, from-scratch looping works remarkably well.

Nanbeige4.2-3B loops its entire 22-layer stack twice (44 effective layers) and was pretrained from scratch on 28 trillion tokens. The team found that two passes hit the sweet spot, retaining roughly 75% of standard token efficiency while pushing a 3B model into the 9B–12B performance bracket on tool-use and agentic tasks. It also served as an early reality check on ecosystem friction: at launch, popular inference stacks (transformers, llama.cpp, vLLM) needed explicit patches to handle looped KV routing without crashing on shape mismatches.

The OpenAI "Astra" rumor and the hidden-reasoning debate​

Loop architecture hit mainstream tech news in September 2026 when The Information reported that OpenAI's frontier "Astra" model used recurrent depth. The report immediately set off an AI safety argument over "unmonitorability": if frontier models shift reasoning from readable Chain-of-Thought text into looped latent vectors, safety monitors that scan thinking traces can no longer see what the model is planning.

OpenAI Chief Scientist Jakub Pachocki pushed back, saying the computational depth of OpenAI's frontier models remained bounded within roughly a factor of two of GPT-4 and warning against "a race into unmonitorability kicked off by confused reporting." Sebastian Raschka's deep dive helped cool the temperature too, pointing out that looped blocks are an efficiency architecture rooted in 2018's Universal Transformers rather than a scheme to hide thoughts, and that shorter visible reasoning traces often just mean a stronger model backtracks less.

Inference-time tricks: LoopCD​

Once you have a model that produces intermediate predictions at every loop step, you get a neat bonus for free. In September and October 2026, two papers — LoopCD and a follow-up from Apple researchers, Decoding Looped Transformers Better for (Almost) Free — showed that you can run contrastive decoding between an earlier loop pass and the final loop pass without any extra training. Comparing what the model thought on pass 1 versus pass 4 sharpens math and coding accuracy, and in some setups lets you cut the number of loops in half without losing quality.

The catch: Why every model isn't looped yet​

If looping gives you deeper reasoning for the same weight footprint, why didn't every lab adopt it in 2024? Because the trade-offs are real, and they show up right where production inference hurts most.

  • KV-cache overhead does not shrink automatically. Sharing weights saves parameter memory, not KV-cache memory. If each loop iteration stores its own keys and values, looping 3× triples your KV cache — which is fatal at 1M context. That is why GLM-5.4 had to engineer sparse cache reuse plus a sliding window, and why Mixture-of-Recursions only caches active tokens.
  • It still costs real FLOPs and serial latency. Weight reuse helps memory-bandwidth-bound local inference (small batch sizes). In high-throughput cloud serving with large batches, GPUs are already compute-bound — running layers twice still burns extra compute and adds sequential time per token.
  • Training stability is unforgiving. Feeding hidden states repeatedly through the same weights amplifies norm drift and gradient instability. Almost every successful 2026 release needed custom plumbing — per-token update gates in GLM-5.4, attention-residual queries and inter-pass messages in Inkling 2 Mini, or entropy-regularized objectives in Ouro.
  • Serving infrastructure assumes linear layers. Most inference kernels, quantization tools, and graph compilers assume layer i executes once and owns one KV buffer. Inkling 2 Mini cleared that hurdle by landing upstream patches before launch; smaller teams still feel the pain.
  • Interpretability gets harder. Even without the Astra hype, moving part of a model's deliberation from text tokens into recurrent hidden states really does make debugging and safety monitoring harder to inspect with off-the-shelf tools.

Where this goes next​

For the past three years, LLM progress mostly leaned on two scaling levers: make the model larger (usually via sparse MoE) and let it generate longer Chains of Thought.

Loop architecture adds a practical third lever: let the same weights think more than once per token. What makes November 2026 a genuine inflection point is that the technique now has proof points at opposite extremes — a 20 GB open-weights local coding model from Thinking Machines Lab and a 750B frontier coding model from Z.ai, shipping within 72 hours of each other.

Looping is unlikely to replace MoE or Chain-of-Thought. Instead, just as MoE became a default ingredient rather than a gimmick, looped middle blocks look poised to become a standard part of the modern transformer recipe — especially anywhere VRAM is tight, context windows are huge, and multi-step reasoning matters more than raw memorization.

About the author

AS
Al SmithTechnical writer

Al Smith is a software engineer and technical writer for Ritza and contributor to TechStackups.com