Looped transformers are probably the biggest breakthrough in model architecture since MoEs.
Akshay 🚀
Visit on X@akshay_pachaar293K followers
29,903 views
Looped transformers are probably the biggest breakthrough in model architecture since MoEs.
More and more models now use them.
Inkling 2 Mini and GLM-5.4 both loop their layers, and OpenAI's Astra is rumoured to do the same.
Let's understand how they work:
In a standard transformer, each layer has its own weights and runs once per token. To make the model think in more steps, you add more layers, and every new layer adds weights that have to sit in memory.
A looped transformer reuses layers instead. It takes a block of layers from the middle of the model and runs it several times in a row, feeding the output of each pass into the next one.
So a 12-layer block that runs three times does the work of 36 layers while storing weights for only 12.
The layers at the start and end still run once. The first ones turn the input text into the numbers the model works with, and the last ones turn the final result into the next token, which only needs to happen once.
Before each pass, the model adds the original input back in. This keeps the prompt in view on every loop and stops the internal values from growing with each pass.
Reusing the same weights still helps, because each pass works on a state the previous pass already changed. The block learns one general reasoning step, and every extra pass applies that step again.
That is why the gains show up on reasoning tasks. When Inkling went from one pass to three, its scores on Humanity's Last Exam and BrowseComp more than doubled.
Its score on a pure knowledge test barely moved, because facts live in the weights and extra passes add none.
It also suits local hardware. Laptops and phones run out of memory long before they run out of compute, and extra passes reuse weights that are already loaded.
The visual below compares the two. The standard model runs 36 blocks once each, while the looped one runs an 8-block input block once, a 20-block recurrent block k times, and an 8-block output block once.
Hugging Face has also written a really great guide on this, with small experiments where you can watch the loop work pass by pass:
In case you want to learn how LLM inference works, I've written a first-principles tour of what happens between a prompt and a streamed response. The article is quoted below
Comments
Comments from the original post on X (Twitter)
No comments yet
