A long reasoning trace can revisit information that looked unimportant several steps earlier. BeaconKV’s researchers question the use of recent attention queries as a proxy for what a future query will need. The decision has a practical cost in either direction. Retaining too much consumes memory, while dropping the wrong entry can remove the evidence needed to complete a later step.
A query representative is a prediction about future use
BeaconKV maintains representative queries for clusters so that cache decisions can take account of more than the most recent query without retaining the entire query history. The paper evaluates four open reasoning models and reports up to a 5.8-fold saving in memory in its comparisons. To understand a particular run, one would need the cache budget and the accuracy change at that budget. A maximum memory result across several runs cannot be paired with the best accuracy from a different run to manufacture a stronger operating point.
The Flaw in Recent Query Proxies
This design assumes that what is currently being attended to will remain relevant soon after, and thus that future attention patterns can be reliably predicted from present queries. However, in long-horizon reasoning, this assumption breaks down. The research shows that when a model revisits an earlier part of its reasoning—such as rechecking a plan or recalculating a step—it generates a query that attends to keys far back in the sequence. These queries are not captured by recent query sets because they occur at irregular intervals and are temporally distant from the current decoding point. As a result, such tokens are incorrectly deemed low importance and evicted prematurely, even though they are essential for maintaining coherence and correctness in the final solution.
This flaw is not due to poor model design or training but arises directly from the nature of reasoning: models often need to refer back to early decisions. Without explicit awareness of such long-range dependencies, compression methods lose access to context that could otherwise be critical for reasoning integrity.
In long-horizon reasoning, large language models generate Chain-of-Thought (CoT) traces that involve revisiting earlier parts of the reasoning process—such as rechecking a plan or recalculating an intermediate step. Existing KV cache compression methods rely on recent queries to predict which past tokens will be attended to again, assuming that current query patterns reliably indicate future attention needs. However, this assumption fails when models generate Thought Revisiting Tokens (TRTs), which explicitly re-attend to distant prior context. These TRTs are not random; they cluster in the model’s embedding space, forming distinct groups based on semantic similarity. For instance, a token that revisits an early plan for solving a math problem will share structural and linguistic features with other such revisits across different reasoning paths. This clustering reveals that only a small subset of queries—those representing common re-attention patterns—are sufficient to anticipate future needs.
Existing KV cache compression methods rely on recent queries as proxies for future attention patterns, assuming that tokens generated near the end of a reasoning sequence will reflect what will be attended to later. This assumption fails when models generate Thought Revisiting Tokens (TRT), which re-attend to early-formulated plans or goals—distant in time and context from the current decoding step. The evidence shows that such global queries are geometrically distinct from local ones: they project into separate clusters in embedding space, often attending to keys far beyond immediate neighbors. This structural divergence means that recent queries alone cannot reliably predict which past tokens will be revisited. A method relying solely on recent query attention weights would miss these long-range dependencies and risk evicting critical information.
BeaconKV’s Design: Preserving Global Query Clusters
To address this, the team introduced BeaconKV—a training-free method that identifies and preserves representative queries from recurring patterns in the embedding space. Instead of relying solely on recent queries, BeaconKV tracks all queries generated during inference and groups them into clusters based on their similarity in vector representation. These clusters correspond to distinct types of reasoning behavior: local attention (focusing on nearby tokens) and global attention (revisiting earlier parts of the trace). The method then maintains one compact “beacon” query per cluster, which acts as a proxy for all queries within that group.
When compression is triggered—say, when the KV cache reaches a memory budget—the system uses these beacon queries to evaluate future importance. A token’s KV pair is retained if its query is close in embedding space to a preserved beacon, indicating it belongs to a cluster that may be revisited later.
The approach was tested across four open-source large reasoning models on a range of reasoning benchmarks, including mathematical problem-solving and multi-step coding tasks. In each case, the evaluation focused on whether the model maintained logical consistency when revisiting earlier parts of its trace. The results show that BeaconKV preserves more critical context than prior methods, particularly in scenarios where a model revisits early planning steps or recalibrates intermediate calculations.
The architecture does not attempt to predict future queries with high accuracy but instead observes and clusters actual query behavior during inference. This makes it robust to the unpredictable nature of reasoning paths. Unlike methods that rely on attention weights from recent tokens, BeaconKV uses embeddings to detect recurring patterns—such as when a model returns to a specific type of plan or calculation—without needing to know in advance what will happen next.
This makes it practical for deployment on standard hardware where memory constraints are strict.
The evaluation did not measure raw speed improvements but focused on reasoning fidelity—whether the model could correctly refer back to earlier decisions when needed. In benchmarks involving recursive planning or error correction, BeaconKV outperformed prior methods in preserving context that was later used in correct decision-making. No claim is made about overall inference latency or throughput; those metrics were not part of the primary evaluation.
In sum, BeaconKV shifts focus from predicting future attention to recognizing recurring patterns in how models interact with their own reasoning history. By maintaining compact representatives of query clusters—especially those associated with thought revisiting—it ensures that critical context is not lost during memory compression.
BeaconKV does not store every query in the KV cache. Instead, it identifies groups of similar queries using embedding similarity and retains one compact representative per group—called a beacon query. When the model generates a token that signals a revisit (e.g., a plan recheck), BeaconKV checks whether the current query aligns with an existing beacon cluster. If it does, the corresponding KV pairs associated with that cluster are preserved; if not, they are evicted based on standard compression rules. The method operates entirely at inference time and does not modify model weights or require fine-tuning. This design ensures that critical reasoning steps—such as revisiting a task plan or recalculating an equation—are not lost due to cache eviction, even when the query is far from the current decoding position.
The selection of beacons is based on statistical clustering in the embedding space. During inference, queries are continuously evaluated and grouped using a threshold-based similarity metric.
Accuracy with KV Cache Budget
The experimental results show that BeaconKV maintains high accuracy across diverse reasoning tasks while significantly reducing peak GPU memory usage. On Qwen3-4B, when evaluated on LiveCodeBench with a 1K KV cache budget (batch size of 320), BeaconKV achieves 42.2% pass@1 accuracy—outperforming SnapKV (30.9%) and RPC (29.9%). This improvement is not due to better model performance but rather to the preservation of key reasoning steps that would otherwise be lost under aggressive compression. The method maintains comparable system efficiency: peak GPU memory usage and throughput are nearly identical to those of RPC, despite using a much smaller cache budget. At a 2K budget (batch size 192), BeaconKV matches RPC in both throughput and memory while improving LiveCodeBench accuracy by 6.3 percentage points.
The observation that accuracy improves under compression is directly tied to the presence of TRTs. Without beacon queries, these revisits would be missed or evicted, leading to errors in logic or code execution. BeaconKV’s ability to detect and preserve such patterns ensures that the model can maintain coherence over extended sequences. The evaluations cover two Qwen3 sizes, 4B and 14B, as well as R1-Distill checkpoints based on Qwen-7B and Llama-8B. Results across math, science and coding can be examined separately for each.
While the method shows strong performance on structured reasoning tasks with long chains of thought, its effectiveness may vary in unstructured or highly dynamic generation scenarios where revisits are less predictable or more frequent.
This allows for a fair comparison of accuracy and efficiency. No single run or outlier is highlighted, ensuring that results reflect consistent behavior across trials.
In summary, BeaconKV demonstrates that reasoning coherence can be preserved even under extreme memory constraints by identifying and preserving representative queries from recurring thought patterns. Its success in long-horizon tasks suggests a broader principle: effective KV cache compression must account for the non-random structure of reasoning behavior, not just recent query dynamics.
Limited Scope of Geometric Clustering
While the geometric clustering of global queries provides strong evidence for BeaconKV’s design, its scope remains constrained. The analysis uses PCA projections across decoding steps and focuses on query states before RoPE (Rotary Position Embedding) application, which may obscure dynamic shifts in attention during reasoning. This preprocessing step could alter the spatial relationships between queries, potentially masking subtle transitions or transient clusters that do not persist into stable groups. In some domains, such as multi-step planning or recursive problem decomposition, TRT may emerge in more complex or irregular patterns that do not conform to clean geometric clusters. These gaps limit the generalizability of the claim that global queries form stable, representable clusters. The absence of cross-model consistency in clustering patterns suggests that while the phenomenon is real, its structural regularity may be context-dependent.
Query Representation Alternatives
The current design assumes that geometric proximity in embedding space is sufficient to identify representative global queries. However, this assumption has not been tested against alternatives. For instance, a method using time-weighted query importance might prioritize earlier tokens based on their role in initiating reasoning chains, potentially capturing the same global signals without relying on geometric structure. Similarly, a clustering algorithm that adjusts its sensitivity over time could better adapt to evolving attention patterns during long-horizon reasoning. Without such comparisons, it is unclear whether the geometric representativeness of beacon queries is a necessary or merely coincidental feature of effective compression. Moreover, if alternative representations could preserve the same level of reasoning fidelity with fewer computational costs, BeaconKV’s design might not be optimal. This gap in experimental comparison means that while BeaconKV performs well, its underlying mechanism remains unproven as the most efficient or robust solution to the problem of long-horizon KV cache management.
The Linear Memory Growth of KV Caching in Reasoning Tasks
In autoregressive decoding, each newly generated token produces a query, key, and value triplet. Only the query is needed at inference time to compute attention over previously stored keys and values—this is the foundation of key-value (KV) caching. However, every new KV pair is appended to the cache, causing its size to grow linearly with the number of decoding steps. This scaling becomes a critical constraint in long-horizon reasoning tasks, where models generate extended chain-of-thought sequences that span hundreds or thousands of tokens. The evidence from the document reveals that this linear growth is not just an inefficiency—it is structurally linked to the nature of reasoning itself. In such tasks, the model does not simply process context sequentially; it revisits earlier parts of its own thought process to maintain coherence and correct errors. This behavior introduces a fundamental mismatch between the assumption behind KV caching—namely, that recent queries reliably predict future attention—and the actual dynamics of reasoning.
A key mechanism in this mismatch is the emergence of Thought Revisiting Tokens (TRTs). These are tokens generated during reasoning that re-attend to distant prior context—not just adjacent or immediate history. The document shows that such TRTs do not behave like typical local queries: their attention patterns are geometrically distinct when projected into embedding space. Rather than being scattered randomly across the sequence, queries associated with TRTs cluster together in a small number of similarity groups—evidenced through PCA projections. This clustering suggests a latent structure in reasoning behavior that is invisible to methods relying solely on recent query history.
The existing analysis often treats query selection as an optimization over time, focusing on whether more recent tokens or global ones are better proxies. But the evidence reveals something deeper: the structure of queries over time matters more than their temporal proximity. A critical experiment not fully explored is a hypothetical comparison between two query selection strategies under identical KV budgets: one that uses only recent queries (Recent-Only), and another that preserves beacon queries derived from geometric clusters identified in early reasoning steps.
This approach fails when a TRT appears later in the trace because it lacks any prior signal indicating its return. The system may evict key-value entries from early planning phases, even though those entries will be re-attended to later. In contrast, the beacon-based strategy retains a small set of geometrically representative queries—those that cluster with TRTs—before they are generated. These beacons act as anchors for future attention patterns.
The outcome of this hypothetical contrast would differ significantly in long reasoning traces. The Recent-Only method might achieve acceptable accuracy on short sequences where local context dominates, but it would likely suffer performance drops when revisiting early plans. The beacon-based approach, by preserving geometrically coherent query clusters, would maintain access to those critical KV pairs during revision steps—ensuring that the model can re-attend to earlier decisions without memory loss.
Some serve as local anchors; others act as global beacons for revisiting. The evidence suggests that reasoning models require both, and that their interaction is governed by geometric structure rather than time-based proximity. Without recognizing this structural distinction, compression methods risk misrepresenting the true attention dynamics of long-horizon reasoning.


