Newsroom Wire

CN China12-05 17:22⏱ 7 min read

DeepSeek V4.1-Flash Retrofitted Into a Loop Transformer, Running 8 Rounds on Just 4 GPUs

Researchers from UC San Diego, Tsinghua University and Nanjing University, among others, retrofitted DeepSeek V4.1-Flash into a Loop Transformer: the encoder's 18 layers run 8 passes with one shared set of weights, and different rounds share one history cache under the model's CED shared-cache architecture. Per-token global KV cache falls to 1/36.8 of the conventional scheme; on 4 GB200 GPUs the new scheme fit 38 concurrent 128K decoding requests where the traditional scheme fit none, and peak throughput hit 3.6x the baseline in an 8K-input/1K-output concurrency test. Training with random loop counts averaging 8 pushes states toward a fixed point, so switching to last-round-only KV changed BPB by under 0.0002 across three model scales. The catch: 8-round looping still costs 3.95x single-step decode time on the 552-billion-parameter backbone; a 4-round prefill variant keeps over 99% of the accuracy gains while nearly halving prefill time.

What happens if you retrofit DeepSeek V4.1-Flash into the lately red-hot Loop Transformer?

The answer: with the same 8 loop rounds, the global KV occupancy per token is only 1/36.8 of before!

The result comes from new research by institutions including UC San Diego, Tsinghua University, and Nanjing University:

In the study, the team took the 18 layers in the encoder of DeepSeek V4.1-Flash's architecture and looped them into a recurrent block, running 8 consecutive passes with the same set of weights.

This not only cuts each token's global KV cache footprint to 1/36.8 of the conventional scheme, but also greatly boosts how many concurrent requests the same machine can handle.

In real tests on 4 GB200 GPUs, the traditional layer-by-layer, round-by-round caching scheme could not even fit a single 128K request and ran out of VRAM outright; with the paper's new method, 38 fit at once!

In another concurrency test with 8K input and 1K output, the new scheme's peak throughput also reached 3.6x the traditional baseline.

In short, the paper's core idea is to graft the multi-round loop computation of Loop Transformer onto DeepSeek V4.1-Flash's shared-cache architecture (CED), letting different rounds share the same history cache.

First, Loop Transformer: as the name suggests, its core is letting part of the Transformer's layers work in a loop.

Take the 18 layers in this study: after the first pass, the model feeds the resulting intermediate states back into the entrance of those 18 layers and computes again with the same weights.

To keep the model from "forgetting" the original input tokens deeper into computation, each round re-mixes the original input features in through a gating mechanism — like glancing back at the problem at the start of every round of thinking.

Repeated this way, the model can run multiple rounds of computation before predicting the next token without adding parameters, gaining deeper expressive power.

But problems follow. In actual inference, the intermediate states produced in each loop round can differ, so the corresponding KV caches naturally change too.

Under the traditional scheme of keeping every round's KV, looping 8 rounds means maintaining separate caches for the different rounds.

That makes the KV cache balloon with the loop count, eventually offsetting Loop Transformer's parameter advantage.

To solve this, the research team latched onto a design DeepSeek V4.1-Flash already uses: the Causal Encoder-Decoder architecture (CED).

Specifically, instead of having every layer independently keep a global KV covering the long context, a few encoder layers generate the global KV, which later decoder layers share and read.

Meanwhile, each layer only needs to keep a short sliding-window cache (SWA) attending to the most recent 128 tokens. Long-context information that would otherwise be duplicated across layers can then be shared.

If Loop Transformer is plugged in directly, the layers that write the global KV still produce a new KV cache on every loop round.

First, put the loop in the encoder, so the layers that write the global KV join the loop.

Specifically, on each encoder loop round, the historical information is reprocessed and the global KV updated.

This way, later tokens can read, at compute time, long-range information that has been refined over multiple iterations.

By contrast, if the loop sits in the decoder, each round still reads the global KV pre-generated by the encoder.

The team did not fix the loop count at 8; during training they sampled the number of loop rounds randomly per sequence, averaging about 8.

This forces the model to adapt to results at different loop depths and learn to keep output states consistent across different round counts.

As loop rounds increase, the state changes between rounds shrink, gradually approaching a stable state — the so-called "fixed point."

This means the KV states from multiple loop rounds are already highly similar. At inference, the model only needs to keep the last round's KV cache, and the computations of other rounds can share it.

In experiments, to verify that putting the loop in the encoder helps, the team also ran a series of tests on loop placement, cache strategy, and actual inference efficiency.

The researchers had the model predict text that repeats verbatim after 1024 tokens, testing its ability to capture long-range information.

On a 150-million-parameter model, with non-looped CED as the baseline, encoder looping lowered prediction loss by 0.084 BPB.

By contrast, decoder looping slightly raised prediction loss, by 0.005 BPB.

This shows that in this architecture, looping the encoder — which generates the global KV — genuinely helps the model handle long-range dependencies.

The results show that for models trained with random round counts, switching to last-round caching changed BPB by less than 0.0002 across three model scales — nearly negligible.

The team ran 8-round-loop serving tests on a DeepSeek V4.1-Flash backbone across 4 GB200 GPUs, comparing three schemes: 1. Traditional per-layer, per-round caching: KV saved separately for every layer and every round. 2. Cross-layer sharing only: layers share the global KV, but loop rounds are still cached separately. 3. Cross-layer sharing + last-round caching: sharing across both layers and rounds, keeping only the last round's KV.

Results: under this configuration the traditional scheme could not fit even 1 128K decoding request; cross-layer sharing alone fit 7; the full new scheme fit 38 at once.

In other words, versus the traditional scheme, the new method cuts this architecture's global KV cache footprint by 36.8x.

In another concurrency test with 8K input and 1K output, the new scheme's peak throughput reached 3.6x the traditional per-layer, per-round caching baseline.

That said, note that saving KV cache does not mean the model's computation gets cheaper.

On the 552-billion-parameter backbone, single-step decoding time with 8 loop rounds is still 3.95x the non-looped original.

Also, because the loop sits in the encoder, the prefill stage likewise runs 8 rounds of computation on very long inputs.

So the team also tested a compromise: loop only 4 rounds during prefill, then resume 8 rounds once decoding begins.

Experiments show this still retains over 99% of the accuracy gains while nearly halving prefill time.

Jiaqi Leng, a PhD student at UC San Diego's Hao AI Lab advised by Hao Zhang, earned his bachelor's degree from Fudan University.

He previously co-first-authored hierarchical sparse attention research published at ICLR 2026, focusing on how models handle contexts longer than those seen during training.

Minshen Zhang, a master's student in computer science at UC San Diego, is also from Hao Zhang's lab and earned his bachelor's degree from ShanghaiTech University.

His research covers large-model inference infrastructure, GPU/TPU operator optimization, and sparse attention; he is co-first author of the FastAFD inference engine paper.

Zhaofeng Sun, a computer science undergraduate at Tsinghua University, works with Hao Zhang at the Hao AI Lab on efficient language model architectures and parallel decoding.

He is also first author of InfuseLoop, which studies how parallel loop Transformers can keep training stable as the number of loop rounds grows.

Yu-Yang Qian, a PhD student at Nanjing University's LAMDA advised by Zhi-Hua Zhou, has also visited the Hao AI Lab. As first author he published OnlineSpec and d3LLM, which improve speculative decoding through online learning and speed up diffusion language model inference, respectively.

Peng Zhao is a tenure-track associate professor and doctoral advisor at Nanjing University's School of Artificial Intelligence and a member of LAMDA. His research covers online learning and optimization, as well as large-model inference work such as speculative decoding.

Hao Zhang is an assistant professor at UC San Diego, head of the Hao AI Lab, and the paper's last author.

His research sits at the intersection of machine learning and computer systems; representative work includes the vLLM large-model inference engine and DistServe, which deploys prefill and decoding separately.

Reference [1] https://www.alphaxiv.org/pdf/2611.13378

The new V4.1-Flash-1017 version has also opened up its in-house search API.

Snapshot for aggregated reading; content from the public web, © the original publishers.

AI NewsCove

Opening article…