TL;DR
When processing massive prompts, large language models (LLMs) often have to throw away parts of their memory before generating a response—like deciding which pages of a textbook to tear out before knowing what your essay will say. Instead of slowly drafting a rough response just to figure out which pages matter, Faster and Better Query (FBQ) takes the very first word the model decides to write, adds learned mathematical nudges to project it into the future, and figures out what memory to keep in a single, parallel forward pass. It matches the quality of multi-step lookahead methods without the sequential bottleneck.
What Problem Does This Paper Address?
When an LLM reads a long document (the "prefill" stage), it builds a Key-Value (KV) cache—essentially its working memory of every token in the prompt. For long contexts, keeping this entire cache eats up too much GPU memory, so we evict less important tokens.
The catch? You have to decide what to evict before the model starts generating its answer. Imagine reading a 100-page corporate report. Whether someone asks "Who approved the budget?" or "What are the main findings?", the model might start both answers with the word "The". How do you know which memories to keep before the sentence unfolds?
Existing "lookahead" methods (like Lookahead Q-Cache, or LAQ) solve this by generating a quick draft continuation of several tokens to see what parts of the prompt the model pays attention to. That works well, because future tokens have real context—but generating tokens one by one is slow and sequential. Can we predict future attention without waiting around to generate a draft?
Methods
The authors start with a surprisingly simple baseline called FTQ-8. When prefill finishes, you already get the very first output token $g$ for free from the final logits. FTQ-8 simply copies that token's embedding $E(g)$ eight times into future positions ($L$ through $L+7$) and runs a single causal forward pass. Because of positional encodings and causal masking, each copy sees a slightly longer prefix, producing eight distinct attention queries at once.
However, repeating "The" eight times in a row is a poor literal stand-in for real grammar. Faster and Better Query (FBQ) keeps the genuine first token untouched at position $L$, and adds seven learned vector offsets ($\delta_1 \dots \delta_7$) to the remaining positions:
Here is how the pieces fit together:
- Offline Offset Training: Using a frozen LLM, the seven shared $\delta$ vectors are trained offline so their pooled prompt attention mimics the average prompt attention of a 32-step full-cache teacher continuation.
- Calibrated Scoring: Once the offsets are frozen, a lightweight 6-feature linear scorer combines the average attention across all eight probes, the exact attention of the unchanged first query, and normalized prompt positions.
- Clean Handoff: The model keeps the top-$B$ prompt KV pairs per head, throws away the temporary probe branch, and resumes normal decoding from the committed first token $g$.
Datasets
- Evaluation: The 16-task English and code subset of LongBench (3,750 examples), spanning single- and multi-document QA, summarization, few-shot learning, synthetic tasks, and code completion. A diagnostic query analysis also examines a GovReport example.
- Training: Specific offline training datasets used to fit the seven offset vectors and linear scorer are not explicitly named in the paper.
Key Insights and Ideas
- Identical inputs don't mean identical queries: Even if two different questions both start with "The", their FBQ input blocks are identical, yet they attend to completely different parts of the document because each probe still interacts with that specific prompt's KV cache.
- Shorter, smarter probes beat longer repetitions: In pilot runs, repeating the first token 32 times actually performed worse than repeating it 8 times (34.69 vs. 35.06). Adding learned offsets to 8 positions worked better than brute-force lengthening.
- You don't need perfect scores to get the exact same cache: Why can a single-pass approximation match an 8-step sequential draft? Decoding doesn't see continuous attention scores; it only sees which top-$B$ tokens survived eviction. As long as estimation errors are smaller than half the score gap at the budget boundary ($B$ vs. $B+1$), two different estimators retain the exact same cache and produce identical deterministic answers.
Key Results
Evaluated on Mistral-7B v0.3 with a strict cache budget of $B = 128$ prompt positions per head across 16 LongBench tasks:
- Matching sequential lookahead in one pass: FBQ achieves an average score of 45.73 (at epochs 3 and 4), edging out two-step LAQ-2 (44.88) and performing on par with eight-step sequential LAQ-8 (45.66), while narrowing the gap toward the uncompressed FullKV ceiling (48.07).
- Closer query geometry: On a single-prompt diagnostic with Qwen2.5-7B-Instruct, adding learned residual offsets reduced the relative Euclidean distance to true full-cache queries by 5.2% compared to literal token repetition (0.565 vs. 0.596).
Limitations and Future Work
The authors are admirably transparent about what remains open:
- Scope of evaluation: The main LongBench comparison tests one model family (Mistral-7B v0.3) and one cache budget (128). Furthermore, a matched zero-offset (FTQ-8) run under the exact main evaluation protocol—and stratified by generic opening words like "the" or "this"—is still needed to cleanly isolate the gain from learned offsets.
- Statistical and task variance: While the overall mean slightly edges out LAQ-8 by 0.07 points, no paired uncertainty interval is reported, and wins vary by task (scoring higher on 9 tasks and lower on 6–7).
- System benchmarking: Preliminary tests favor FBQ over LAQ in peak memory, time-to-first-token, and time-per-output-token, but rigorous wall-clock claims will require apples-to-apples hardware and server implementation benchmarks.
Summary updated