New FBQ Method Optimizes LLM Cache Selection
Researchers have introduced Faster and Better Query (FBQ) to improve how large language models manage prompt memory. Learn how it predicts future needs.
Source: Grafy Research LabResearchers have developed a new method called Faster and Better Query (FBQ) that improves how large language models (LLMs) manage their memory during long conversations. By predicting which parts of a prompt will be most important for future tokens, the method allows models to maintain high performance even when they are forced to discard large amounts of data to save space.
How does LLM cache eviction work?
When an LLM processes a long prompt, it stores information in a Key-Value (KV) cache to avoid recomputing everything for every new word generated. However, as the conversation grows, this cache can become too large for a system's memory. To manage this, models use "eviction" rules to decide which parts of the prompt's history to keep and which to discard.
According to the research paper by Jiankun Zou, Daixing Chen, and Tongtong Yuan, the challenge is that the model must make these eviction decisions at the end of the initial prompt processing (prefill) before it has actually seen the queries generated during the subsequent decoding steps. If the model discards a piece of information that it later needs to answer a specific question, its performance will drop.
What is the FBQ approach?
Existing methods, such as Lookahead Q-Cache (LAQ), attempt to solve this by generating "draft" continuations—essentially guessing the next few words to see what the model might ask for. While effective, this requires extra computational steps.
FBQ proposes a more efficient alternative. Instead of generating full words, it uses the embedding of the very first token the model decides to output. The researchers suggest that this first token contains a valuable signal about the model's intent. The FBQ method takes the embedding of this first token, , and applies seven learned additive offsets, , to create "pseudo queries" for the next seven positions.
Mathematically, the input block for these probes is constructed as:
This allows the model to probe the prompt's importance in a single forward pass without the sequential overhead of generating a full draft of text. These offsets are learned offline by comparing the probe's attention to the attention patterns of a "teacher" model that has access to the full, uncompressed cache.
How effective is FBQ in practice?
To test the method, the authors evaluated it on the LongBench benchmark, which includes tasks like multi-document question answering, summarization, and code completion. They compared FBQ against the LAQ method using a Mistral-7B v0.3 model with a strict cache budget of 128 positions per head.
According to the experimental results, FBQ performs comparably to the eight-step Lookahead Q-Cache. While LAQ requires multiple sequential steps to look ahead, FBQ achieves similar results using a single forward pass to compute all probe queries. This efficiency makes it a promising candidate for reducing the latency and computational costs associated with maintaining long-context windows in production environments.
Why does the first token matter so much?
The core intuition behind FBQ is that the first generated token is not a random guess; it is a decision made by the model after processing the entire prompt. Even if the model starts multiple different answers with the same word, the way that word's embedding interacts with the prompt's attention mechanism provides a baseline for what information is relevant.
By adding learned offsets to that initial embedding, FBQ can simulate how the queries might shift as the sentence develops. This allows the system to identify and preserve the most critical "evidence" in the prompt cache, ensuring that the most important facts remain available for the model as it continues to generate long-form content.
How can researchers apply these concepts?
For researchers working with complex, long-form documents, understanding how models manage context is vital. If you are analyzing academic papers or lengthy technical reports, you can explore how different models handle large amounts of information by using Reader. While FBQ is an architectural optimization for model inference, using tools like Grafy Chat allows you to test how various models respond to the same long-context prompts, providing a practical sense of how context management affects accuracy and reasoning.
Frequently asked questions
What is the main goal of the FBQ method?
The main goal of FBQ is to improve the efficiency of LLM inference by optimizing how the KV cache is managed. It aims to predict which parts of a prompt are most important for future tokens, allowing the model to discard unnecessary data without losing the ability to answer complex questions accurately.
How does FBQ differ from Lookahead Q-Cache?
FBQ differs from Lookahead Q-Cache primarily in its computational cost. While Lookahead Q-Cache generates actual draft tokens to estimate future queries—which requires multiple sequential steps—FBQ uses learned offsets applied to the first token's embedding. This allows FBQ to estimate future query needs in a single forward pass.
Does FBQ require extra training during inference?
No, FBQ does not require additional training during the inference phase. The additive offsets used to create the pseudo queries are learned offline using a teacher model. Once these offsets are trained and frozen, they are applied during inference to help select the most important prompt positions for the cache.


