Hacker News new | ask | show | jobs
by LPisGood 15 days ago
This is the first I’m hearing of a looped model. What is it?
6 comments

It's a pretty broad bucket that contains a few different research lineages, but the gist (when talking about Transformers) is that instead of stacking 12 latent blocks, you can stack 4 and let them loop 3 times.

That's just a general simplification though. One of the key motivators in this general area of research is adaptive latent reasoning, meaning in theory, some tasks only require 2 loops and some require 8.

There's a lot of different approaches here and many of them approach the problem from different traditions. Some looped transformers use a fixed loop count, others follow after deep equilibrium models and iterate towards a fixed point or some other stopping mechanism.

Some fun reading if you're interested in this field:

- TinyRecursiveModels - Blew up a couple of years ago when it performed really well on ARC AGI 1 using a comparatively small model with a large task-level table of embedding prefixes. https://github.com/samsungsailmontreal/tinyrecursivemodels

- Sebastian Raschka's piece on the general architecture patterns we see today: https://sebastianraschka.com/llm-architecture-gallery/looped...

A couple other benefits aside from adaptive reasoning:

- It lets the model do more of its reasoning without emitting tokens. This is helpful both because a) insanely long token streams are annoying, but more importantly b) long reasoning streams eat context. It's not a direct performance enhancement, since each token is more expensive to generate (you need to loop!), but it reduces spam in the context window which likely translates into some degree of intelligence win for multi-turn since the model won't have to sift through as much noise, and it'll need to compact less frequently per task which is also likely an indirect intelligence win and an indirect cost/perf win per task: post-compaction re-reads of files are basically useless spam to an inference engine, so if you could do the entire task within one context window, you'd hit the engine less per task.

- It lets potentially every token use more computation, instead of keeping the test-time-compute scaling purely in the upfront CoT domain. While it's helpful to think upfront, it can be useful to think mid-stream too.

Overall it's potentially much better.

Yes, and for others' reference, Astra is the one SOTA model known to be looped.

Looping is controversial among the alignment/safey crowd, because the more models can think without printing a trace, the less understandable they might be to us.

> Looping is controversial among the alignment/safey crowd

This crowd is larping. Looping is functionally equivalent to having a deeper-stacked network (more layers) while saving memory, since you reuse the same layers more than once.

True, but I don't think there's much threat of them making frontier models 10x deeper with unique weights so soon. More depth requires more params.

It's seen more as a replacement for text reasoning because it's a way to do more compute for your existing vram (roughly), and to allow adjustable amounts of "thinking". Just like reasoning.

I wouldn't rule out that it's controversial because it potentially reduces the amount of VRAM required for equal performance, meaning less "moat" in having hoarded all the hardware.
It's basically a generalization of the finding that repeating certain layers in an LLM makes it smarter: https://note.com/shi3zblog/n/nbb931d23e156?hl=en

But instead of duplicating the layer's weight, you run through them multiple times at runtime.

yeap, and 3x is where i saw the most gain from it too. you can set up most any model to do just this if you can find its reasoning layer boundaries, like qwen3.8 for example, h27-h35 will do it.
Goes a couple or three times through the same weights in a middle layer of the model. Nemotron's Dory pioneered this I think. Seems to give better results with smaller models.

Not sure the impact on kvcache though.

I believe someone found out (DIY style) that looping a couple of layers (found through trial and error) in ordinary LLM's yielded some benefits quite a while ago. it was a surprise as there was no looping during training.

then there was a fully looped model (forget the name) where all the layers were looped (which is an obvious mistake as it's known LLM's have token processing and reasoning stages) and showed some decent results.

and now the concept worked itself into the mainstream.

Yes, the DIY “LLM neurosurgery”: https://dnhkng.github.io/posts/rys/

The Show HN of someone applying this recently, through layer duplication: https://news.ycombinator.com/item?id=47431671

There’s definitely closely related works in research, but it’s not the only example that I think blew up thanks to DIYers.

For example, stretching LLM context window through stretching RoPE was discovered by /u/kaiokendev on the original Llama in 2023, and then improved by various members, including YaRN (from EleutherAI and Nous Research), whose paper acknowledges r/localllama users.

Hi, I'm the blogger who did the RYS work.

Yep, the goal of that research was to figure out why Goliath worked, and is it could be exploited to make more intelligent models. It wasn't trial and error, but a brute-force combinatorial search, with cheap proxy tests.

I think it could be taken a lot further, but needs a lot more compute (which I don't have). The work was done on 2 relatively cheap-at-the-time 4090s back in 2024.

No job offers from the AI labs that now use the idea though. I did get an invite to joins the MATS program, so I'll be flying over from Germany to Berkeley next year :)

There's a lot of interesting work around this going back a little while. It's spiritually inline with the thinking around RNNs, which date back further. The Universal Transformer (2018) is the first research paper I'm familiar with that really pushed the idea as applied to transformer models, but I'm sure there are others (as is the case with everything in deep learning, someone tried it 8 years before you using different nomenclature).

If you're curious, it's a very cool paper! https://arxiv.org/html/1807.03819v1

looped transform is such a simple and straightforward idea. a couple of years ago i was thinking about RNN, transformer, the residual flow, and other stuff. and the idea of "why don't we just repeat some of the blocks?" just naturally popped into my head. and i am by no means an machine learning expert. advanced ideas like the gated deltanet etc. fly right over my head.

so this is how transformers work: there is a residual flow which you can think as a flow of information, from the input of the network to the output of the network. each transformer block does pattern matching on information from upstream, adds new information to it and pass it on to the downstream. you can conceptualize this as the network building information from lower level to the higher level: tokens become words, words become phrases, then sentences, then abstract ideas, etc. but the thing is what "level" some information is on quickly becomes muddy. word/phrase/sentence is pretty clear cut, but abstract ideas are not. because transformer goes in a straight line from input to output, this means there will be a lot of duplicate in the middle of the network. and there are a lot of evidences of this, for example, when you quantize a LLM, the middle of the network can usually take way more quantization without much impact on the network's performance.

the solution comes out of the problem quite straightforwardly, since there are duplicates, let's just repeat them.

Supposedly GPT6 Astra uses this as well.
Nvidia's Dory is another (dense 9B) example.