Skip to content

TRACER: Per-Tool Context Retention for LLM Agents via Consequence-Attributed Reinforcement Learning

Aug 2026 · 0 citations · 30 references
Computer Science

TL;DR

TRACER is proposed, which formulates compression as a sequential per-tool decision problem, and demonstrates the value of consequence-aware, per-tool context retention for improving the efficiency of long-horizon language agents.

Abstract

Enterprise data agents answer business queries by chaining many tool calls over multiple reasoning steps, routinely accumulating hundreds of thousands of context tokens per session. Existing compression strategies typically allocate retention budgets without accounting for the downstream consequences of removing individual tool outputs. Aggressive compression may therefore trigger costly tool re-invocations that offset the initial savings. We call this the compression--consequence gap. To close it, we propose TRACER, which formulates compression as a sequential per-tool decision problem. A lightweight REINFORCE policy assigns query-conditioned retention ratios using only information available at each compression event. Its consequence-aware objective jointly accounts for task success, total token consumption, and post-compression tool re-invocations. To improve credit assignment, TRACER uses a learned outcome model to compare the predicted consequences of the selected retention ratio with those of fully retaining each tool output. On held-out production queries across three compressor backends, TRACER reduces total token consumption by 29--46% relative to keeping all context while maintaining comparable or higher task success. Compared with a tool-type-conditional static policy, TRACER provides an additional 15--18% of token savings. Interventional rollouts show that the learned per-tool credit scores correlate with measured single-tool consequences. The learned policy also yields positive savings when transferred across agent backbones and compressor architectures, and reduces token consumption by 18--25% on five held-out LOCA-bench environments. These results demonstrate the value of consequence-aware, per-tool context retention for improving the efficiency of long-horizon language agents.

View source

Similar papers

#artificial intelligence Preprint Sep 2026

SLCA-GRPO: Resolving Cross-Segment Credit Misattribution in Tool-Calling RL

This work proposes SLCA-GRPO, a framework incorporating Segment-Locked Credit Assignment (SLCA), a framework incorporating Segment-Locked Credit Assignment (SLCA) that decouples advantage estimation at the structural segment level within a single group of rollouts, without requiring additional rollouts from intermediat...

Ya-Ge Zhan, Shao-Bo Liu, Qiu-Nan Liu et al. · 0 citations
Preprint Aug 2026

Tunable Tool-Call Rates in LLM Agents via Representation Steering

Whether an instruction-tuned model calls a tool can be controlled by a single linear direction in its residual stream, extracted without any training from the model's own tool-use preference signal and turned into an inference-time intervention with no prompt change.

Yu-Qiang Chen, Vincent Siu, Yang Liu et al. · 1 citation
#artificial intelligence Preprint Sep 2026

TokenCast: Forecasting Token Consumption During LLM Agent Execution

TokenCast is proposed, which learns a composable cost representation for each execution segment, recording its own consumption and the context growth it introduces, and captures the extra input cost incurred when context from earlier segments is re-read by every later call.

Chao-Qian Ouyang, Ling Yue, Li-Bin Zheng et al. · 0 citations
Review

Context Compression for LLM Agents: A Survey of Methods, Failure Modes, and Evaluation

A unified taxonomy of agent context compression along three dimensions is introduced: compression target (what is compressed), compression mechanism (how it is transformed and retained), and control policy (who decides when compression is triggered).

Unknown authors · 10 citations
Review Sep 2026

Herschel: Continuous Optimization of Production LLM Inference through On-Demand Profiling

Model-as-a-service platforms call for continuous optimization as complex serving conditions expose inefficiencies missed before deployment. Detailed always-on profiling can incur substantial overhead, while lightweight collection omits information needed for diagnosis. We present Herschel, a continuous optimization sys...

Lu-Ping Wang, Wei-Gao Chen, Yi-Fei Wu et al. · 0 citations

Related blog posts

Hugging Face Blog Oct 20, 2026

MPS in PyTorch 2.15

We’re on a journey to advance and democratize artificial intelligence through open source and open science.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.