GLM-5.4 is out with the largest open source looping transformer (750B)
Key things to know about its architecture
(1) motivation: why loop?
You loop because we have seen empirically that more passes through the weights equates to better performance. We normally do this via thinking tokens (we generate more tokens before we answer, which is in effect more forward passes). When you do this at the token level you lose information via sampling. Loop transformers loop through the hidden state level, maintaining as much info as possible.
Note, we are NOT looping indefinitely like we can indefinitely do in thinking token generation. Rather for this model we loop twice
For GLM-5.4 you go through layers 27-54 twice for each forward pass
Practically looping means you need to handle a few things
(2) kv cache: what do you save from the second pass
KV caches are saved by layer. When you go back through a layer, you want to take advantage of the last pass by having its kv cache present, but unrestrained this can result in your KV cache doubling (as you generate another kv cache in the second pass for each layer)
To get around this, t.co/WXsnhwwMZg does a pretty clever 80-20
They keep the full kv cache from the first pass, but then only do sliding window attention for the pass 2 kv cache. Put simply, they only grow the second pass by a fixed portion (128 tokens) for each layer
GLM-5.4 is NOT encoder-decoder like DSV4.1 Flash, so I would expect that once they implement encoder-decoder here they will find they have a lot more space to pass state
(3) indexing: which tokens do we pay attention to?
GLM-5.4 uses DSA, meaning it needs to figure out which 2048 tokens it should focus on. Indexing a second time is computationally expensive and ZAI understandably decided it was simpler to just reuse the indexes from the first pass
I would be surprised if this changes dramatically as it just seems to make sense given the scaling we’ve seen around indexers