I love the transparency, or at least given technical details, that Zhipu provide - a refreshing change from the locked-down approach of the western companies, and an interesting glimpse into the direction of SOTA LLMs.
Looped Transformers are an obvious direction even if there are still problems to be worked out. The original Transformer is a bit like an unrolled for loop, and rather unnaturally pairs different sets of weights, both for attention and feed forward (knowledge) with different "layers" (aka loop iterations). Far more natural is to strive for something more like our brain's thalamo-cortical loop and association cortex, where "thought" is iterative and there are no restrictions as to what patterns/knowledge get applied when. A similar idea has been explored before ("Universal Transformer", 2019), seemingly going nowhere, but perhaps "necessity is the mother of invention" and compute-starved Chinese companies are finding a way to make it work.
For those who are in computing but not in AI, looped transformers are like chain-of-thought but for every token during every forward pass (based on the number of loops as spec'd in the model architecture), correct?
Does this mean we're opening up a whole new space of efficiency and performance gains even while keeping model sizes (chinchilla-optimal models) constant? This is mind-blowing, though. Reality (the universe) just keeps on giving to our newfound tech tree branch of artificial neural networks.
Speculative execution goes hand in hand with branch prediction, and refers to speculatively executing the instructions that you think (based on branch prediction) will follow a branch before you get there, with the goal of keeping the execution pipeline full. If the branch prediction proves to be incorrect then you need to throw away those speculatively executed results and instead execute the instructions on the path that the branch actually took. With a looped transformer, there is no speculation. You are basically choosing to put some layers in a loop rather than have them duplicated. For example if you previously had 6 layers A B C A B C then you could put (A B C) in a loop and execute the loop twice instead. There is no speculation here - you are always going to execute A B C A B C in either case. The benefit of using a loop is that by avoiding the duplication of layers you are avoiding duplication of parameters and so keeping the model smaller.
A normal transformer has N layers, all of which are run forward for each token. A looped transformer is a bit different. Instead of N layers, it has K. These K layers are then looped, such that the output (not a token) of the first run of these K are fed back into the start of the K layer block. This looping happens until a fixed-point is achieved (i.e another loop results in a noop). At that point, a token is sampled. This means that tokens get different amounts of compute, depending on how challenging they are.
This is confusing to me: this is asserting that those K layers form a system of equations that can be solved using am iterative strategy until guaranteed convergence for each and every possible input sequence. Unless I am.missing a few fundamental mathematical properties aboutbnonlinear systems of equations, I don't understand how this can be true ober the entire input domain.
If the layers are looped, what does it mean that they have an output?
I remember fixed points. An automorphism A on a set S has a fixed point s ∈ S if A(s) = s. If a noop corresponds to a fixed point, then are the elements of the set vectors and the output is a diff from the previous layers? Like, we're looping until we notice a cycle?
You could choose to loop a fixed number of times, or alternatively dynamically determine when to stop thereby achieving variable compute (more loops/compute/thought only when needed).
There has been concern that looping internally rather than emitting a token every N (transformer depth) layers reduces visibility and monitor-ability, so OpenAI have talked about severely limiting it to avoid this concern, and Zhipu are (at least initially) doing the same here - limiting it to a fixed two loops/iterations.
> This sounds like AI 2027 losing COT and control of models, but irl and in real time
It's only a problem in the frontier (>1T params), where the emergent behaviours are still being documented. Under 100B params, looping 3 times will get you at best a 300B model, which is well within current leading edge & therefore existing knowledge.
What does a Looped Transformer (LT) do for the loop during training? The output of a layer is typically garbage until it has done some iterations of training. How is the output fed back into the input? Via a smoothing function ( e.g. gamma * Input + (1 - gamma)*Looped_Output as gamma goes from 1.0 to 0.5 ) ? Do you loop back each layer? Or a block of layers??
> What does a Looped Transformer (LT) do for the loop during training? The output of a layer is typically garbage until it has done some iterations of training.
The same is true for any deep neural net - so you need to make sure that errors/gradients flow back to the lowest levels, which is what "residual connections" do. > How is the output fed back into the input? They show that on their architecture diagram (the "Damp Gates") - they appear to be blending (learning to?) the old and the new, similar to what an LSTM does. > Do you loop back each layer? Or a block of layers?? In this case it's a block. Perhaps the idea is that it takes more than one layer to implement a useful group of transformations (e.g. it takes two layers to implement an "induction head", which is one of a Transformer's emergent mechanisms). We don't need to guess too much since they show us the architecture!
repeating a chunk of middle layers is relatively common in model merging; presumably it's pretrained unlooped first and then the section to loop is identified and trained further while looping
Another element is that the Chinese labs are an arm of the government and used for state goals. Read another way, they work for the state, not investors, and money matters a lot less.
Ah, of course! I've got one of those in my backpack! As for "association cortex", is that kind of like what Qwen and DeepSeek did in recent releases, mapping sequences of tokens into vector space as a memory aid? A separate subsystem I believe, which must have been helpful for some reason.. maybe it was transplanted from a much bigger model?
The thalamo-cortical loop refers to the connections in our brain between the neocortex and the thalamus, with the thalamus acting as kind of a patch panel that routes/loops activations back to different areas of the cortex.
The association cortex is that part of our cortex (brain) where activations originating from different sensory modalities come together, distinct from the sense-specific areas (visual cortex, auditory cortex, etc) where they are initially processed. This is what allows patterns/correlations across different senses to be recognized, such as lip-reading assisting with speech recognition. I'm not aware of any transformer variants where different input modalities (text, audio, video) are processed separately, so it's all more like non-specific association cortex in that regard. There is not necessarily any advantage to initially processing different sensory inputs on their own before combining them - our brain probably just does this as a matter of plumbing - the bit of the cortex nearest to our eyes/optical nerve processes vision, etc.
Comments (382) 72 threads
Show all comments
Showing thread 1 of 72
Looped Transformers are an obvious direction even if there are still problems to be worked out. The original Transformer is a bit like an unrolled for loop, and rather unnaturally pairs different sets of weights, both for attention and feed forward (knowledge) with different "layers" (aka loop iterations). Far more natural is to strive for something more like our brain's thalamo-cortical loop and association cortex, where "thought" is iterative and there are no restrictions as to what patterns/knowledge get applied when.
A similar idea has been explored before ("Universal Transformer", 2019), seemingly going nowhere, but perhaps "necessity is the mother of invention" and compute-starved Chinese companies are finding a way to make it work.
Does this mean we're opening up a whole new space of efficiency and performance gains even while keeping model sizes (chinchilla-optimal models) constant?
This is mind-blowing, though. Reality (the universe) just keeps on giving to our newfound tech tree branch of artificial neural networks.
Speculative execution goes hand in hand with branch prediction, and refers to speculatively executing the instructions that you think (based on branch prediction) will follow a branch before you get there, with the goal of keeping the execution pipeline full. If the branch prediction proves to be incorrect then you need to throw away those speculatively executed results and instead execute the instructions on the path that the branch actually took.
With a looped transformer, there is no speculation. You are basically choosing to put some layers in a loop rather than have them duplicated. For example if you previously had 6 layers A B C A B C then you could put (A B C) in a loop and execute the loop twice instead. There is no speculation here - you are always going to execute A B C A B C in either case. The benefit of using a loop is that by avoiding the duplication of layers you are avoiding duplication of parameters and so keeping the model smaller.
Continue this thread — 1 reply
I remember fixed points. An automorphism A on a set S has a fixed point s ∈ S if A(s) = s. If a noop corresponds to a fixed point, then are the elements of the set vectors and the output is a diff from the previous layers? Like, we're looping until we notice a cycle?
There has been concern that looping internally rather than emitting a token every N (transformer depth) layers reduces visibility and monitor-ability, so OpenAI have talked about severely limiting it to avoid this concern, and Zhipu are (at least initially) doing the same here - limiting it to a fixed two loops/iterations.
This is not true; in the article it is made abundantly clear that it runs 2x of 28 of its layers.
Continue this thread — 6 replies
But also I’m excited for the performance gains anyways
It's only a problem in the frontier (>1T params), where the emergent behaviours are still being documented.
Under 100B params, looping 3 times will get you at best a 300B model, which is well within current leading edge & therefore existing knowledge.
What does a Looped Transformer (LT) do for the loop during training? The output of a layer is typically garbage until it has done some iterations of training.
How is the output fed back into the input? Via a smoothing function ( e.g. gamma * Input + (1 - gamma)*Looped_Output as gamma goes from 1.0 to 0.5 ) ?
Do you loop back each layer? Or a block of layers??
The same is true for any deep neural net - so you need to make sure that errors/gradients flow back to the lowest levels, which is what "residual connections" do.
> How is the output fed back into the input?
They show that on their architecture diagram (the "Damp Gates") - they appear to be blending (learning to?) the old and the new, similar to what an LSTM does.
> Do you loop back each layer? Or a block of layers??
In this case it's a block. Perhaps the idea is that it takes more than one layer to implement a useful group of transformations (e.g. it takes two layers to implement an "induction head", which is one of a Transformer's emergent mechanisms).
We don't need to guess too much since they show us the architecture!
edit: aha, and thinkingmachines says as much for theirs https://thinkingmachines.ai/news/inkling-2-mini/
Continue this thread — 2 replies
Continue this thread — 17 replies
Ah, of course! I've got one of those in my backpack!
As for "association cortex", is that kind of like what Qwen and DeepSeek did in recent releases, mapping sequences of tokens into vector space as a memory aid?
A separate subsystem I believe, which must have been helpful for some reason.. maybe it was transplanted from a much bigger model?
The association cortex is that part of our cortex (brain) where activations originating from different sensory modalities come together, distinct from the sense-specific areas (visual cortex, auditory cortex, etc) where they are initially processed. This is what allows patterns/correlations across different senses to be recognized, such as lip-reading assisting with speech recognition.
I'm not aware of any transformer variants where different input modalities (text, audio, video) are processed separately, so it's all more like non-specific association cortex in that regard. There is not necessarily any advantage to initially processing different sensory inputs on their own before combining them - our brain probably just does this as a matter of plumbing - the bit of the cortex nearest to our eyes/optical nerve processes vision, etc.
A lot of innovation really seems to leak out of OpenAI because people love to brag lol. Interestingly, nothing seems to leak from the Anthropic cult.
Continue this thread — 1 more reply
Continue this thread — 6 more replies