Inference systems · Research feature

Gossamer: A Utility-Driven Architecture for Constant-Budget KV Cache Compression in Reasoning LLMs

A new architecture dynamically manages key-value cache memory in reasoning large language models, improving throughput without sacrificing performance.

Adapted from research by Feng Cheng, Cong Guo, Junyao Zhang and colleagues.

arXiv preprint revision · 2026-11-22 · Attribution & reuse
In this article
Editorial illustration of linked workflow.

Editor’s introduction

The study evaluates Gossamer, a utility-driven KV cache compression architecture, against established methods like Ecco, Oaken, and R-KV in reasoning LLMs. Gossamer dynamically selects compression operations—quantization, merging, or eviction—during inference, leveraging idle compute cycles to perform cosine-similarity estimation without latency. This real-time management maintains reasoning quality while reducing memory footprint. The study compares results across fixed compression schedules and different cache compression levels, with FullKV serving as a quality benchmark.

Introduction

Transformer-based large language models (LLMs) have emerged as powerful reasoning engines, enabling complex decision-making, planning, and multi-step generation across diverse domains. As model size and reasoning context length increase, the computational and memory requirements of inference grow rapidly, posing serious challenges for deploying reasoning LLMs efficiently under limited hardware resources. Modern reasoning LLMs employ a key-value (KV) cache to accelerate autoregressive decoding. The KV cache stores attention key and value tensors from previous steps, allowing the model to reuse them for subsequent token generation instead of recomputing all past activations. While this mechanism is essential for long-form reasoning, its linearly growing size creates a substantial memory footprint and introduces severe memory bandwidth bottlenecks.

From the memory perspective, the KV cache expansion directly increases storage demand and bandwidth pressure. The size of the KV cache grows linearly with the reasoning context and model dimension, quickly becoming the dominant contributor to runtime memory consumption. For short contexts (e.g., 512 tokens), the KV cache accounts for less than 2% of total memory usage, but at long contexts (e.g., 128K tokens), it can occupy over 84% of available capacity. This growth stresses on-device memory and amplifies memory traffic, as cached data must be repeatedly accessed during each decoding step. When the KV cache exceeds available capacity, systems often resort to offloading strategies that migrate cache data across the memory hierarchy or to external storage, introducing additional data movement and latency.

From the computation perspective, a larger KV cache directly increases the arithmetic cost of attention, since each decoding step must process more KV entries. At the same time, limited memory reduces batching opportunities, leading to low compute utilization and degraded throughput. This tight computation and memory coupling fundamentally limits inference efficiency for reasoning workloads. Consequently, there is a critical need for architectural techniques that reduce the KV cache footprint while maintaining reasoning quality.

A natural response to the growth of the KV cache is compression. Existing works explore several directions, including quantization, pruning, and eviction-based methods. These broadly fall into two categories. The first category is local in-place compression. These methods compress the KV cache by a fixed ratio, such as quantizing from FP16 to 4-bit or pruning a constant fraction of tokens. Such techniques delay memory exhaustion but do not fundamentally solve the problem, as the KV cache still grows linearly with context length. For efficient inference, they rely only on local information and make per-token decisions without global context awareness.

The second category leverages global information from previous reasoning history to guide compression. In reasoning LLMs, many cached tokens are redundant across multi-turn reasoning steps. Recent global-aware methods compare new KV entries with the existing KV cache to decide whether to retain or evict them, effectively bounding the KV cache within a constant budget, such as 512 entries. However, these methods emphasize algorithmic effectiveness and often overlook architectural efficiency.

Global-aware compression requires computing similarities such as cosine distance across the entire cache, which is computationally expensive. Our measurements show that a single global compression step on a 512-entry cache can take up to twelve times the latency of one attention computation. To amortize this cost, these methods commonly introduce a secondary buffer and accumulate new tokens, for example, 128 at a time, before performing global updates. While this improves amortized efficiency, it sacrifices responsiveness and does not align with real-time inference pipelines, leading to suboptimal accuracy. As a result, current KV cache compression methods remain algorithmically driven but architecturally inefficient, leaving a clear gap between compression utility and hardware efficiency.

In this study, we propose Gossamer, a utility-driven KV cache architecture for reasoning LLMs that bridges the gap among algorithm, system, and hardware design. The utility formulation builds on comprehensive cross-domain observations, integrating insights from all three domains in a mutually reinforcing way.

On the algorithmic side, Gossamer’s utility-based action framework unifies advanced KV cache compression techniques, including quantization, eviction, and merging. All these actions depend on cosine similarity between new and historical KV entries to identify redundancy and decide token-level operations. Ideally, each new token would perform such checks for optimal compression, but comparing against all cached entries is computationally expensive, forcing existing systems to group tokens and delay updates.

We call this integration Free-Lunch Utilization. By exploiting idle compute cycles within the attention pipeline, Gossamer performs similarity computation “for free,” maintaining global context visibility while hiding its cost. The resulting architecture supports dynamic utility-based actions such as quantization and eviction in place, with minimal overhead, and near-constant memory usage. Through this cross-domain co-design, Gossamer achieves global reasoning awareness with the efficiency of local in-place execution, improving utilization across algorithm, system, and architecture levels.

KV Cache Compression

Each family faces inherent trade-offs. Eviction reduces sequence length but risks dropping long-range dependencies and often requires carefully tuned, context-dependent policies. Quantization preserves length but can introduce accuracy loss from outliers and scale mismatch across layers and heads. Merging improves bandwidth by shortening the cache but may blur token-specific information and accumulate bias over depth. Because we must simultaneously address both axes, bytes per token (capacity) and tokens per step (bandwidth), and because sensitivity varies by layer, head, and input regime, relying on a single technique rarely yields strong compression at fixed quality.

Gossamer: Compression Methodology

Our KV cache management system is a multi-stage, utility-driven framework designed to maximize memory efficiency while preserving model performance. The framework first identifies a core set of high-value tokens for full-precision retention using the token prioritization algorithm detailed in Section III-A. All other tokens are then processed by a dynamic action utility model (Section III-D) that selects an appropriate compression action under a fixed KV budget. This modular design allows us to apply compression techniques, such as the vector quantization and merging described in Section III-B and Section III-C, only to tokens that are poor candidates for full retention but are still too valuable to evict.

Candidate Selection: Scoring Foundation

Redundancy is estimated using cosine-similarity-based signals over the key vectors: for each token, we measure its similarity to the rest of the cache and aggregate these values into an average redundancy score, which is then normalized via a softmax to make scores comparable across tokens. Higher redundancy indicates greater semantic overlap with other entries.

Gossamer Overview

First, an input prepare engine normalizes new keys, updates an accumulated key register, concatenates them with the new query, and writes the result into the input buffer; this engine also dequantizes tokens and feeds them into the weight buffer. Second, a scoring and select engine receives redundancy and importance scores from the output buffer, updates the system metadata, and uses these scores to select low-priority tokens. Finally, a DAU engine consumes this metadata, performing simple calculations to decide whether to evict, merge, or quantize each low-priority token.

Hardware-Managed Metadata

Additionally, a single, full-precision register, called the accumulated key register, keeps a running vector sum of all the normalized key vectors currently in the main cache. This accumulator is what allows for the efficient redundancy calculation later. Finally, an attention history buffer, operating as a circular buffer, stores the most recent attention probability vectors, which are used to calculate the rolling average for the token importance score.

Pre-Attention Token Processing

These three vectors are then passed together into the input buffer for the fused computation. During this process, the datapath also handles dequantization, loading tokens from the quantized cache and converting them back to full precision before they are used. It is important to note that no runtime permutation overhead is required. The correlation-based reordering of vector sub-parts is applied offline by pre-permuting the columns of the main query, key, and value projection matrices. This means the query, key, and value vectors arrive from the projection layers already in their optimally permuted order, ready for direct use.

Fused Attention and Score Computation

The first output row is used for the standard attention calculation. It contains the initial query-key products. Because the keys were normalized, we recover the true attention logits by scaling them with their corresponding L2 norm values, which are stored separately. These true logits are then passed to a softmax function to produce the final attention scores. In parallel, these scores are also used to update the importance score for each token, which is maintained as a streaming average of its recent attention values.

The second output row contains the cosine similarities between the new key and all other keys already in the cache. This row is used for similarity tracking. A top-k unit processes this data to find the most similar neighbors for the new token, populating its neighbor table. Concurrently, this new similarity value is compared against the tables of all existing tokens, allowing their neighbor summaries to be kept fresh without requiring a full, costly rescan of the cache.

Finally, the importance and redundancy scores are weighted and added together to obtain a final priority score for each token. A comparator unit identifies the token with the lowest priority, which is then fed to the DAU engine for a final decision on whether to evict, merge, or quantize it.

Post-Action Maintenance

Second, the system updates the neighbor tables. Any table entries that referenced the processed token are invalidated by zeroing their scores and setting an invalid bit. Refreshing these entries immediately would be costly; instead, they are updated opportunistically in a later iteration. The attention buffer also slides forward automatically as part of this standard update.

Accuracy Evaluation

Baseline Methods. We compare Gossamer against state-of-the-art KV-cache compression methods. We adapt SnapKV to operate in both the prefill and decoding phases. We also evaluate R-KV, a leading KV compression method for reasoning models, using its recommended configuration. For all baselines, we apply a fixed compression schedule that recompresses the KV cache every 128 decoding steps. The memory budget is defined over the entire KV cache, including segments from generated tokens that are subsequently compressed. We also report FullKV, which keeps the KV cache uncompressed and serves as the gold-standard upper bound on decoding quality. The budget for SnapKV and R-KV represents the number of KV cache entries, while for Gossamer, we adopt 75% entries in full precision and 25% entries quantized. When plotting, we normalize Gossamer’s budget to its memory-equivalent logical budget, allowing for a direct comparison against the full-precision baselines under the same actual memory consumption.

On MATH-500, the accuracy curves are smoother and the absolute gaps are smaller, but the relative ordering remains consistent. For Llama-8B, Gossamer matches or slightly exceeds R-KV across all budgets while maintaining a clear advantage over SnapKV under tight memory (256–768). This suggests that Gossamer makes more efficient use of constrained KV capacity, whereas less frequent compression updates can lead to wasted budget and slower accuracy recovery. As the budget increases, all compressed methods gradually approach the FullKV limit, but Gossamer reaches this regime sooner, showing that its gains are not limited to aggressive compression alone. For Qwen-14B, the same pattern holds: Gossamer remains closest to FullKV, consistently outperforms R-KV in the low- and mid-budget range, and avoids the severe degradation exhibited by SnapKV at small budgets.

Taken together, these results show that Gossamer is not only stronger at a fixed KV budget, but also more budget-efficient: it delivers larger accuracy gains as KV capacity increases and reaches the FullKV regime at smaller budgets than prior compression methods.

Performance Evaluation

Models and Baselines. We evaluate architectural performance using DeepSeek-R1-Distill-Llama-8B, DeepSeek-R1-Distill-Qwen-14B, and QwQ-32B. We compare our Gossamer approach against four baseline methods. First, we simulate FullKV, where the entire KV cache is stored uncompressed. Second, we include Ecco and Oaken, two state-of-the-art quantization-based frameworks that compress the KV cache to near-4-bit precision with on-the-fly encoding and decoding. Third, we select R-KV as it is a representative state-of-the-art compression method for reasoning models. For our own Gossamer architecture, we incorporate two configurations: one where 50% of the KV cache is allocated to FP16 and another with 75%. All baselines (FullKV, Ecco, and R-KV) are simulated using the identical SCALEsim-v2 setup to ensure a fair and direct comparison.

Across both models and all budgets, Gossamer achieves the highest batch size among the compressed methods and substantially outperforms FullKV. The gain is largest in the low-budget regime, where memory is most constrained: the 50%-FP variant supports more than an order-of-magnitude larger batch than FullKV at a budget of 256, and consistently exceeds R-KV by roughly 20–40%. The 75%-FP variant follows the same trend, offering a slightly smaller concurrency gain in exchange for better accuracy. As the budget increases, all methods gradually converge, but Gossamer remains above R-KV and Ecco throughout, showing that its compression translates into systematically better memory efficiency rather than a benefit limited to only the most aggressive settings.

Ablation Study

Two non-obvious effects emerge. First, at a severely constrained FP allocation of 128 entries, the smallest budget (512) outperforms larger ones (768, 1024): with more total tokens but the same FP capacity, larger budgets force more tokens into aggressive quantization, distorting the contextual representation. This suggests quantization should be applied selectively rather than indiscriminately. Second, allocating nearly the entire budget to FP does not always help: under budget = 1024, accuracy slightly drops when increasing FP from 768 to 896 entries, indicating that moderate quantization can act as a regularizer by filtering contextual noise.

Long-Context Capability. Table I evaluates Gossamer on LongBench v1 and v2 under a strict KV cache budget of 1024 and 2048 tokens, respectively. On LongBench v1 (Llama-3.1-8B-Instruct), Gossamer matches or exceeds FullKV on MF-en and Qasp while remaining competitive on Musiq, consistently surpassing KIVI, Quest and Cake by a significant margin. On LongBench v2 (DS-Llama-8B), Gossamer achieves 30.4% overall accuracy across short and medium length categories, within 0.4% of FullKV and outperforming all compressed baselines. These results demonstrate that Gossamer’s hybrid compression strategy generalizes effectively beyond reasoning workloads to diverse long-context tasks.

Cross-Domain Codebook Adaptivity. Notably, all LongBench evaluations reuse the quantization codebook profiled exclusively on GSM8K — a mathematical reasoning dataset with a very different token distribution. Despite this domain shift, Gossamer maintains high accuracy across varied long-context tasks, demonstrating zero-shot codebook transferability. This eliminates the need for task-specific KV cache re-profiling and significantly simplifies deployment.

Action Distribution Analysis. To verify that Gossamer’s gains stem from genuinely leveraging all three actions rather than degenerating into one dominant policy, we record the fraction of candidate tokens assigned to each action by the DAU framework. Under budget = 1024 on MATH-500 with DS-Llama-8B, the distribution is: Evict 87.6%, Quantize 10.1%, and Merge 2.3%.

This distribution confirms that no single action subsumes the others — removing quantization or merging would force their respective tokens into eviction, discarding information the DAU framework otherwise preserves at low cost. This supports our central claim that a hybrid, utility-driven action space, rather than any single compression technique, is necessary to make effective use of a constrained KV budget.