1 00:00:01,000 --> 00:00:09,300 [Hal Turing] Alrighty! Thanks for tuning in! Hello AI world! I am your host, Hal Turing, and my co-host is Dr. Ada Shannon. 2 00:00:09,300 --> 00:00:41,775 [Hal Turing] Today's paper is Sliding-Window Beats Linear Attention, by Alexia Jolicoeur-Martineau and colleagues at Microsoft's Applied Sciences Group. It's a 2026 arXiv preprint, version two, from October. The claim: take a pretrained LLM, cut its attention down to the last 64 tokens plus four special starting tokens, do zero training, and it keeps about 99% of the model's benchmark score. That reportedly rivals months of work on converting models to linear attention. 3 00:00:41,775 --> 00:00:54,575 [Dr. Ada Shannon] If it holds, a lot of retrofit papers were treated as progress without beating a free baseline. But "keeps 99%" needs a closer look. Ninety-nine percent of what, measured on what? 4 00:00:54,575 --> 00:01:12,700 [Hal Turing] That's my question too. Recovery is the student's score divided by the full-attention model's score. So 99% means 99% of the original model's number, not 99% accuracy. And what are these benchmarks actually asking of the model? 5 00:01:12,700 --> 00:01:30,775 [Dr. Ada Shannon] That's the thread for the whole episode, so let me build the pieces first. When a transformer generates text, each new token attends to every earlier token. To avoid recomputing, it stores the keys and values of all past tokens. That's the KV cache, and it grows with every token. 6 00:01:30,775 --> 00:01:34,350 [Hal Turing] So memory scales with context length. 7 00:01:34,350 --> 00:01:54,375 [Dr. Ada Shannon] Yes, and compute per token grows too. There are two families of fixes. One shrinks or evicts the cache, meaning you throw away stored tokens to cap memory. The other replaces the cache with a fixed-size summary, which is linear attention. The paper's complaint is that the second family was never compared against the simplest version of the first. 8 00:01:54,375 --> 00:01:56,875 [Hal Turing] What's the simplest eviction? 9 00:01:56,875 --> 00:02:15,525 [Dr. Ada Shannon] Sliding window attention. Each token only attends to the most recent tokens, so the cache has a fixed size. It drops by age and never by importance. Score-based policies such as H2O and SnapKV choose by importance instead, and the paper lists those as untested future work. 10 00:02:15,525 --> 00:02:24,675 [Hal Turing] Say the context is 4,000 tokens and the window is 64. Anything older than 64 tokens is just gone? 11 00:02:24,675 --> 00:02:59,050 [Dr. Ada Shannon] Gone, as far as that layer is concerned. Keep that picture, because the question for the whole episode is whether the needed fact is still inside the window. If a task only needs the last few dozen tokens, the window is enough. If the answer sits 3,000 tokens back, it can't be. There's also a catch. Plain windowing breaks badly on models trained with full attention. Quality collapses once the very first tokens fall out. Softmax attention weights must sum to one, and pretrained heads often have nothing useful to attend to, so they park the surplus on the first few tokens. Those are called attention sinks. 12 00:02:59,050 --> 00:03:05,625 [Hal Turing] So evict the sinks and that leftover attention gets forced onto unrelated tokens. 13 00:03:05,625 --> 00:03:26,625 [Dr. Ada Shannon] Exactly. The fix comes from the StreamingLLM paper, Efficient Streaming Language Models with Attention Sinks, by Guangxuan Xiao and colleagues, ICLR 2024. Always keep the first four tokens, plus a recent window. This paper writes it SWA(w,4), where w includes the sinks. So SWA(64,4) is four sinks and sixty recent tokens, with no retraining. 14 00:03:26,625 --> 00:03:30,974 [Hal Turing] Does that mean the model remembers the distant past? 15 00:03:30,974 --> 00:03:45,250 [Dr. Ada Shannon] No. StreamingLLM claimed stable streaming, not long-term memory. Tokens outside the window aren't remembered. So using it as a retrieval baseline stretches what it was built for, and we'll come back to that. 16 00:03:45,250 --> 00:03:49,550 [Hal Turing] And why four? Is there a reason it isn't one or ten? 17 00:03:49,550 --> 00:04:09,725 [Dr. Ada Shannon] Xiao found four empirically. Barbero and colleagues, in a 2025 paper on why LLMs attend to the first token, give a mechanism. Sinks let a head do almost nothing, which limits over-mixing of information across layers. That explains why sinks exist and why this works on pretrained weights. It doesn't explain why the count is exactly four. 18 00:04:09,725 --> 00:04:13,525 [Hal Turing] Okay, now the other side. Linear attention. 19 00:04:13,525 --> 00:04:33,075 [Dr. Ada Shannon] Replace softmax with a feature map, phi. Then the past folds into a fixed-size running state. Roughly, the state at time t is the previous state plus phi of the key times the value, with a normalizer alongside. Memory and per-token cost stop growing. But the state keeps rewriting itself, so something has to be forgotten. 20 00:04:33,075 --> 00:04:38,025 [Hal Turing] And retrofitting means converting an existing model to that? 21 00:04:38,025 --> 00:04:59,150 [Dr. Ada Shannon] Right, also called linearization. You take a pretrained softmax model and train it into a linear one. The cost varies widely: about 20 million tokens for Liger-GLA, 40 million for LoLCATs, up to 100 billion for SUPRA. One detail matters: LoLCATs and Liger are hybrids that already include a small sliding window. So the window is already part of those retrofits. 22 00:04:59,150 --> 00:05:03,225 [Hal Turing] One more reference, I think. Cabannes and colleagues. 23 00:05:03,225 --> 00:05:23,675 [Dr. Ada Shannon] Yes, Loïc Cabannes and coauthors, ICLR 2026, Short window attention enables long-term memorization. As the paper describes it, short windows can encourage models to learn dependencies beyond the local field. But that's about models trained with windows. This paper applies a window to a model that was never trained for it. 24 00:05:23,675 --> 00:05:28,550 [Hal Turing] Two terms before we stop. The benchmarks are of two kinds, right? 25 00:05:28,550 --> 00:05:50,600 [Dr. Ada Shannon] Yes. One kind is log-likelihood multiple choice: MMLU, ARC, HellaSwag, PIQA, WinoGrande. The model never writes an answer. The harness scores how probable each candidate is given the question. Everything needed usually sits within a few dozen tokens of the scored text. The other kind is generative, like GSM8K math and HumanEval code, where the model writes a long solution and keeps reading its own earlier work. 26 00:05:50,600 --> 00:06:03,875 [Hal Turing] So the two questions are these. Does 99% measure retained capability, or just that the benchmarks are local? And if memory budgets aren't fixed across the comparison, is it fair at all? 27 00:06:03,875 --> 00:06:37,699 [Dr. Ada Shannon] That's it. Keep the 4,000-token example in your head. Now, what they actually did: twelve pretrained models, from 1.3 billion to 72 billion parameters, across Phi, Mistral, Llama 2, 3 and 3.1, Qwen2.5 and QwQ. At inference they swapped full attention for the window with four sinks. No weights changed. They compared that against published retrofits and a few they trained themselves. Some are pure linear attention; LoLCATs and Liger are linear plus a small window, so they already contain the thing being tested. Hybrids that keep some full-attention layers are excluded. 28 00:06:37,699 --> 00:06:41,699 [Hal Turing] Then the 99% comes from which tests? 29 00:06:41,699 --> 00:07:17,000 [Dr. Ada Shannon] Six multiple-choice benchmarks, all scored by log-likelihood. MMLU is exam questions across many subjects. ARC is grade-school science. HellaSwag, PIQA and WinoGrande test sentence completion, physical common sense and pronoun resolution. Higher is better on all of them. With a 64-token window, the average comes out at 99.0% of the full model. The best retrofits, QRWKV6 at 99.1% and LoLCATs at 97.5%, needed hundreds of millions and forty million training tokens respectively. 30 00:07:17,000 --> 00:07:19,774 [Hal Turing] So it's a tie, not a win. 31 00:07:19,774 --> 00:07:39,724 [Dr. Ada Shannon] A tie at zero cost, and that's the real contribution. The 99.0 versus 99.1 gap is inside the paper's own spread. Also, different methods are scored on different base models, so Table 1 compares aggregates, not like for like. Table 2 is closer, and there the window has the best average in nine of eleven cases. 32 00:07:39,724 --> 00:07:42,750 [Hal Turing] Before I trust it, where does it lose? 33 00:07:42,750 --> 00:08:02,725 [Dr. Ada Shannon] MMLU five-shot, and nowhere else clearly. On Qwen2.5-7B-Instruct it drops from 74.2 to 70.3. On several other columns it matches or slightly beats the full model. That makes me distrust the benchmark: if throwing away nearly all the context doesn't hurt, the test wasn't using distant context. 34 00:08:02,725 --> 00:08:06,150 [Hal Turing] And why would MMLU be the exception? 35 00:08:06,150 --> 00:08:26,175 [Dr. Ada Shannon] The paper doesn't say. My guess is that five-shot prompts put worked examples before the question, and a 64-token window evicts them, so the model is effectively answering zero-shot. That's a hypothesis, not a finding. One more caveat: the authors' own retrofits score near chance on MMLU, so those baselines are undertrained and not state of the art. 36 00:08:26,175 --> 00:08:30,325 [Hal Turing] Now the generative side. There the model has to write. 37 00:08:30,325 --> 00:08:57,250 [Dr. Ada Shannon] GSM8K is grade-school math, scored by exact match on the final answer. HumanEval is code, scored by whether the first attempt passes the tests. Both need the model to keep reading its own earlier steps. Take Qwen2.5-7B base. The full model solves about 82 problems in a hundred. With a 64-token window it solves about one in two hundred. At 256 it's about a third. At 512 it's nearly half, 46.6. 38 00:08:57,250 --> 00:09:03,825 [Hal Turing] So same method, eight times the window, and it goes from useless to a bit over half the teacher. 39 00:09:03,825 --> 00:09:23,000 [Dr. Ada Shannon] Right. The paper says it plainly: generative tasks require larger windows. And it varies by model. Llama-3.1-8B at 512 gets 49.2 against a teacher at 50.8. The Qwen models stay well short even at 512, and nothing in the paper explains the difference. 40 00:09:23,000 --> 00:09:26,200 [Hal Turing] Do the linear models do any better? 41 00:09:26,200 --> 00:09:48,650 [Dr. Ada Shannon] Mixed. On Qwen2.5-7B-Instruct, averaged over GSM8K and HumanEval, the linear model QRWKV7 beats the 256 window but not the 512 window. And LoLCATs on Llama gets 0.6 on GSM8K, against 49.2 for the 512 window. So the clean win needs the 512 window. Keep that in mind, because nothing in these tables holds memory fixed. 42 00:09:48,650 --> 00:09:52,900 [Hal Turing] Right, that's the budget question. What about long context? 43 00:09:52,900 --> 00:10:21,475 [Dr. Ada Shannon] Two tests, both about hiding a fact in a long text. Needle-in-a-haystack buries one sentence in filler and asks for it back. BABILong buries the supporting facts for simple questions, like where Mary is, inside book text. A fixed window can only succeed if the fact is still inside it. The headline claim is two to ten times higher than linear attention. Provenance matters: Tables 4 and 5 take baselines from another paper, Meng and colleagues in 2026. Table 6, with LongBench, RULER and longer BABILong, the authors ran themselves. 44 00:10:21,475 --> 00:10:24,350 [Hal Turing] And speed? Windows should be cheap. 45 00:10:24,350 --> 00:10:48,100 [Dr. Ada Shannon] They are, in a small test. It's a four-layer toy transformer, batch size one, half precision, on one RTX PRO 6000 Blackwell card. Full-attention decoding slows down past about a thousand tokens of context. The others stay flat, and the window is fastest. Memory is more nuanced. From lowest to highest it runs window-64, linear, LoLCATs, then window-512. The paper claims similar or lower memory only for windows below 512. 46 00:10:48,100 --> 00:10:56,300 [Hal Turing] So the 512 window, which wins generation, is the most memory-hungry of the fixed-memory options. 47 00:10:56,300 --> 00:11:00,750 [Dr. Ada Shannon] In that figure, yes. We'll come back to what that does to the headline. 48 00:11:00,750 --> 00:11:07,125 [Hal Turing] First, mechanism. Why would a window beat a learned linear state at long range at all? 49 00:11:07,125 --> 00:11:28,025 [Dr. Ada Shannon] A linear state has one job: compress everything into a fixed-size summary, overwriting as it goes. A retrofit has to learn what to keep from about forty million tokens. A window learns nothing. It keeps recent tokens exactly and untouched. That helps when the answer is recent, and a poorly trained state has little to compete with. It stops at the edge: anything older than the window is simply gone. 50 00:11:28,025 --> 00:11:41,075 [Hal Turing] So the window wins by not trying to remember anything. Then let me ask the first question straight. Does the 99% measure retained capability, or just how local those benchmarks are? 51 00:11:41,075 --> 00:12:03,875 [Dr. Ada Shannon] How local they are. A log-likelihood answer needs a few dozen tokens, and 64 plus the sinks covers that. The paper's own table shows it: SWA matches or beats the teacher on several columns, which a model that had lost something wouldn't be expected to do. And on GSM8K, where the model has to keep reading its own work, the 64-token window scores between zero and under three percent. The Qwen 7B Instruct teacher scores about 75. 52 00:12:03,875 --> 00:12:06,975 [Hal Turing] Is that the authors hiding something? 53 00:12:06,975 --> 00:12:26,825 [Dr. Ada Shannon] No. They inherited the benchmark family from the linearization papers they compare against, and they published the generative table themselves. But the abstract and Table 1 lead with the family where a window is structurally favored. And the 'largest gains on generative tasks' framing only holds at window 512, not 64. 54 00:12:26,825 --> 00:12:30,975 [Hal Turing] Which brings up the budget. Which window is the headline? 55 00:12:30,975 --> 00:12:49,325 [Dr. Ada Shannon] That's the problem. Window 64 is the cheapest and fails generation. Window 512 wins generation and long context, and in the paper's own memory figure it uses more than both the linear model and LoLCATs. So 'cheap and good' is two different configurations. 56 00:12:49,325 --> 00:12:51,950 [Hal Turing] Is there a fair reading of it? 57 00:12:51,950 --> 00:13:14,500 [Dr. Ada Shannon] Yes. In the long-context table the windows are matched at 128, 256 and 512. LoLCATs carries that same window plus a linear state, so SWA does win with less memory. The counter is that the retrofit's training budget, its window in the LongBench-style runs, and how well it was tuned aren't controlled. A clean test fixes bytes of memory per layer and plots accuracy against memory. The paper doesn't do that. 58 00:13:14,500 --> 00:13:19,225 [Hal Turing] What about the long-context multiples, the two to ten times? 59 00:13:19,225 --> 00:13:50,750 [Dr. Ada Shannon] They're real in the tables, but they're ratios of small numbers. On the hardest needle task at 4K, SWA finds the fact roughly one time in five, and the retrofits almost never do, while the full model is near 100. On BABILong at 4K it's 15 against 3, and full attention is 60. On RULER, SWA with window 512 scores 22.7 against 98.6 for the full Qwen 7B Instruct. So a ten-times lead can sit on a floor. Those retrofit baselines also come from another paper's harness, not the authors' own runs. 60 00:13:50,750 --> 00:13:54,825 [Hal Turing] And the 100% at half a thousand tokens? 61 00:13:54,825 --> 00:14:30,400 [Dr. Ada Shannon] That only shows the whole context fit in the window. It decays as the context outgrows it. And SWA doesn't win everywhere. QRWKV6 beats it on LongBench for the 32B Instruct model, and QRWKV7 beats it on BABILong at 8K for the 7B Instruct. There are also odd rows the paper doesn't explain. One Llama BABILong teacher score equals the window result, and the QwQ-32B window row in the short-context table is identical to its teacher row in every column. I wouldn't call those errors, but they're unexplained. 62 00:14:30,400 --> 00:14:32,725 [Hal Turing] So what's the right reading? 63 00:14:32,725 --> 00:14:50,151 [Dr. Ada Shannon] A fixed window gives you recent context exactly and forgets the rest. A weakly trained linear state does worse. Neither is long-term memory. 'Better than a weak retrofit' isn't the same as good, and no tested fixed-memory method gets near full attention at long range. 64 00:14:50,151 --> 00:14:54,176 [Hal Turing] Does the StreamingLLM lineage make that worse? 65 00:14:54,176 --> 00:15:14,651 [Dr. Ada Shannon] It stretches the original purpose. Xiao and colleagues claimed stable streaming, not memory, so SWA's long-context scores are partial-credit retrieval from whatever stays in the window. Cabannes and colleagues showed that windows can support memorization when training is involved. That's the post-training direction this paper lists as future work, not what was tested here. 66 00:15:14,651 --> 00:15:17,051 [Hal Turing] And the eviction question? 67 00:15:17,051 --> 00:15:40,276 [Dr. Ada Shannon] Sink plus window is the simplest eviction rule. Beating a retrofit with it says retrofits are weak baselines against naive eviction. It doesn't say it's the best eviction. H2O and SnapKV choose by importance at the same budget. Quest-style query-aware retrieval, hybrids with a few full-attention layers, and natively trained linear models are all untested. And the authors' own retrofits sit near chance on MMLU, which points at an undertrained recipe, not at linear attention itself. 68 00:15:40,276 --> 00:15:42,751 [Hal Turing] Practically, who should care? 69 00:15:42,751 --> 00:16:11,926 [Dr. Ada Shannon] Anyone writing a retrofit paper: this is now a free baseline you must beat. For short-context scoring or streaming where only recent text matters, sink-plus-window is a sensible default. For math, code or retrieval, 64 tokens is unusable, and 512 recovers roughly half to most of the teacher on GSM8K depending on the model. The 'strongly recommend' language outruns the evidence beyond the short regime. The speed test is a four-layer toy at batch size one, and no row reports statistical uncertainty. 70 00:16:11,926 --> 00:16:13,726 [Hal Turing] What would settle it? 71 00:16:13,726 --> 00:16:27,552 [Dr. Ada Shannon] A fixed-byte-budget comparison, score-based eviction against retrofits, SWA with post-training, as in the SWAA work by Yu and colleagues, against retrofits at matched tokens, and hybrids. 72 00:16:27,552 --> 00:16:54,877 [Hal Turing] So here's where I land. A zero-training window with sinks matches expensive linearization on short-context benchmarks and beats the tested retrofits on long-context tasks, so retrofits have to be compared to it from now on. The limits are that the 99% reflects how local those benchmarks are, generation needs a much bigger window, and no fixed-memory method gets near full attention at long range. Thanks for listening, everyone. Goodbye!