                     CateKV: On Sequential Consistency for Long-Context LLM Inference Acceleration

A. Further Observations
We expanded our exploration of sequential consistency to a wider selection of models, primarily focusing on the popular
models mentioned in the main text: Llama-3-8B-1M (Gradient, 2024a), Llama-3.1-8B (Meta AI, 2024), Phi-3-128K (Abdin
et al., 2024), and Yi-9B-200K (AI et al., 2024). In Figure 9, we visualized the attention weights heatmap for these four
models, illustrating the presence of both consistent and adaptive heads across various layers. This visualization supports the
generality of our observations. Consistent with the setup described in the main text, the heatmap in the figure comprises
attention weights associated with the last 20 query tokens during the pre-filling stage and all query tokens during the
decoding stage, employing a causal mask. And the samples are randomly excerpted from the WikiText-2 (Merity et al.,
2016) dataset.

B. Experiment Details
B.1. Implementation Details of Experiments
During the identification stage of CateKV, we employed an observation window and temporarily excluded initial tokens
and recent tokens from the context window. We set Lobs to 64, while Linit and Lrec were defined as 1/32 and 1/128 of the
sparse budget, respectively. We constructed the reference dataset based on the Variable Tracking task from the RULER
Benchmark, which comprises 100 samples, each with a length of 128K, distinct from the test set. The sparse budget was
set at 2048. According to the performance on the reference dataset, we selected the most appropriate percentile threshold
k and scaling factor α for each model. For the percentile threshold k, Llama3 and Llama3.1 were set at 0.996 and 0.984,
respectively, while other models were set at 0.99. For the scaling factor α, Llama3.1, and Yi were set at 0.8, while other
models were assigned a value of 1.0.
For the baseline methods, we configured the observation windows of SnapKV (Li et al., 2024) and PyramidKV (Cai et al.,
2024) to 32 and set the β in PyramidKV to 20. For StreamingLLM (Xiao et al., 2023), the initial tokens were set to 128.
Regarding Duoattention(Xiao et al., 2024b), we conducted experiments using the attention patterns provided by their code
available on GitHub.

B.2. Additional Results on RULER
B.2.1. P ERFORMANCE OF DIFFERENT CONTEXT LENGTHS ON RULER
We also conducted evaluations on various context lengths within the RULER benchmark. The Table 5 presents the
performance of CateKV on tasks with context lengths from 8K to 256K. CateKV is comparable to full attention in terms of
all lengths and average results and even shows slight improvements in performance at certain lengths when r = 0.4 and
η = 1.0.

                               Table 5: Performance of different context lengths on RULER

                      Methods               8K       16K      32K     64K      128K     256K     Avg.
                      Llama-3-8B-1M        91.47    92.87    90.31    86.44    84.10   79.79    87.50
                      CateKV               91.28    92.11    90.37    86.86    84.61   81.53    87.79
                      Phi-3-Mini-128K      92.02    91.42    91.24    87.89    72.06      -     86.93
                      CateKV               92.68    92.54    92.04    88.78    71.69      -     87.55
                      Llama-3.1-8B         94.78    94.95    94.61    93.02    84.55      -     92.38
                      CateKV               94.66    94.68    94.58    93.03    84.66      -     92.32
                      Yi-9B-200K           87.54    82.33    72.06    69.19    64.52      -     75.13
                      CateKV               87.17    81.68    71.85    69.25    65.76      -     75.14


B.2.2. C OMBINE WITH KV R ETRIEVAL M ETHODS
We combine CateKV with Quest (Tang et al., 2024b) and ShadowKV (Sun et al., 2024) and compare their performance with
the baseline under the same computational budget at a length of 128K. The results are shown in Table 6. CateKV helps

                                                             13
