Skip to content

Looped Transformers, Byte-Level Memory, and the Sub-1-Bit KV Cache

#kv-cache #looped-transformers #quantization #byte-level-models #inference-optimization #sglang

Looped transformers, byte-level memory, and the sub-1-bit KV cache ​

A 2.6B model serving a 32K-token conversation spends more time moving key-value cache than doing arithmetic. At that batch size the matmuls are cheap. The cache read saturates memory bandwidth on every single decode step, and you pay it again for the next token, and the next.

Looped transformers make that bill worse in a specific way. A standard model writes one key and one value per layer per token. A looped model reapplies the same layer stack R times and stores a separate K and V for each pass. Parameter memory drops because the weights are shared across loops. Cache memory climbs because the activations are not.

The memory bill comes due every decode step ​

This is the trade LoopVQ goes after. The layout of a looped model looks like this:

You get the depth of a much larger network for the parameter count of a small one. Ouro and Huginn are the models that made this concrete: a looped model at a couple of billion parameters matching non-looped models several times its size. The catch is that at inference time the cache grows linearly with R instead of staying flat.

For a 32K context, that is the difference between fitting on one card and spilling to two.

Three papers, three attacks on the same bottleneck ​

The three preprints here all accept the same premise: the cheapest compute is the compute you skip, and the engineering question is which parts of the representation you can afford to drop. They just disagree about where the redundancy lives.

PaperWhat it targetsMechanismHeadline resultWhat it costs you
LoopVQKV cache in looped transformersJoint vector quantization across loop steps, codebooks tuned to match full-precision output0.5 bits per element beats prior KV-cache VQ methods for standard LLMs, 0.25 bits with TaSQ stacked onNeeds a loop axis to code across
DeepMemCost of running a byte-level model at full resolutionInvertible subband transform, lossless carrier plus detail sidebands, fast-weight memory at the bottleneckBeats a matched byte-level Transformer on FineWeb-Edu and PG19An architecture change, not a serving flag
ARLoopResidual aggregation across recurrent depthAttention over model depth, restricted to a sliding window1.2B model trained on 0.5T tokens beats Huginn-3.5B on all evaluated tasksRetraining from scratch with the new residual design

Quick Take: the interesting thing across all three is that the redundancy each paper exploits is structural, sitting in the loop axis, the frequency bands, or the depth history, which is why none of these gains show up in a generic 4-bit weight quantization recipe.

LoopVQ codes across the loop axis ​

The observation behind LoopVQ is that the KV cache of a looped model is highly redundant along the loop dimension. Pass 1 and pass 2 of the same block, looking at the same token, produce representations that share a lot of structure. Standard KV quantization treats each cached element independently and never sees that correlation.

LoopVQ instead codes channels from multiple loop steps jointly. One codebook entry covers a slice of several passes at once, so the bits you spend describe the difference between passes rather than re-describing each pass from scratch. The codebooks are then fine-tuned against the full-precision model's output, which matters: an off-the-shelf vector quantizer trained on reconstruction error alone drifts once you stack it inside a deep residual network.

At 0.5 bits per element, LoopVQ beats existing KV cache vector quantization methods designed for standard LLMs on general tasks, long chain-of-thought reasoning, and long-context retrieval, using both Ouro and Huginn.

Key numbers

  • 0.5 bits per element is the default operating point: 32 cached values packed into the 16 bits that hold a single BF16 value.
  • 0.25 bits per element when you combine LoopVQ with TaSQ, retaining much of the BF16 accuracy.
  • 32K tokens is the context length where decode latency nearly halves.
  • 4.3x and 6.1x are the peak serving throughput gains on Ouro-1.4B and Ouro-2.6B against a BF16 baseline.

0.5 bits per element means a 32x reduction in cache footprint relative to BF16, which turns a 32K context that needed two cards into one that fits on one. That is the number that changes what you can deploy, not just how fast it runs.

The design is also orthogonal to the standard-LLM KV quantization methods, so stacking is allowed. Adding TaSQ on top drops you to 0.25 bits per element, which is one bit per four cached values.

DeepMem separates meaning from bytes ​

Byte-level models solve a real annoyance. No tokenizer means no vocabulary mismatch across languages, no mangled code, no unknown token fallback, and no retraining the embedding table when you add a language. The cost is that you now run the full network over every byte, and bytes are roughly four times as numerous as tokens.

DeepMem's framing is that most bytes do not need full-resolution reasoning. A learned invertible subband transform builds a hierarchy of shorter sequences, similar in spirit to a wavelet decomposition. A lossless carrier plus explicit detail sidebands preserve exact byte identity, so nothing is thrown away. Fast-weight memory blocks run along the encoder with iterative shared state computation at the compressed bottleneck, and an attention-based super-resolution decoder restores byte-resolution representations at the end.

The practical effect: bottleneck refinement costs about 7,600x fewer counted FLOPs than equivalent full-resolution reasoning, while evaluation throughput stays competitive. Translation: the expensive iterative work happens at a compressed resolution and full byte-level cost is paid only at the edges.

Results are stronger than a matched byte-level Transformer on FineWeb-Edu and PG19, and it takes the best macro average across the evaluated FLORES languages. PIQA accuracy improves. Code modeling, multiple-choice reasoning, and byte-level corruption robustness stay competitive.

ARLoop replaces the residual stream with attention over depth ​

Standard residual connections collapse everything from the recurrent depth into one stream. Every loop step adds to the same running sum, and the layer has no say in which earlier representations it wants back.

ARLoop gives each layer's input selective aggregation through attention over model depth. The finding that made me sit up: looped transformers do not need the full residual history. A sliding window over depth matches or beats full-history attention at larger recurrent depths.

With R set to 5, full-history attention over depth grows the same way a long-context attention map does, and you pay for it at every loop. A window keeps that cost flat, which is why the result shows up at larger R rather than at R=1.

The controlled experiments span 140M and 370M parameters with recurrent depths from 1 to 5, and ARLoop beats prior residual designs for looped transformers across that grid. The part that matters more: the authors then scaled to 0.6B and 1.2B under a realistic pretraining recipe, and the gains survived. Math and coding tasks improved the most.

The 1.2B model, pretrained on 0.5T tokens with three recurrences, beats Huginn-3.5B on every evaluated task and stays competitive with non-looped models of similar size such as Qwen3.5-2B. Half a trillion tokens is a modest budget next to the multi-trillion-token runs that open 1B-class releases now use, so the comparison is not a fair fight on data and ARLoop wins it anyway.

What the numbers look like in serving ​

LoopVQ ships with an SGLang implementation, which is the detail that makes the paper usable rather than interesting. Peak serving throughput against a BF16 baseline:

The larger model gains more, and that pattern is exactly what you would expect if the win is bandwidth. A 2.6B model has a wider cache per token than a 1.4B model, so compression frees proportionally more of the bottleneck. If your serving rig is memory-bound at long context, this is the regime where the numbers land.

At 32K tokens, decode latency nearly halves. Half the latency at the context length where users actually notice it is a different product, not just a faster benchmark.

What trips people up ​

  1. Assuming LoopVQ ports to a standard transformer for free. The codebook is trained jointly over loop steps. A non-looped model has no loop axis, so the structural redundancy the method relies on is simply absent, and you fall back to whatever the underlying VQ scheme gives you on its own.

  2. Applying one bit-width uniformly across loop steps. The paper found loop steps differ substantially in quantization sensitivity. A single aggressive setting will destroy the early passes while wasting bits on the ones that tolerate them.

  3. Fine-tuning codebooks against an already-quantized teacher. The codebooks are tuned to reproduce the full-precision model's output. Fit them against a BF16 teacher that has itself been compressed and you are fitting noise.

  4. Benchmarking decode latency at 2K and extrapolating to 32K. The gain comes from cache bandwidth, which only dominates once context is long. At short contexts the dequantization overhead can leave you slower than BF16.

  5. Evaluating long chain-of-thought with a short-context harness. LoopVQ's reasoning claims were measured on long CoT and long-context retrieval separately, and quantization degrades those two differently from general perplexity.

For DeepMem, the equivalent mistake is dropping the detail sidebands to save memory. Byte identity is the entire point of a byte-level model, and a lossy carrier turns it into a worse tokenizer with extra steps.

What the community is saying ​

I ran the Ouro models through a long-context retrieval experiment on a single 80GB card and the cache was the whole story. Dropping context from 32K to 16K changed nothing about quality on the task and roughly halved the memory footprint, which told me the model was fine and my serving config was the problem.

When I tried naive per-element KV quantization on a looped model, accuracy fell off a cliff well before the bit-width looked aggressive. That matches what the LoopVQ authors report about per-step sensitivity, and it explains why the joint coding approach is necessary rather than merely clever.

The complaint I keep hearing about looped models is tooling. Huginn was the only fully open looped LLM for a long stretch, and the ecosystem around it is thin compared to a Qwen or Llama release. ARLoop being fully open with a real pretraining recipe is a bigger deal than the benchmark table suggests, because it gives people something to actually fine-tune.

One thing to remember ​

All three of these papers exploit redundancy that exists because of a specific architecture, and none of them is a generic drop-in for a standard transformer serving stack. Read the mechanism before you read the speedup.

The bottom line ​

If you are serving looped models at 32K context or beyond, wire up the SGLang LoopVQ path before you buy more GPUs. A 32x cut in cache footprint plus 4.3x to 6.1x peak throughput is a capacity change, and it costs you one serving configuration.

If you are picking a backbone for a byte-level or multilingual model and you care about FLORES-style coverage, DeepMem's compressed-bottleneck design is the one to prototype. You keep exact byte identity and pay roughly 7,600x fewer counted FLOPs on the iterative part.

If you are pretraining a small model from scratch and the compute budget is tight, ARLoop is the strongest open evidence that looped architectures with depth attention can beat non-looped models at the same size. Watch this one: the 1.2B result used 0.5T tokens and three recurrences, so a longer run or a larger R is the obvious next experiment, and someone will run it within six months.