Looping Transformers repeatedly run part of a network to perform additional computation without adding a separate set of parameters for every pass. But if every pass keeps its own key-value (KV) cache, memory use can grow with the number of rounds and erode the design’s serving advantage. A study from researchers at UC San Diego, Tsinghua University, Nanjing University, and other institutions explores a way to avoid that growth on a DeepSeek V4.1-Flash architecture.
The team made 18 encoder layers a recurrent block, applying the same weights over multiple rounds. They placed the loop in the encoder, which produces the global cache, and used a gate to reintroduce features from the original input during each pass. Rather than retaining a separate global KV cache for every round, the approach trains with a randomly chosen number of rounds and keeps only the final round’s global KV at inference. The paper reports that states change little by round eight; switching to last-round caching altered BPB by no more than 0.0002 in the tested models.
Reported results:
- In an eight-round test on four GB200 GPUs, the conventional per-layer, per-round cache could not fit one 128K request. Cross-layer sharing alone fit seven; combining it with last-round retention fit 38.
- By the study’s comparison, the new approach used about 1/36.8 of the baseline’s global KV cache. In a concurrent test with 8K-token inputs and 1K-token outputs, peak throughput reached 3.6 times the baseline.
- In a long-range prediction test using a 150-million-parameter model, encoder looping reduced loss by 0.084 BPB, while decoder looping slightly increased it. This supports the choice of looping the component responsible for producing global context in this particular architecture.
The broader point is that recurrent models’ serving costs are shaped not just by computation, but also by how their caches are organized. Sharing cache state across layers and rounds could turn memory savings into room for more concurrent long-context requests. However, a smaller cache does not make repeated computation free. The study reports that, on a 552-billion-parameter backbone, eight rounds made single-step decoding 3.95 times slower than the non-looping version. Prefill also has to execute the loop. As a compromise, the team tested four rounds during prefill and eight during decoding; it reports retaining over 99% of the accuracy gains while cutting prefill time by nearly half.
This is an architectural and serving study, not an official release of a new DeepSeek model. Its results suggest that recurrent computation may be more practical when paired with careful cache sharing, while also highlighting the trade-offs among throughput, latency, context length, and accuracy. Real-world gains will depend on implementation, hardware, and workload.
Comments
Checking sign-in status...
Loading comments...