Back to articles

TRACE Uses Tool Relevance to Compress Agent KV Caches

3 min read

When an agent can call many tools, the model must process their schemas: names, parameter definitions, and descriptions. These tokens occupy KV cache, sometimes forming a large share of the prompt prefix. But removing cache content is not a matter of cutting tokens indiscriminately. A schema needed for the current request may be essential, while many others may be irrelevant for that turn. An arXiv paper introduces TRACE, a method that makes tool relevance the basis for cache eviction and uses statistical calibration to manage the associated task risk.

What the study observes

On the Berkeley Function Calling benchmark, a turn presents about 28 tools, while reference calls invoke 1.7 on average. Schemas for tools not invoked account for 77% to 86% of the prefix. The authors report that removing those uninvoked schemas during prefill leaves task success essentially unchanged. By contrast, randomly removing the same amount of content is catastrophic. The result suggests that what gets removed matters more than the amount alone: relevance to the current turn is central to safe compression.

How TRACE works

The method has three stages. A lightweight predictor first ranks the tools available for the current turn. A keep rule then prefills the cache with schemas for selected tools, rather than all of them. Finally, a conformal layer calibrates the keep size against a chosen risk budget. In short, the predictor and keep rule decide which schemas to retain; calibration helps decide how many. The paper describes this as a distribution-free guarantee on task-success loss caused by compression. That claim applies to the paper’s calibration setup and should not be read as an unconditional guarantee for every model, dataset, or production environment.

Results and implications

The paper’s best-effort point retains 17% of the base prefix, or 25% of the long-context prefix, at a reported cost of 3 to 5 percentage points in task success. With a risk budget of α=0.10, the certificate selects a compressed option from the deployed keep-size family in all four model-context settings. The reported eviction-only reduction is 3.9–6.2×. This figure describes cache reduction from eviction; it should not be conflated with an equivalent reduction in total system memory use or serving cost.

TRACE’s broader contribution is to make cache compression sensitive to the task, instead of relying only on generic proxies such as perplexity. If the findings hold across more models, tool collections, and workloads, agents could allocate schema cache dynamically from turn to turn. Conformal calibration offers a way to make the trade-off between compression and task risk explicit. The evidence here is still benchmark-based, however. Predictor errors, changing tool inventories, and shifts in live request distributions remain important questions for further evaluation.

Source: arXiv

Comments

Checking sign-in status...

Loading comments...

Related articles

CCTest · Blog
Tencent Open-Sources DFly2 for Speculative Decoding in Sparse Models
Inference & Serving
cctest.ai

Tencent Open-Sources DFly2 for Speculative Decoding in Sparse Models

Tencent’s Hunyuan team has released DFly2’s weights, training code, and technical report for speeding up sparse-model inference. The team reports notable gains in selected tests, though the published post does not provide enough setup details to establish how broadly they apply.

Read more