Open Models Almanac
Methodsinference & servingKV cache management

specific method · filed under inference & serving

SWA Bounded Replay

SWA Bounded Replay approximately reconstructs missing Sliding-Window Attention KV states by replaying only the most recent n_win tokens instead of the L×n_win tokens exact reconstruction needs.1,2 It lets SWA KV be dropped from the persistent cache, since a miss is recovered by processing the replayed tokens together with the uncached suffix while reusing cached global KV.3

Trade-off It trades a small amount of prefill recomputation and slight approximation for a much smaller persistent KV cache footprint.4

How this definition was written

Summarised by glm-5.3-flash from 1 source; every sentence is checked against the quote it cites.

  1. approximately reconstructs the required SWA KV states by replaying only the most recent 𝑛win tokens — DeepSeek V41 Tech Report
  2. SWA Bounded Replay instead replays only the most recent𝑛win tokens and truncates SWA to the replay segment, accepting approximate states — DeepSeek V41 Tech Report
  3. When the encoder SWA KV is missing, we replay the last𝑛win tokens of the cached prefix and process them together with the uncached suffix — DeepSeek V41 Tech Report
  4. avoid persisting SWA KV cache to SSD while incurring a small amount of prefill recomputation — DeepSeek V41 Tech Report

Also called Sliding-Window Attention Bounded Replay.

sources
2
model
1
lab adopt it
1
strongest
core

Documented in

Evidence

2 quotes from 2 sources, one card per model, each opening with its strongest.

How sources treat it
used 1core 1

DeepSeek-V4.1-Flash

DeepSeekadopted2 sources

we introduce SWA Bounded Replay, which approximately reconstructs the required SWA KV states by replaying only the most recent 𝑛win tokens

coreunclearin DeepSeek-V4.1-FlashDeepSeek
1 more from this model

SWA Bounded Replay reconstructs missing SWA KV states by replaying only the most recent n_win tokens, avoiding the need to persist SWA KV to SSD and reducing the persistent KV cache footprint to roughly 1/8 of that of DeepSeek-V4-Flash.

usedmodel architecturein DeepSeek-V4.1-FlashDeepSeek
↑