looped transformers

Looped transformers share weights but memory limits keep them from staying on chip

Shared weights sound like a free lunch, but memory bandwidth has other plans.

3 min readMachine Learning
Looped transformers share weights but memory limits keep them from staying on chip
Do looped transformers save HBM traffic? Profiling weight reuse in Huginn on a B200 [P]

Looped transformers that reuse the same weights across iterations sound like an obvious efficiency win. Share the weights, keep them on the GPU chip, and skip the expensive trips to high-bandwidth memory. The data from a recent deep-dive on Huginn architecture shows the reality is more nuanced, and the distinction matters for anyone building or buying AI infrastructure. The key finding is blunt: sharing weights saves storage space, but it does not, by itself, keep those weights resident on chip between iterations. On a B200, a chain of eight matmuls with a single shared 72 MiB weight ran 24% faster and read almost nothing from HBM. Scale that weight to 288 MiB, larger than the L2 cache, and the advantage vanishes. In a full Huginn Core implementation, eight iterations took roughly eight times as long and read roughly eight times as much data from HBM as a single iteration. The bottleneck is memory, not model architecture.

This should shift how we think about the hardware-software stack for recurrent-style models. The community has been exploring lightweight alternatives to full model duplication, as seen in recent work on Scaling AI training with lightweight adapters instead of doubling models, and there is a parallel desire to make local inference practical, as demonstrated by setups like a Mac Mini and iPad complementing university AI access. Looped transformers fit that same goal of doing more with less, but the hardware is not cooperating yet. The GPU's memory hierarchy imposes a hard constraint: if the weight matrix exceeds the L2 cache, the chip will fetch it from HBM on every loop iteration, negating the theoretical savings. The author of the analysis explicitly asks whether anyone has tried persistent kernels to keep recurrent weights on chip. That is the right question, and it points to a specific engineering challenge rather than a fundamental flaw in the architecture.

For practitioners, the takeaway is concrete. If you are experimenting with looped transformer variants, pay close attention to the size of your shared weights relative to the L2 cache of your target hardware. A 72 MiB weight fits on a B200's cache and delivers a real 24% speedup. A 288 MiB weight does not, and the performance profile collapses to match the unshared baseline. This is not a reason to abandon looped architectures, but it is a reason to treat "shared weights" and "reduced memory traffic" as separate claims that must be validated with actual profiling. The same principle applies to the broader trend of vibe coding with natural language interfaces: the promise only holds when the underlying infrastructure actually delivers. The next step is to see whether persistent kernels or smarter caching strategies can close the gap, or whether the memory wall forces a rethink of how looped models are deployed. That question is now on the table, and it deserves a measured, data-driven answer.

From Machine Learning

Do looped transformers, which reuse the same weights at every iteration, also save HBM traffic? In my new post I cover the looped architecture (Huginn), then model and measure its performance on a B200: how much data each iteration reads from memory, how long it takes, and why the shared weights usually don't stay on chip until the next iteration. A few results:

Read the original at Machine Learning

Looped transformers share weights but memory limits keep