An experimental variant of DeepSeek V4.1-Flash fit 38 simultaneous 128K-token decoding requests on four GB200 GPUs. On the same hardware, an eight-pass baseline that kept a separate cache for every layer and pass could not fit even one. Researchers at the University of California San Diego, Tsinghua University and Nanjing University report that sharing cached data across both layers and passes cut global key-value cache memory per token to 1/36.8 of the baseline. That saving applies to the cache, not to total GPU memory or the computation needed to generate a token.
Why keep only the final pass?
A key-value (KV) cache stores information about earlier tokens so the model can refer to them as it generates text. DeepSeek V4.1-Flash’s causal encoder-decoder architecture already shares some of that information: a few encoder layers write a global cache for long-range attention, and decoder layers read from it. Each layer also keeps a local cache covering the most recent 128 tokens.
The researchers formed a loop from 18 encoder layers, running them repeatedly with the same weights. Placing the loop in the encoder lets each pass update the global information that later tokens can read. A decoder loop, by contrast, repeatedly reads what the encoder wrote without updating the global cache. But sharing weights does not automatically save cache space: each pass can produce different keys and values.
To make retaining just the final pass practical, the team trained the model with a randomly chosen number of passes for each sequence, averaging about eight. By the eighth pass, the researchers measured a state change of just 1.7%. Across three model sizes trained this way, switching from separate caches for each pass to the final pass’s cache changed prediction loss by no more than 0.0002 bits per byte.
Loop placement also mattered in a test where a passage repeated verbatim after 1,024 tokens. On a 150-million-parameter model, an encoder loop reduced prediction loss by 0.084 bits per byte relative to the architecture without a loop. A decoder loop increased loss by 0.005 bits per byte on the same task.
More requests at once, but slower individual steps
In the four-GPU test, sharing the global cache across layers alone made room for seven 128K-token requests. Keeping only the final pass’s cache raised that capacity to 38. In a separate workload with 8K input tokens and 1K output tokens per request, the full method reached 3.6 times the peak throughput of the eight-pass baseline that cached every layer and pass separately.
That throughput gain does not mean an individual token is faster to generate. On the 552-billion-parameter backbone, an eight-pass decoding step took 3.95 times as long as a step in the original model without a loop. The team also tested a compromise for long prompts: use four passes during prefill, when the model processes the input, then return to eight during decoding. In their tests, this nearly halved prefill time while retaining more than 99% of the measured accuracy gain.