Efficient Streaming Language Models with Attention Sinks
- Publication
- ICLR 2024Conference
- First submitted to arXiv
- arXiv:2309.17453
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{transformersstreamingllm2023,
title = {{Efficient Streaming Language Models with Attention Sinks}},
author = {Guangxuan Xiao and Yuandong Tian and Beidi Chen and Song Han and Mike Lewis},
year = {2023},
eprint = {2309.17453},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2309.17453}
}
Suppose you want to keep a chat assistant running all day. Every few minutes the user asks a question, and the model answers.
During generation, the model stores the key and value each token produces at every layer, so the next token can use them directly instead of recomputing them; this data is the KV cache. Take Llama-2-7B, with 32 layers, 32 KV heads per layer, 128 dimensions per head and fp16 storage. The K and V for each token come to 512 KiB together. Filling its pre-training length of 4,096 tokens takes 2 GiB; a conversation that reaches 100,000 tokens takes about 49 GiB, nearly four times the model weights.
Memory is the smaller problem. Llama-2 was trained only on 4K-long segments, and once a sequence goes past that length, output quality collapses. So the question becomes how to trim the cache so the model can keep talking.
The most intuitive approach is to keep only the most recent tokens and throw the earlier ones away; this is called window attention. Memory stays fixed, and so does the computation per step. Unfortunately, it breaks down completely. In the paper, Llama-2-13B reads the first book of the PG-19 test set (about 65K tokens). Keeping only the most recent 1,024 tokens gives a perplexity of 5158; with the same total cache of 1,024, but made up of the first 4 tokens of the whole text plus the most recent 1,020, perplexity comes back to 5.40.
Perplexity measures how uncertain the model is, on average, when it predicts the next token; lower is better. The normal numbers you'll see in this note fall roughly between 5 and 20, and anything in the five thousands means the model is babbling.
Those first 4 tokens are likely nothing more than an <s> plus a word like “The.” Why does the model fall apart without them?
This paper starts from that strange phenomenon. The authors come from MIT, Meta AI, CMU and NVIDIA, and first author Guangxuan Xiao did part of the work during an internship at Meta AI; they call the method they end up proposing StreamingLLM.
Defining the problem

The top half of each column is the attention mask, with red cells for the token being predicted and blue cells for the positions it can see; the bottom half shows which tokens are left in the cache. is the length read so far. In the diagram, stands for both the pre-training length and the cache size; in the actual measurements, Llama-2-13B's pre-training length is 4,096 and the cache is 1,024. All four perplexities are on that same 65K-token book.
- (a) Dense attention: keep everything. The cache grows along with , and the accumulated computation is ; past 4K, the model meets positional distances it has never seen, and perplexity is 5641.
- (b) Window attention: keep only the KV of the most recent tokens. Each step has a fixed cost, in total; perplexity is 5158.
- (c) Sliding window with re-computation: for every new token, feed the raw text of the most recent tokens back into the model and compute the KV again from scratch. Every step is a full forward pass of length , with attention, for in total. Perplexity is 5.43. The quality is fine; it's just slow.
- (d) StreamingLLM: the most recent tokens plus the first few tokens (yellow), at the same cost level as (b), with perplexity 5.40.
Let's pause on (b) and (c). Both look at the same most recent tokens, so why does one break while the other works?
The difference lies in when the KV was computed. Take the example the authors gave in a GitHub issue (October 11, 2023). The sequence is [a, b, c, d, e, f, g], the window size is 4, and we now want to predict g.
- The recomputation version treats [d, e, f] as a brand-new input. d is at position 0 with nothing before it; e sees only d; f sees d and e.
- Window attention reuses the cache as is. d's KV was computed back when it came after a, b and c, and e and f were also computed with a string of tokens in front of them.
The recomputation version's window always contains a “start of sequence,” while window attention's window is all “middle of sequence.” What's so special about the start?
Before answering that, let's pin down when the collapse happens.

The vertical axis is log perplexity. The purple dashed line is the cache size (2,048 for Llama-2 and 1,024 for the others, half the pre-training length in every case), and the red dashed line is the pre-training length. The orange window attention line shoots up the moment the cache fills and starts dropping the first token; the blue dense attention line holds out until the pre-training length before it breaks. The green line (recomputation) and the red line (StreamingLLM) stay on top of each other the whole way.
How badly things collapse depends on the model. Llama-2-7B's orange line jumps straight above 8, which works out to a perplexity in the thousands; MPT-7B swings widely between about 5 and 13 once it passes the cache line; Pythia-12B and Falcon-7B end up only a little above the red line. But for every model, the moment things go wrong lines up with “the first token gets dropped.” It follows the cache size and has nothing to do with the pre-training length.
Solving the problem
The first tokens take most of the attention
The authors plotted the attention of every layer and every head in Llama-2-7B, averaged over 256 sentences of length 16. The bottom two layers (layers 0 and 1) are local, with nearer tokens getting more attention; from layer 2 on, almost every layer and every head has a large chunk of attention landing on the first token.
With sentences of only 16 tokens, could it just be that they're too short? The appendix stretches the length to 4,096 and measures again:

Each point is a layer. The vertical axis is the weight the 4,096th token gives the first token after softmax, and the error bars show the spread across the 32 heads in that layer. Apart from the bottom two layers, which are close to 0, every layer averages between 0.55 and 0.89. A token 4,095 positions away takes more than half the attention.
Is the content at the start especially important? The authors ran a simple control. They replaced the first 4 tokens of the whole text with newline characters \n and put them in the cache together with the most recent 1,020 tokens:
| Cache contents | Perplexity |
|---|---|
| Most recent 1,024 tokens | 5158.07 |
| First 4 + most recent 1,020 | 5.40 |
4 \n + most recent 1,020 | 5.60 |
Even with meaningless newlines, perplexity only moves from 5.40 to 5.60. What the model cares about is “the first few positions”; what's written there hardly matters.
Softmax won't let you abstain
Why does this happen? Go back to the attention formula. The query and each key produce a score , which softmax turns into weights:
The denominator sums over every position, so the weights always add up to 1. The problem is that not every head has something to look for at every step. Some heads are only useful in particular situations, and the rest of the time they'd be better off reading nothing; but softmax doesn't allow all the weights to be 0, so that attention has to go to somebody.
The authors' explanation is that the model learns to dump the attention it doesn't need on a few fixed tokens, which they call an attention sink. (Xiao later said in a blog post that the name comes from the sink in graph theory, a node that only takes in and never sends out.)
Why the start, of all places? Autoregressive models use a causal mask. The first token is visible to every token after it, while a token at position is seen only by the tokens that come after it. During training, position 0 is the one position every query can see, which makes it the easiest to train into a fixed dumping ground.
Now the earlier puzzle fits as well. Under the causal mask, the token at position 0 sees only itself in every layer, so its key is computed without any preceding context. As the authors put it on GitHub, an attention sink is exactly this kind of key computed without preceding context. The recomputation version recomputes the token at the front of the window as a start of sequence every time, so it naturally becomes a new sink; the KV in window attention's cache all carries preceding context, and the model can tell that none of it is a sink. That swapping in \n still works makes sense from this angle too. The first few positions have very little preceding context to see, and position 0 sees none at all.
So what happens if we take the sink away? Let's work through some numbers made up for illustration. Suppose a head has nothing much to look for at this step, the most recent 1,020 tokens in the cache all score 0, and the sink scores 7:
The sink takes 0.52, the same order of magnitude as in the figure above; every other token gets . Drop the sink, and the denominator is left with just 1,020, so each token gets , and every weight doubles. The vector this head reads out is completely different from anything seen in training; the next layer then receives input it has never seen either, and as this stacks up layer after layer, it can blow up into a perplexity in the five thousands.
Why keep 4?
If the sink is just position 0, wouldn't keeping 1 be enough? The authors compared keeping 0, 1, 2, 4 and 8 initial tokens:
| Model | 0 | 1 | 2 | 4 | 8 |
|---|---|---|---|---|---|
| Falcon-7B | 17.90 | 12.12 | 12.12 | 12.12 | 12.12 |
| MPT-7B | 460.29 | 14.99 | 15.00 | 14.99 | 14.98 |
| Pythia-12B | 21.62 | 11.95 | 12.09 | 12.09 | 12.02 |
| Llama-2-7B | 3359.95 | 11.88 | 10.51 | 9.59 | 9.54 |
This table should be read in two halves. Falcon, MPT and Pythia recover almost completely with 1 kept, and more makes no difference. Only Llama-2-7B needs 4, dropping from 11.88 with 1 to 9.59 with 4, while going up to 8 brings it only to 9.54, a small improvement by that point. On this basis, the paper sets the default to 4.
The authors' explanation is that these models had no fixed starting token during pre-training. Llama-2 does put <s> in front of each text, but that happens before the text is cut into training segments; after the cut, position 0 mostly holds whatever word happens to land there. With no stable place to dump attention, the model spreads it over several tokens at the start.
A rolling cache
The method itself is short. The cache is split into two parts. The attention sinks at the start are always kept, followed by a rolling window that keeps only the most recent tokens.

Look at the bottom row. When token 9 is being generated, tokens 0 to 3 are kept, 4 and 5 have already been evicted, and the rolling window holds 6, 7 and 8. The cache size is fixed, and so is the cost of each step.
The eviction logic in the official implementation is just these few lines. Each layer's K and V are cut twice along the sequence dimension, keeping the head and the tail and discarding the middle:
# streaming_llm/kv_cache.py, StartRecentKVCache (excerpt)
def __call__(self, past_key_values):
seq_len = past_key_values[0][0].size(self.k_seq_dim)
if seq_len <= self.cache_size:
return past_key_values
return [
[
torch.cat([self.k_slice(k, 0, self.start_size),
self.k_slice(k, seq_len - self.recent_size, seq_len)],
dim=self.k_seq_dim),
torch.cat([self.v_slice(v, 0, self.start_size),
self.v_slice(v, seq_len - self.recent_size, seq_len)],
dim=self.v_seq_dim),
]
for k, v in past_key_values
]
start_size is the number of sinks, 4 by default in both the class and the chat example; recent_size depends on memory, and the chat example sets it to 2,000; cache_size is the sum of the two. When evaluating perplexity, it's called once for every token computed; the chat example instead makes room for the whole turn's input and output before each new question.
Positions follow the order in the cache
Trimming the cache isn't enough on its own. The evicted tokens held positions in the original text, so how should the remaining tokens be numbered?
Take the bottom row of that figure again. The cache holds tokens 0, 1, 2, 3, 6, 7 and 8 of the original text, and token 9 is about to be generated. StreamingLLM gives them positions 0 to 7, renumbered by their order in the cache, instead of the original 0, 1, 2, 3, 6, 7, 8, 9.
The paper says this point is crucial to the results but gives no comparison numbers for leaving the positions unchanged. Let's reason out for ourselves what would happen with the original numbering. By the 4-millionth token, the relative distance between the query and the sink would be 4 million, far beyond the 4K the model saw in training, and we'd be back to the old problem of dense attention failing to extrapolate. With cache numbering, the largest distance never exceeds the cache size.
In implementation terms, RoPE rotates a key by an angle that depends on its position. If the cache stores keys that are already rotated, their positions are baked in. So StreamingLLM caches the keys before rotation instead, and at every decoding step rotates them again according to their order in the cache. The official Llama version does it in these two lines:
# streaming_llm/pos_shift/modify_llama.py (excerpt)
key_position_ids = torch.arange(kv_seq_len, device=position_ids.device).unsqueeze(0)
key_states = apply_rotary_pos_emb_single(key_states, cos, sin, key_position_ids)
kv_seq_len is the current length of the cache, so the keys' positions run from 0 all the way to the end of the cache; the new token's query is rotated using its position in the cache. The price is re-rotating every key in the cache at every step, a computation that grows linearly with the cache length.
ALiBi, which MPT uses, adds a bias to the attention scores that decreases with distance, so it's even more straightforward to handle. The bias is computed from the contiguous distances in the cache, with no jumps where tokens were dropped.
How is it different from Longformer and Mistral?
After the paper came out, someone on Hacker News commented that it looked like Longformer, with global attention simply renamed attention sink (October 3, 2023). The shapes really are alike, a few fixed positions plus a local window. Appendix B of the paper takes the view that sparse attention methods like Longformer and BigBird have to be trained from scratch, and the global attention patterns they rely on don't suit autoregressive models; StreamingLLM applies directly to models trained with ordinary dense attention, with no fine-tuning, and changes only the cache at inference time.
Mistral 7B's rolling buffer cache also keeps only the most recent tokens; the difference is that Mistral was trained with a sliding window. The paper doesn't test whether such a model still needs a sink at inference. A third-party experiment the authors cite on GitHub says it does, but that experiment's window was only 1,024, much smaller than the 4,096 Mistral was trained with.
Building a sink in during pre-training
If the model spreads the sink over several tokens because it has no fixed starting point, why not give it one during training? The authors compared two ways of doing this.
The first modifies softmax by adding 1 to the denominator, the version Evan Miller proposed:
The extra 1 is equivalent to inserting a token at the very front whose key and value are all zeros. With a zero key, its score is 0, and goes into the denominator; with a zero value, the weight it receives carries no content in. The paper calls this Zero Sink. The second approach puts a learnable placeholder token at the front of every training sample, called Sink Token.
The experiment reuses Pythia-160M's code and training recipe and trains three 160-million-parameter models from scratch on the deduplicated Pile, differing only in how the sink is handled: ordinary softmax (Vanilla), Zero Sink and Sink Token. Section 4.2 of the paper gives the training details for the Vanilla and Sink Token models. The batch size is reduced to 256, everything else follows Pythia's original settings, and both are trained for 143,000 steps on a server with 8 A6000s.
| Model | 0 | 1 | 2 | 4 |
|---|---|---|---|---|
| Vanilla | 27.87 | 18.49 | 18.05 | 18.05 |
| Zero Sink | 29214 | 19.90 | 18.27 | 18.01 |
| Sink Token | 1235 | 18.01 | 18.01 | 18.02 |
With the Sink Token model, keeping just that 1 sink gives a perplexity of 18.01, already the best value in the table. Vanilla needs 2 to reach 18.05. Zero Sink is still at 19.90 with 1 kept and only catches up at 4, which shows that besides the all-zero sink, the model is still using other initial tokens as sinks.
The leftmost column holds one more detail. Once the Sink Token model loses even its sink, perplexity is 1235, far worse than Vanilla's 27.87, which shows the model now depends entirely on this sink, so it has to stay in the cache at all times. As for Zero Sink's 29214, the authors explained on GitHub (October 18, 2023) that once the all-zero token is dropped, inference falls back to ordinary softmax, which no longer matches training.
Does adding a sink hurt the model itself? The training loss curves of the two models almost overlap. On 7 zero-shot benchmarks including ARC, HellaSwag, LAMBADA, OpenbookQA, PIQA and Winogrande, the Sink Token version is about the same as Vanilla or slightly higher on every one, never by more than 1 point (ARC-Challenge, for example, is 18.6 vs. 19.6). The paper reports a single set of numbers per setting, with no error bars from multiple training runs, so what these numbers support is “it doesn't get worse.” The appendix also tried 2 sink tokens. Streaming performance didn't improve, and the model instead needed to keep both, with a perplexity of 25.73 when only 1 was kept.
On this basis, the authors recommend that future LLM pre-training put a sink token at the front of every sample.
Discussion
4 million tokens and streaming QA
The main experiments use four model families. Llama-2, Falcon and Pythia use RoPE, MPT uses ALiBi, and all keep 4 sinks by default. The authors concatenate the 100 books of the PG-19 test set into a single stream and have Llama-2-7B/13B/70B, Falcon-7B/40B, Pythia-2.8B/6.9B/12B and MPT-7B/30B read all the way through 4 million tokens with StreamingLLM. None of their log perplexities drift upward, and the ups and downs along the way come from switching books. This experiment plots only StreamingLLM's curves, and it measures whether the model can keep writing stably; whether it still remembers content from 4 million tokens back is a question for the later experiments.
The cache-size ablation is interesting too. A bigger cache doesn't keep improving perplexity. Llama-2-7B is at 9.08 with 4+2044, but goes up to 9.59 with 4+4092; MPT-7B gets steadily worse, from 14.12 at 4+252 to 14.99 at 4+2044. The authors' reading is that these models may not make full use of the context they are given.
Next comes a setting closer to chat. The authors concatenate all the questions and answers of ARC-Easy and ARC-Challenge into one continuous input for Llama-2-Chat and check the output at every answer position, with a cache of 1,024 throughout. Dense attention simply runs out of memory; window attention's accuracy drops to nearly 0, for example 0.32% for 70B on ARC-Challenge; StreamingLLM reaches 80.20%, slightly above the one-shot baseline of 78.50%, where each question is asked on its own, and 7B and 13B follow the same pattern. (During streaming, the cache still holds the questions and answers of the previous few items, which may act somewhat like demonstrations; that's this note's guess, and the paper doesn't analyze it.)
The authors also built StreamEval. The input is a series of lines of the form The REGISTER_CONTENT in line N is <NUMBER>, and every 10 lines it asks about the content from 20 lines earlier. The answer always stays in the cache, and StreamingLLM's accuracy holds steady up to 120K tokens; dense attention and window attention fail at the pre-training length and the cache size, respectively.
22.2× compared with what?
The speed experiments compare only against the recomputation version, on the grounds that it's the only baseline with acceptable quality. Both are implemented with Hugging Face Transformers, and per-token decoding latency is measured on a single A6000:
| Cache | 7B recompute | 7B streaming | 13B recompute | 13B streaming |
|---|---|---|---|---|
| 256 | 63 | 31 | 99 | 48 |
| 1024 | 223 | 35 | 361 | 60 |
| 2048 | 523 | 45 | 860 | 75 |
| 4096 | 1411 | 65 | 2355 | 106 |
The 22.2× in the abstract is Llama-2-13B at a cache of 4,096, 2,355 vs. 106 ms; the smaller the cache, the smaller the gap, down to only about 2× at 256. The recomputation version does a full forward pass of length at every step, so its latency climbs quickly with cache length, which the paper calls quadratic growth; StreamingLLM computes only one new token per step, and its latency grows linearly. Memory is about the same, between 13 and 21 GB for 7B in both cases, most of it model weights.
Read this comparison carefully. Window attention's per-step cost is the same as StreamingLLM's; its quality just isn't usable. The 22.2× measures “how much cheaper it is to get the recomputation version's quality.” Someone also pointed out on GitHub (October 2023) that models like Mistral use a rolling cache without recomputation, and that production deployments mostly run on inference frameworks like vLLM and TGI, so latency measured with Hugging Face's generate is some distance from what a production service sees.
What's outside the window stays out of sight
Three days after the paper went up on arXiv, the GitHub repo hit Hacker News, collecting 421 points and 65 comments. Many people read “infinite-length inputs” as meaning you could throw an entire book at it. About two hours into the discussion, the authors added an FAQ to the README stating plainly that the context window doesn't get any bigger; throw a book in, and the model only knows the last few passages. Later in the same thread, a user tested it by feeding in a book from Project Gutenberg one passage at a time and asking a question at the end, and reported that “it entirely hallucinated its answers.”
Two experiments in the paper's appendix measure this boundary clearly. The first runs StreamEval on Llama-2-7B-32K-Instruct, which supports a 32K context, and widens the distance between question and answer (23 tokens per line):
| Distance | 4+2044 | 4+4092 | 4+8188 | 4+16380 |
|---|---|---|---|---|
| 460 | 85.80 | 84.60 | 81.15 | 77.65 |
| 1,840 | 75.30 | 77.15 | 76.40 | 73.80 |
| 2,300 | 0.00 | 61.60 | 50.10 | 40.50 |
| 4,600 | 0.00 | 0.00 | 62.75 | 46.90 |
| 9,200 | 0.00 | 0.00 | 0.00 | 45.70 |
| 18,400 | 0.00 | 0.00 | 0.00 | 0.00 |
As soon as the answer falls outside the cache, accuracy drops straight to zero. 4+2044 hits zero at 2,300 tokens, 4+4092 at 4,600, and 4+8188 at 9,200. With the largest setting, 4+16380, accuracy keeps sliding even while the answer is still in the cache, down to just 28.50% at 13,800 tokens; at short distances it's actually worse than the small caches (77.65 vs. 85.80 at 460 tokens). The model can't always use even what's in the cache.
In principle, the KV in deeper layers is computed at its own point in time, after seeing the window as it was then, so information has a chance to pass forward layer by layer; someone on Hacker News raised this possibility too, and the theoretical range of about 130,000 tokens that the Mistral note gets by multiplying the number of layers by the window rests on the same reasoning. This table shows that, at least on this task, information outside the cache might as well not exist.
The second uses LongBench. Llama-2-7B-chat's input limit is set to 3,500 tokens, and the official baseline truncates from the middle, keeping 1,750 tokens each from the start and the end:
| Task | Truncation | 4+3496 | 1750+1750 |
|---|---|---|---|
| NarrativeQA | 18.7 | 11.6 | 18.2 |
| Qasper | 19.2 | 16.9 | 19.7 |
| HotpotQA | 25.4 | 21.6 | 24.9 |
| 2WikiMQA | 32.8 | 28.2 | 32.0 |
| GovReport | 27.3 | 23.9 | 26.3 |
| MultiNews | 25.8 | 25.5 | 25.9 |
With only 4 sinks kept, all six tasks lose to the truncation baseline, and NarrativeQA drops from 18.7 to 11.6; widening the “sink” to the first 1,750 tokens brings it back to the truncation baseline's level. The authors' explanation is that 4+3496 throws away the prompt content at the start. StreamingLLM's performance depends entirely on what's left in the cache; if the question comes at the start, the start has to be kept long enough.
Code and data
The official code was released within days of the paper, including the core implementations for Llama-2, MPT, Falcon and Pythia, perplexity evaluation and the chat example. The paper's reproducibility statement says the code and datasets are all in the repo and readers can reproduce all of the results; on the README's to-do list, the “Release StreamEval dataset and evaluation code” box was still empty at the last update (July 2024). On October 4, 2023, the authors replied in an issue with “We will release our benchmark shortly” (“shortly” covers a lot of ground); another issue, from January 2024, asking where StreamEval was, got no response at all. For the 160M experiments that pre-train with a sink token, there's no training code in the repo either.
What came after
The community picked it up quickly. In an October 9, 2023 blog post, Tom Aarsen introduced attention_sinks, an independent implementation. Generating 10,000 tokens in a row with Llama-2-7B, plain window attention started producing gibberish after about 1,000 tokens, while the version with sinks stayed fluent throughout; Aarsen also noted that Llama-2-7B-chat still occasionally lost fluency in continuous chat tests. Aarsen later built the mechanism into Hugging Face Transformers. SinkCache was merged in December 2023, and the same PR also introduced the Cache abstract class to Transformers. NVIDIA TensorRT-LLM added StreamingLLM support for Llama in v0.8.0 in February 2024.
The built-in version in Transformers didn't stay. In June 2025, the already deprecated SinkCache was moved out to a custom_generate repository on the Hub, and in October of the same year it was removed from the v5 main line.
What lasted longer is the idea of “giving attention somewhere to go.” In October 2024, an analysis by Gu et al. found that attention sinks emerge naturally given enough training data and optimization, and behave more like a key bias that stores surplus scores; once softmax is replaced with sigmoid attention, which skips normalization, models of up to 1 billion parameters no longer develop sinks. In August 2025, OpenAI released gpt-oss, and its model card states that each attention head has a learned bias in the softmax denominator, “similar to off-by-one attention and attention sinks,” citing exactly Evan Miller's article and this paper; its attention layers also alternate between 128-token banded windows and dense attention. Compared with the paper's Sink Token, this is one scalar per head, with no need to insert a token in front of the data.
Conclusion
StreamingLLM starts from a very concrete failure. Window attention collapses as soon as it drops the first token. The authors followed the trail and found that the model dumps the attention softmax can't spend onto the first few tokens, and that swapping those tokens for newline characters works just as well. So by always keeping 4 sinks, evicting everything else with a rolling window, and renumbering positions by their order in the cache, Llama-2, MPT, Falcon and Pythia can read through 4 million tokens stably without fine-tuning, with per-token decoding up to 22.2× faster than the recomputation version. The pre-training experiment goes one step further. In a 160-million-parameter model, putting a sink token at the front of every sample means only that 1 needs to be kept at inference.
Its boundaries are just as clear. Content outside the window is simply gone. In StreamEval, accuracy drops straight to zero once the distance exceeds the cache; on LongBench, keeping only 4 sinks can't even beat the plainest truncation.
For long-running conversations, continuous generation, or any streaming scenario that needs only recent content, this is a very cheap approach. A few lines of cache eviction logic plus position renumbering, and memory stays fixed. Keep two things in mind when you use it. The system prompt or the question usually sits at the very front, and keeping only 4 sinks will drop them, so you have to count the part of the start you need into the sink length yourself. For long-document QA or summarization, you'll need a different method that extends the context or uses retrieval.
This paper set out only to keep a chatbot talking, but what left the longer-lasting mark was its observation of attention sinks. Softmax won't let an attention head abstain, so the model finds a spot at the start to dump its attention; later, some people wrote that spot straight into the architecture, and others changed softmax so the model no longer needs it. Next time you see the first token light up as a solid stripe in an attention visualization, it probably isn't that the word matters much; the attention just has nowhere else to go.