Summary
The paper proposes a method for reducing the memory requirement of inference for large autoregressive language models.
The proposed techniques is based on the empirical observation that the high attention score tokens in a transformer self-attention layer maintain a remarkable persistence for different token positions in the input sequence.
This observation is used to consider a reduction of the memory required in the attention KV cache, by retaining only the information corresponding to 'pivotal tokens', which are defined as the token positions that have a high attention scores for some of the previous steps in the self-attention autoregressive generation.
Strengths
The paper addresses the important issue of the high memory cost of inference for autoregressive generative language models, associated with the size of the KV cache, which has directly affects the inference execution time for large language models.
To the best of my knowledge, the observation of the persistence of the self-attention pattern is original, and gives a new angle in the understanding of this very important compute block.
The proposed method makes use of this observation to try to reduce the memory requirements associated with the KV cache of the self-attention, without requiring fine-tuning of the language model.
Weaknesses
The exposition of the paper should be improved. In particular:
-- The authors make the claim that their technique "reduces the inference memory usage of the KV cache by up to 5x without compromising model quality", while from the results of Section 5 this is not achieved in all cases, and depending on the downstream task the performance is not maintained for compression larger than 2x or 3x.
-- The exposition of Algorithm 2 should be improved, adding further explanation and clarification in the text.
Other comments:
-- Line 91 and line 93: the sequence length is denoted by $p$, while the length of the prompt sequence was defined as $s$ at line 87.
-- Line 185: in the case of a single attention head, the matrices $W_Q$, $W_K$, $W_V$ should be of size $d \times d$ (and not $d \times p$), and the matrix $W_O$ of size $d \times d$ (and not $p \times d$).
-- In the equation after line 215 and in the equation after line 238, on both numerator and denominator of the softmax formula, $x_t W_K$ should be changed to $x_t W_Q$.
Minor comments:
-- Lines 67 and 69: "between who they ..." should be "between which tokens they ...".
-- Caption of Table 2: "This table summarises the maximum batch size ..." should be simply "Maximum batch size ...".
-- Line 102: "parallel strategy" should be "parallelism strategy".
-- Line 109: "Table 2.1" should be "Table 2".
-- Caption of Figure 2: The text "In this figure, we plot the persistence ratio and the corresponding size ..." should be changed to simply "Persistence ratio and corresponding size ...".
-- Line 132: "drawn from C4 [22]" may be rephrased as "drawn from the Colossal Clean Crawled Corpus (C4) [22]".
-- Algorithm 2: $[t-W,t]$ should be $[t-w,t]$ (the History Window Size is defined as lower-case $w$).
-- Line 263: "tokes" should be "tokens".
-- Caption of Figure 3: The text "This figure shows the accuracy trend of ..." should be changed to "Accuracy trend of ...".
Questions
-- Regarding the persistence of the attention pattern, it seems that its manifestation critically depends on the cosine similarity between input and output of the MLP of equation (2) - could the authors elaborate on this point?
-- Appendix A.2 gives empirical evidence of large cosine similarity between input and output of the MLP block. In which setup have these results been obtained? How generally can this be assumed for different downstream tasks?
-- Section 6 provide evidence that a persistent attention pattern does not exist in randomly initialised models. Is my understanding correct that the current study was limited to inference, and that the authors were not in a position to explore the evolution of the attention map during training, even for smaller models?
Rating
7: Accept: Technically solid paper, with high impact on at least one sub-area, or moderate-to-high impact on more than one areas, with good-to-excellent evaluation, resources, reproducibility, and no unaddressed ethical considerations.
Confidence
4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.
Limitations
The authors have acknowledged that running large language models can correspond to significant power consumption and CO2 emissions, but their work is aimed at improving the power efficiency of inference for large language models.