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:37,850 [Hal Turing] Today's paper is "Speculative Prefill: Turbocharging TTFT with Lightweight and Training-Free Token Importance Estimation." The first author is Jingyu Liu, from the University of Chicago and Carnegie Mellon University, and it's an ICML 2025 paper. The headline claim is that a Llama-405B model can be served with up to 7x higher maximal queries per second and a 7.66x faster time to first token, with no retraining. 3 00:00:37,850 --> 00:00:57,400 [Dr. Ada Shannon] The mechanism is simple to state. A small model reads your prompt first and decides which tokens matter. The big model then prefills only those tokens. The question is whether the big model can answer well from a prompt with most of it missing. The 7.66x only holds under particular conditions, so we'll look at which ones. 4 00:00:57,400 --> 00:01:03,900 [Hal Turing] Let's start with the vocabulary. Time to first token, TTFT. What is it waiting on? 5 00:01:03,900 --> 00:01:26,550 [Dr. Ada Shannon] Inference has two phases. Prefill reads the entire prompt in one parallel pass and builds the KV cache, the stored keys and values the model reuses later. Decode then produces the answer one token at a time. TTFT is essentially the prefill wait. Prefill is compute-bound, because thousands of tokens are processed at once. Decode is mostly memory-bound, because each step moves a lot of weights and cache for a single token. 6 00:01:26,550 --> 00:01:33,725 [Hal Turing] So if I paste in a long document and ask for a one-line summary, nearly all the work is prefill. 7 00:01:33,725 --> 00:01:45,550 [Dr. Ada Shannon] Yes. The paper cites input-to-output ratios around ten to one in real traffic. A long prompt with a short answer is the common case, so prefill is where the time goes. 8 00:01:45,550 --> 00:01:48,225 [Hal Turing] And you said it matters twice. 9 00:01:48,225 --> 00:02:10,000 [Dr. Ada Shannon] First, it's the wait the user feels. Second, it limits throughput. The paper argues that the highest query rate a server can sustain under a timeout scales roughly as one over TTFT. The paper's own footnote calls that an approximation, and it assumes the timeout is long. Under that assumption, cutting TTFT by N times raises maximal QPS by about N times. 10 00:02:10,000 --> 00:02:16,500 [Hal Turing] People have attacked long prompts with sparse attention, like MInference. Why isn't that enough? 11 00:02:16,500 --> 00:02:38,324 [Dr. Ada Shannon] Because attention isn't always the bottleneck. For large batches of short-to-medium prompts, the MLP layers and the all-reduce communication across tensor-parallel GPUs dominate. Sparse-attention prefill methods such as MInference and FlexPrefill only touch attention. Dropping tokens removes MLP work, attention work and communication traffic together. 12 00:02:38,324 --> 00:02:42,924 [Hal Turing] Then what's the rest of the landscape? There's a lot of KV-cache work. 13 00:02:42,924 --> 00:03:01,474 [Dr. Ada Shannon] Much of it targets decode. H2O and StreamingLLM evict or limit cached entries. That saves memory, but the full prefill has already happened, so TTFT doesn't improve. Quest and RetrievalAttention pick relevant cache entries at decode or retrieval time, which is a different stage again. 14 00:03:01,474 --> 00:03:21,025 [Dr. Ada Shannon] The closest ancestor is SnapKV, by Yuhong Li and colleagues, 2024. It scores cache entries using attention from a window at the end of the prompt, and SpecPrefill's last-token scoring comes from that idea. But SnapKV still runs the full prefill first, so it compresses the cache without making the prefill cheaper. 15 00:03:21,025 --> 00:03:24,550 [Hal Turing] What about methods that prune during prefill? 16 00:03:24,550 --> 00:03:55,375 [Dr. Ada Shannon] LazyLLM, by Qichen Fu and colleagues, 2024, prunes tokens progressively inside the base model's own prefill, and it can revive tokens later. GemFilter uses the big model's own middle-layer attention for a first pass. Both rely on the expensive model to decide what to keep. SwiftKV and KV Prediction avoid some prefill compute, but they need fine-tuning or a learned predictor. LLMLingua is prompt compression: it rewrites the text to make it shorter, rather than skipping computation inside the big model. 17 00:03:55,375 --> 00:04:02,800 [Hal Turing] So the gap is a method that is training-free and doesn't use the big model to choose. That's the speculator. 18 00:04:02,800 --> 00:04:24,775 [Dr. Ada Shannon] Right. The speculator is a small model from the same family, here Llama-3.1-8B. The word comes from speculative decoding, but don't conflate them. Speculative decoding drafts output tokens for the big model to verify. Here the small model guesses which input tokens matter. The paper's central assumption is token transferability: what the 8B model thinks is important is also what the 405B model needs. 19 00:04:24,775 --> 00:04:31,900 [Hal Turing] Is the importance score some principled information measure? The topic list says information-theoretic. 20 00:04:31,900 --> 00:04:50,575 [Dr. Ada Shannon] That's our lens, not the paper's. The score is an attention heuristic. It measures how much the speculator's last token, plus a few look-ahead decoded tokens, attends to each prompt token. There's no formal information-theoretic argument, and the authors themselves say more principled estimators are future work. 21 00:04:50,575 --> 00:04:56,200 [Hal Turing] Then there's a second bet. The big model has to cope with a prompt full of holes. 22 00:04:56,200 --> 00:05:14,950 [Dr. Ada Shannon] Yes, and that's where the keep rate comes in. It's the fraction of prompt tokens, chosen in chunks, that reach the big model. A 10% keep rate means 90% of the prompt is dropped before the big model sees it. The paper fixes it per task, and whether a model copes without retraining depends heavily on the task. 23 00:05:14,950 --> 00:05:22,625 [Hal Turing] So the one-sentence bet is that the small model's view transfers, and the big model tolerates the gappy prompt. 24 00:05:22,625 --> 00:05:36,325 [Dr. Ada Shannon] Exactly. And the 7.66x and 7x come from different experiments, one a TTFT measurement and one an end-to-end serving test. The best corner of the grid is not the typical case. 25 00:05:36,325 --> 00:05:53,150 [Dr. Ada Shannon] Start with what the speculator does. It prefills the whole prompt, then decodes eight extra steps and stores the query vector from each step, including the last prompt token. Those queries are scored against the prompt's keys, which gives a map of how much each prompt token is attended to. 26 00:05:53,150 --> 00:05:57,800 [Hal Turing] Why eight extra steps? Isn't the last token's attention enough? 27 00:05:57,800 --> 00:06:18,100 [Dr. Ada Shannon] Last-token attention alone is biased. The first few tokens soak up weight because of the attention-sink effect, and tokens near the end get extra weight just for being close to the output. Averaging over several decoded steps dilutes both biases. The paper says this helps most on shorter prompts, and that going past sixteen steps gives minimal gain. 28 00:06:18,100 --> 00:06:20,950 [Hal Turing] And then there's the aggregation. 29 00:06:20,950 --> 00:06:42,300 [Dr. Ada Shannon] Take the max over heads and layers, so a token that any head cares about stands out. Then take the mean over the look-ahead steps. Next comes a one-dimensional average pooling to smooth the scores, then an average within contiguous chunks, and the top chunks are kept up to the keep rate. Chunking exists because neighboring tokens tend to share importance. Picking single tokens would be noisy and would shred sentences. 30 00:06:42,300 --> 00:06:50,800 [Hal Turing] Once you've dropped ninety percent of the prompt, the big model sees a gappy text. Does it just read it as if it were continuous? 31 00:06:50,800 --> 00:07:12,900 [Dr. Ada Shannon] No, and that's the position-ID step. Say you have ten tokens and keep positions zero, one, three, six and seven. The base model gets those original indices, so the gaps stay in its positional encoding. The first decoded token is then set to position ten, the original length, not five. The authors call this essential for retrieval and counting tasks. If you renumber to zero through four, the model loses where things were. 32 00:07:12,900 --> 00:07:14,650 [Hal Turing] What's the setup? 33 00:07:14,650 --> 00:07:43,476 [Dr. Ada Shannon] A vLLM monkey-patch, tensor parallelism of eight for both models. The speculator is Llama-3.1-8B in BF16. The base is Llama-3.1-70B in BF16 or the 405B in FP8. Without look-ahead the speculator needs no KV cache. The implementation is sequential, so the speculator runs, then the big model runs. Overlapping them is future work. It also pairs with speculative decoding, since the same small model can draft output tokens. 34 00:07:43,476 --> 00:07:46,976 [Hal Turing] Which variants and baselines are in play? 35 00:07:46,976 --> 00:08:07,076 [Dr. Ada Shannon] Three variants: raw attention, Full with all the tricks but no look-ahead, and Full with eight-step look-ahead. The baselines are the plain model, sentence-level RAG, LLMLingua and MInference. One caveat on the first two. RAG and LLMLingua were given the question separated from the context, which SpecPrefill doesn't need. So that comparison favors them. 36 00:08:07,076 --> 00:08:10,851 [Hal Turing] Now the speed. How close does it get to the headline? 37 00:08:10,851 --> 00:08:40,877 [Dr. Ada Shannon] The speedup tracks how many tokens you drop, and it grows with base-model size and sequence length. On the 405B at ten percent keep, it ranges from about 6.7x on 128 prompts of 4k tokens to 7.66x on 16 prompts of 32k. Read that as a wait: roughly 7.7 seconds down to one. For the 70B at ten percent it's about 3.4x to 3.7x. At seventy percent keep, the 405B gets only about 1.3x to 1.4x. 38 00:08:40,877 --> 00:08:43,877 [Hal Turing] Why does the bigger model gain more? 39 00:08:43,877 --> 00:08:57,877 [Dr. Ada Shannon] The speculator is a fixed cost. The 8B's work is a small fraction of the 405B's, so it eats little of the savings. For the 70B the 8B is a larger share, so more of the gain gets eaten. 40 00:08:57,877 --> 00:09:01,752 [Hal Turing] And the 7x QPS is the same number? 41 00:09:01,752 --> 00:09:24,827 [Dr. Ada Shannon] No. It's an end-to-end test: a vLLM server, a client sending requests at a constant rate, LongBench queries, and a fixed timeout. Latency shows three stages. First flat, because requests finish before the next arrives. Then rising linearly. Then a timeout stage, where prefill can't keep up and everything jams. Cutting TTFT pushes that third stage later. The 7x is the 405B on Multi-Doc QA at ten percent keep. 42 00:09:24,827 --> 00:09:28,552 [Hal Turing] Fine on speed. What does it cost in quality? 43 00:09:28,552 --> 00:09:50,902 [Dr. Ada Shannon] Take the 70B at ten percent keep. Across LongBench's six categories the average goes from 53.6 to 52.7, under a point. QA and few-shot barely move. Summarization is the exception: about 26 down to about 22, and back to 25.1 at half the prompt. Those figures are for the 70B. The paper says the gap shrinks for bigger models, but the 405B curves are only in plots. 44 00:09:50,902 --> 00:09:53,527 [Hal Turing] The code result looks odd. 45 00:09:53,527 --> 00:10:15,927 [Dr. Ada Shannon] Code completion on the 70B goes up, from 52.3 to 63.3. One plausible reading is that dropping noisy tokens helps, but that's an interpretation, not something I can point to a test for. The paper sorts queries into three types: information-dense, which get worse, compressible, which stay level, and noisy, which improve. But the sorting happens after the results are in. It describes what happened. It doesn't predict which type a new query is. 46 00:10:15,927 --> 00:10:21,652 [Hal Turing] Is that the same on short prompts, the MMLU and GSM8K kind? 47 00:10:21,652 --> 00:10:38,702 [Dr. Ada Shannon] Those are on the 70B only, in an appendix figure. Short prompts without few-shot examples are information-dense, so low keep rates hurt. MBPP and GPQA improve at some rates. The text gives the pattern, not per-task numbers, so I'll leave it there. 48 00:10:38,702 --> 00:10:51,027 [Hal Turing] Let's pressure-test the headline. 7.66x on time to first token, 7x on queries per second. Which conditions produce those, and what quality do you get there? 49 00:10:51,027 --> 00:11:25,877 [Dr. Ada Shannon] The speed headline is the best corner of the grid: 405B in FP8, ten percent keep, sixteen prompts of 32k tokens. The quality is not measured at that exact point. The 405B quality curves exist only as plots, with no speed paired to each point. The 70B table is the one with clean numbers, and there summarization at ten percent keep falls about sixteen percent relative to baseline. The text says over 95 percent accuracy and the Figure 1 caption says under 5 percent loss. Those are phrased differently, and neither comes with variance, seeds or confidence intervals. 50 00:11:25,877 --> 00:11:31,852 [Hal Turing] So the 7x QPS is tied to a task that tolerates heavy compression. 51 00:11:31,852 --> 00:11:45,727 [Dr. Ada Shannon] Yes, Multi-Doc QA. Few-shot and summarization were run at thirty and fifty percent keep, which buys much smaller gains. And no 405B result is reported on the counting tasks, so I won't guess. 52 00:11:45,727 --> 00:11:49,452 [Hal Turing] Those counting tasks are where RULER comes in. 53 00:11:49,452 --> 00:12:15,577 [Dr. Ada Shannon] Right. On the 70B at ten percent keep, retrieval, variable tracking and QA mostly hold. But the aggregation tasks, finding the most common words, break. At 16K context the baseline scores 97.8 out of 100 and the compressed run 78.5. That's about nineteen points lost on one task family. Every word contributes to the answer, so no importance score can say which ones are safe to drop. The paper itself says aggregation isn't the main target. 54 00:12:15,577 --> 00:12:19,377 [Hal Turing] And the average they quote excludes that task. 55 00:12:19,377 --> 00:12:46,902 [Dr. Ada Shannon] The row is labeled as such, so it isn't hidden. But quote it with that caveat. The one length where compression scores higher on aggregation is 128K, and with no variance reported I wouldn't read anything into it. Against MInference, the sparse-attention method, SpecPrefill is 2.5x to 6.5x faster on large batches of short-to-medium prompts. As sequences reach 64K and 128K with small batches, MInference catches up. 56 00:12:46,902 --> 00:12:54,602 [Hal Turing] Now the part that bothers me. The keep rates differ by task: ten, thirty, fifty. Who picks them in production? 57 00:12:54,602 --> 00:13:15,327 [Dr. Ada Shannon] Nobody knows yet. The rates were fixed per task after the authors saw results. A server has no labels at request time, and the paper concedes adaptive selection is future work. The dense, compressible and noisy categories were also assigned after the fact. That makes the reported gains an oracle-tuned upper bound, not a deployable policy. 58 00:13:15,327 --> 00:13:18,127 [Hal Turing] Is there anything cheap to try? 59 00:13:18,127 --> 00:13:35,452 [Dr. Ada Shannon] These are my suggestions, not paper results. One is a per-request signal, like how concentrated the speculator's attention scores are. Spread-out attention would suggest keeping more. Another is a conservative global rate with a quality-gated fallback to full prefill. 60 00:13:35,452 --> 00:13:41,177 [Hal Turing] What about the QPS number itself? You said it comes from a latency argument. 61 00:13:41,177 --> 00:14:14,127 [Dr. Ada Shannon] The claim is that maximum QPS scales as one over TTFT, and the footnote calls that an approximation with a long-timeout caveat. The end-to-end run uses a constant-rate client on LongBench samples with one timeout per task, a single run and no confidence intervals. The speculator is also sequential in this implementation, so its own queue and memory under load aren't accounted for. Even the speedup isn't ideal: at 70B with look-ahead it's roughly 2.6x to 3x at ten percent keep, against a tenfold cut in prompt tokens. 62 00:14:14,127 --> 00:14:17,002 [Hal Turing] What else does the paper leave open? 63 00:14:17,002 --> 00:14:44,852 [Dr. Ada Shannon] Several things. The method gives no per-token logits, so it only suits generative tasks. Multi-turn conversations aren't solved: dropped tokens never get KV entries, so a follow-up about a different part of the document would need recomputation. LazyLLM-style revival is a direct alternative there. The attention score is a crude importance measure, and the authors ask for more principled estimators, which is where an actual information-theoretic criterion could enter. And the speculator has to come from a compatible model family. 64 00:14:44,852 --> 00:14:48,027 [Hal Turing] How does it fit with the other approaches? 65 00:14:48,027 --> 00:15:08,027 [Dr. Ada Shannon] It's complementary to SwiftKV, MInference and speculative decoding. The contrast with LazyLLM, SnapKV and GemFilter is cost structure: they use the base model's own attention, while this one pays for a small model instead. Quest and RetrievalAttention-style methods select at decode time and don't cut prefill at all. 66 00:15:08,027 --> 00:15:10,177 [Hal Turing] So who should use this? 67 00:15:10,177 --> 00:15:31,327 [Dr. Ada Shannon] High-concurrency serving of short-to-medium prompts, a much larger base model, and redundant or noisy context like QA, few-shot or retrieval-style prompts. Avoid exact-match, counting, aggregation, and dense short prompts. The paper tested no safety-sensitive or exact-match-heavy workloads, so test your own task's knee before trusting any keep rate. 68 00:15:31,327 --> 00:15:53,002 [Hal Turing] Here's where I land. A small same-family model's attention can pick tokens that a much bigger model answers well from, and the TTFT gains are large when the base model dwarfs the speculator. The boundary is that the best numbers need a per-task keep rate nobody yet knows how to choose in production. Thanks for listening, everyone.