Periodic Weak Spots: Phase Sensitivity from Chunked KV-Cache Compression

Xingyu Zhu, Pu, Yi, Ziheng Cheng, Ang Lv, Jing Liu, Lexing Ying, Yiyuan Ma, Xin DongarXiv 2026 · arXiv

TL;DR

Chunked KV-cache compression, a popular technique for scaling LLMs to long contexts, introduces "periodic weak spots" where retrieval accuracy fluctuates wildly based on a token's position relative to compression boundaries. The authors demonstrate that even state-of-the-art models like DeepSeek-V4 exhibit this "phase sensitivity," with retrieval accuracy gaps of up to 40 percentage points that are completely hidden by standard average benchmark scores.

What Problem Does This Paper Address?

As Large Language Models (LLMs) handle increasingly long contexts, the KV-cache (which stores keys and values for attention) becomes a massive memory and computational bottleneck. A common remedy is chunked KV-cache compression: grouping consecutive tokens into fixed-size windows and compressing them into fewer cache entries.

However, this creates a new positional coordinate for every token: its phase, or its position relative to the compression window boundary (position modulo stride). The authors investigate whether this compression is truly "query-agnostic" or if it introduces systematic biases. They uncover a phenomenon they call phase sensitivity, where a model’s ability to recall information depends heavily on which phase that information landed in during compression.

Methods

The researchers employed a multi-pronged approach to dissect this behavior:

  • Empirical Probing: They tested large open-weight models (DeepSeek-V4 family) using a "flipping" code-completion task and a controlled Needle-in-a-Haystack (NIAH) evaluation.
  • Controlled Pretraining: To isolate the cause, they pretrained a family of Qwen3-0.6B models from scratch, varying only the KV compression parameters (stride, window size, and gating mechanisms).
  • Mechanistic Analysis: They used KV-head knockouts (replacing a head's output with its mean) to identify "phase specialization"—the tendency of specific attention heads to handle specific phases.
  • Causal Interventions: They performed gate cycling, manually shifting learned compression gate parameters to see if the accuracy patterns shifted accordingly.
  • Theoretical Modeling: They analyzed an idealized induction task to show how gradient flow dynamics during training naturally drive models toward sharp phase specialization.

Datasets

  • DeepSeek-V4 Inference Code: Used to demonstrate periodic prediction flips in a real-world code snippet.
  • Needle-in-a-Haystack (NIAH): A custom 128K-token version using 16,000 key-value pairs, with natural language fillers from the agentlans/high-quality-english-sentences dataset.
  • Animal-Name Retrieval: A newly introduced logical benchmark for controlled studies, pairing 64 animal keys with 64 human names.
  • SQL Station-Distance: Adapted from gretelai/synthetic_text_to_sql to test phase sensitivity in structured data tasks.

Key Insights and Ideas

  • The "Phase" Matters: Retrieval performance is not uniform across a context; it is periodic. If your "needle" lands in a weak phase, the model is significantly more likely to fail.
  • Phase Specialization: Models don't just fail randomly; they divide the labor. Different attention heads specialize in retrieving information from different source phases.
  • Emergent Gating Preferences: During training, compression gates (which decide how much each token contributes to a summary) drift from uniform averaging to "static concentration," effectively picking "favorite" positions within a window to preserve.
  • Averaging Hides Failures: A model might boast a 90% average accuracy on a benchmark, but this can mask a systematic failure where it has 100% accuracy at one phase and only 60% at another.
Figure 1: Next-token predictions by DeepSeek-V4-Flash-Base. The prediction flips periodically as a filler shifts the input, matching the model's compression stride.

Key Results

  • DeepSeek-V4 Sensitivity: In a 128K context NIAH task, DeepSeek-V4-Flash-Base showed a massive 40.2 percentage point gap between its best and worst phases.
  • Stride-Matching Periodicity: In controlled experiments, the period of accuracy variation always matched the compression stride $S$, regardless of window size or overlap.
  • Causal Link Confirmed: By cycling the gate parameters (shifting which offset they favor), the researchers were able to shift the model's accuracy peaks and valleys across phases, proving that learned gating is a primary driver of this sensitivity.
Figure 2: NIAH retrieval accuracy for the DeepSeek-V4 family. All models exhibit phase sensitivity, with gaps ($\Delta$) as high as 40.2 pp.
Figure 19: Gate cycling intervention. Shifting the gate parameters by $\delta$ offsets approximately shifts the retrieval accuracy pattern by the same amount, providing causal evidence for the role of gates.

Limitations and Future Work

  • Boundary vs. Within-Window: While the paper explains within-window asymmetry through gating, it notes that "boundary straddling" (where a key and its value fall into different compression windows) is a separate, unresolved source of phase sensitivity.
  • Universality: The mechanistic conclusions are strongest in controlled settings; large-scale heterogeneous models may have additional, more complex drivers.
  • Robustness Implications: It remains to be seen if phase sensitivity affects other behaviors, such as safety alignment or refusal. For example, could a "jailbreak" succeed simply by shifting the prompt by two tokens?
  • Mitigation: The paper identifies the problem but leaves the solution—designing compression that is both efficient and phase-invariant—as an open challenge for the community.

Summary updated

Abstract

Chunked KV-cache compression reduces the memory and attention costs of long-context inference by compressing windows of consecutive tokens into fewer cache entries at a fixed stride. Such compression also introduces a new positional coordinate: a token's phase, or its position relative to compression-window boundaries. We uncover a systematic asymmetry in models using such compression: the same information can be easy to retrieve at one phase and difficult at another. We call this periodic variation in retrieval performance phase sensitivity. In large open-weight models with such compression, long-context retrieval accuracy can differ by up to 40 percentage points across phases, revealing periodic weak spots that average benchmark scores can conceal. To investigate this behavior, we pretrain a family of transformers from scratch across multiple KV-compression designs, reproducing phase sensitivity across the variants. Mechanistic analysis using causal interventions in these models reveals phase specialization: different attention components contribute asymmetrically to retrieving information at different source phases. We further analyze idealized retrieval models, showing how gradient flow dynamics may favor sharp phase specialization. Evaluating models with chunked KV-cache compression thus requires measuring across compression phases: high average accuracy can coexist with systematic positional failures.
BibTeX
@misc{zhu2026periodic,
  author = {Xingyu Zhu and Pu and Yi and Ziheng Cheng and Ang Lv and Jing Liu and Lexing Ying and Yiyuan Ma and Xin Dong},
  title = {{Periodic Weak Spots: Phase Sensitivity from Chunked KV-Cache Compression}},
  year = {2026},
  eprint = {2609.36322},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.36322},
}
Figure