Manuscript Offprint
arXiv:2608.29363TRACER: Per-Tool Context Retention for LLM Agents via Consequence-Attributed Reinforcement Learning
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.
1 Introduction
Enterprise data agents answer business questions by chaining tool calls over many reasoning steps (Yao et al. 2023; Schick et al. 2024). Because each tool output is appended to the context and never discarded, the working memory grows monotonically. A single SQL result alone can exceed ten thousand tokens, and a typical task spans five to ten such calls. The accumulated context therefore routinely reaches hundreds of thousands of tokens, exceeding model windows, exhausting cost budgets, and degrading reasoning through diluted attention. Therefore, context compression becomes essential.

Figure 1: The compression–consequence gap. Token cost falls as compression becomes more aggressive, but total cost also accounts for downstream re-invocations.
Existing compression methods operate at various granularities: token-level pruning (Jiang et al. 2023, 2024; Pan et al. 2024), turn-level summarization (Xu, Shi, and Choi 2024), and step-level dropping (Zhang and Sun 2026). Yet they all apply a uniform strategy across heterogeneous content. In an agentic session, tool outputs vary widely in downstream importance: a schema lookup may be referenced by every subsequent step, whereas a permission check is never revisited. What is needed is a query-conditioned, per-tool retention policy that allocates the token budget according to each output's future utility.
A deeper limitation is that existing methods evaluate compression in isolation. In an agentic loop, the model continues to act after compression. When a needed detail has been removed, the agent re-invokes the tool to recover it. For data agents, a single compensatory SQL call can consume tens of thousands of additional tokens. Because compression recurs as new outputs accumulate, such costs compound across steps. We call this mismatch between compression-time savings and downstream cost the compression–consequence gap, illustrated in Figure 1.
To close this gap we propose TRACER, a reinforcement-learning framework that dynamically determines the retention ratio for each tool output. The policy emits a continuous action per output, letting the token budget flow to outputs whose removal would trigger expensive recovery. The training reward combines task success, token efficiency, and the fraction of tools re-invoked after compression, so that savings purchased through costly recovery never yield a net gain. We train the policy with REINFORCE (Williams 1992) on full agent episodes.
A further challenge is credit assignment: each episode yields only one scalar reward across many per-tool decisions. To produce dense gradient signals, we introduce a learned outcome model that predicts per-tool consequences through single-tool counterfactuals.
Our contributions are:
• We formalize the compression–consequence gap as a sequential, per-tool decision problem whose reward explicitly prices downstream re-invocations.
• We propose a reinforcement learning framework that dynamically determines per-tool retention ratios, parameterized by a Beta distribution over a bounded action space.
• We introduce a learned attributor that predicts per-tool re-invocation consequences through single-tool counterfactuals. On semantic compressors, the attributor reduces both token consumption and re-invocation rate. On positional compressors, it protects task success by steering retention toward high-consequence outputs.
RL for language agents and credit assignment Prior RL methods for language agents assign credit at the step or turn level (Wang, Li et al. 2026; Li, Zhou et al. 2025; Li et al. 2026), exploit episode structure via graph decomposition or process rewards (Cheng, He et al. 2026; Lu, Lin et al. 2026; Su, Zeng et al. 2025; Zhang et al. 2026; Yuan, Xu et al. 2026; Cui et al. 2026), or penalize redundant tool calls (Cao et al. 2026; Chen et al. 2026). All optimize the agent's action policy. Our setting is the converse: we freeze the action policy and train only the context policy, using excess tool calls as a sparse credit signal.
To densify this signal, we adopt counterfactual credit assignment (Foerster et al. 2018; Wolpert and Tumer 2001; Arjona-Medina et al. 2019; Chen et al. 2025), which isolates one decision's contribution by comparing realized and alternative outcomes. We instantiate this at the level of individual tool outputs and learn an outcome model that predicts the consequence of dropping each one.
3 Method
As illustrated in Figure 2, TRACER recasts context compression as a sequential decision problem. When a compression event occurs, the policy reads per-tool features and emits a heterogeneous retention ratio for each tool. A fixed compressor applies these ratios, and the agent continues reasoning over the compressed context. Throughout the trajectory we record task success, token usage, and tool re-invocations triggered after compression. These signals jointly drive an online REINFORCE update. Once the session ends, an outcome model attributes the observed consequences back to individual tools through single-tool counterfactuals, yielding a dense per-tool signal. We build TRACER through the following three core steps:
3.1 Problem Formulation
The compression policy operates inside the agent’s execution loop, so we first describe the agent and how its context grows, then define compression over this process.
The agent A runs in discrete steps. At step t, it reads the current context , issues a tool call, and appends the returned output to . A session terminates when A emits a final answer or reaches the iteration limit, and counts as successful when the answer matches the ground truth, within a 5% tolerance for numeric queries.
The context comprises the system prompt, the tool definitions, the dialogue history, and the accumulated tool outputs. The last component dominates growth over a session. Once exceeds the token budget , a compression event shortens before the agent continues. Because the prompt and tool definitions are incompressible yet keep accumulating, is crossed more than once: a single session triggers compression events, typically several even under a generous budget.
We cast this sequence of events as a sequential decision problem. Each session forms an episode, and each compression event is a decision point. The state encodes the composition of through its segment shares and per-tool footprints, including the tool-output share that bounds the budget compression can reclaim. The action assigns a retention ratio to each of the N tool outputs present at the event. A ratio chosen at event carries into later events: discarding an output that a subsequent step needs forces a re-invocation whose cost falls on future decision points. This coupling across events defines a sequential process, specified in full in Appendix D.
3.2 Consequence-Aware Objective
Minimizing token consumption alone is insufficient because it overlooks the re-invocation cost. Whenever compression

Figure 2: Overview of TRACER. TRACER uses a policy network to decide how much of each tool's information to keep during compression, trains that policy online from trajectory outcomes, and uses a post-hoc counterfactual model to attribute credit precisely to each tool.
discards information that is later needed, the agent must re-invoke tools to recover it. We therefore design a reward that decomposes into a session-level base reward and an event-local recall penalty.
Session-level base reward The first component combines task success with token efficiency and is measured only at episode end:
where success indicates whether the agent answered correctly, T is the total session token count, and is the token total under the same query with no compression, averaged over five reference runs.
Event-local recall penalty While the base reward captures end-of-session outcomes, it cannot pinpoint which compression event caused a re-invocation. To provide a denser training signal, we introduce a penalty assessed immediately after each compression event:
where and denote the post-compression and reference tool-call counts within the same window. The reference counts are measured rather than assumed: we replay the same compression-trigger boundaries over the five keep-all timelines collected for that query, match windows by event order, and take to be their mean call count.
Combined objective Combining the two components yields the full objective:
The measured recall signal carries noise from natural call-count variation between rollouts. Appendix E describes a provenance upgrade that removes this noise through causal matching.
3.3 Per-Tool Compression Policy
Action parameterization The retention ratio lives on a bounded interval. We use a Beta distribution whose support matches this interval by construction, avoiding truncation artifacts:
where is the network-predicted mean and is a fixed concentration. At evaluation we replace sampling with the deterministic mean .
Network architecture The policy is a two-layer MLP mapping state to per-tool means with tool slots. The slots are ordered positions for the individual tool-output instances present at the current compression event, not one position per canonical tool type: repeated calls to the same tool keep distinct output identifiers and therefore receive their own slot, their own retention ratio, and their own gradient. Each slot encodes query relevance, downstream reuse, redundancy, and recency. A presence mask ensures that only tools present at the current event receive gradients. Full feature definitions appear in Appendix G.
Training We maximize Eq. 3 with REINFORCE. A per-query EMA baseline normalized by per-query standard deviation handles difficulty variation. The per-tool policy loss is:
where combines the session-level advantage with per-tool credit signals, defined next.
The Beta parameterization makes this baseline choice principled rather than incidental. Writing for the score of slot , the Beta log-moment identity gives (Appendix A). Any constant or action-independent baseline is therefore admissible without introducing bias into this score, and the per-slot gradient takes the covariance form : a slot moves toward higher retention precisely when sampling a larger ratio covaries with higher credit.
3.4 Counterfactual Credit Assignment
The objective in Eq. 3 yields one scalar reward per session across many per-tool decisions. Standard REINFORCE assigns the same gradient magnitude to all tools, providing no signal about which tool caused a failure. We address this with a two-channel scheme. The first channel distributes the penalty uniformly as a model-free floor. The second adds per-tool directionality through a learned outcome model.
Channel I: uniform penalty floor The first channel distributes uniformly over the k active tools:
Even if the attribution channel degrades entirely, this floor guarantees a correct, if coarse, penalty signal.
Channel II: counterfactual attribution via outcome model Let K denote the number of tools. We train an outcome model , a 2-layer 4-head Transformer over K tool tokens and one query token. It predicts per-tool re-invocation count , log token total , and success probability . Self-attention captures cross-tool coupling: compressing one tool can force re-invocation of another.
This model enables single-tool counterfactuals. For each tool , we compare the predicted cost under the chosen ratio versus , holding all else fixed. Defining , the per-tool credit becomes:
This signal is bidirectional: when savings exceed downstream cost, the signal encourages stronger compression; when the reverse holds, it discourages compression.
Algorithm 1 TRACER training loop (condensed)
Require: Queries Q, compressor C, agent A, token budget
1: Phase 0: run A five times per query with ; store and the reference timelines
2: for episode do
3: if , else
4: for each compression event t of the rollout do
5: Build output-instance slots, state , and the active mask
6: Sample from the Beta policy (Eq. 4); apply C
7: Match against the reference timelines; set (Eq. 2)
8: end for
9: Observe success and session tokens T; form (Eq. 1) and the advantage A against
10: for each recorded event t do
11: (Eq. 6); if also (Eq. 7)
12: (Eq. 8)
13: end for
14: Update on the loss of Eq. 5
15: if , or and then
16: Refit the outcome model from the replay buffer
17: end if
18: end for
19: return Frozen ; evaluate with its deterministic mean
Channel fusion We fuse both channels into the per-tool gradient coefficient:
where scales the session-level advantage relative to the per-tool signals, and controls trust in . We use a 20-episode warmup with , followed by a 10-episode linear annealing to , refreshing every 5 episodes thereafter. On held-out episodes, achieves Spearman for per-tool re-invocation prediction and Brier score 0.07 for success prediction, confirming directional reliability. Algorithm 1 summarizes the resulting training loop; the complete event-level algorithm appears in Appendix B.
4 Experiments
4.1 Setup
Platform We evaluate on a production data-analysis agent deployed at a large e-commerce company. The agent answers business questions using tools for knowledge search, SQL execution, permission checks, table lookup, and date resolution. The agent backbone is Claude Sonnet 4.6 (Anthropic 2025) with a 200K-token context window, held fixed throughout all experiments.
Because our policy relies on tool-level features rather than model internals, it does not depend on any particular backbone. We evaluate three compressor backends ordered by model reliance. Uniform truncation needs no model. Self-Info, a clause-level variant of Selective Context (Li
| Compressor | Strategy | Success↑ | Tok. ratio↓ | Save | Cost/succ.↓ | ||
|---|---|---|---|---|---|---|---|
| Truncation | Uniform-0.5 | 0.73 | 1.026 | -3% | 0.082 | 9.3 | 1.405 |
| Recency | 0.77 | 1.086 | -9% | 0.071 | 9.0 | 1.410 | |
| Token-prop. | 0.69 | 1.112 | -11% | 0.091 | 9.5 | 1.612 | |
| Tool-type-cond. | 0.76 | 0.841 | 16% | 0.045 | 8.5 | 1.107 | |
| TRACER | 0.77 | 0.694 | 31% | 0.021 | 7.8 | 0.901 | |
| Summarization | Uniform-0.5 | 0.80 | 0.832 | 17% | 0.105 | 9.6 | 1.040 |
| Recency | 0.80 | 1.194 | -19% | 0.088 | 9.1 | 1.493 | |
| Token-prop. | 0.77 | 1.231 | -23% | 0.098 | 9.4 | 1.599 | |
| Tool-type-cond. | 0.79 | 0.723 | 28% | 0.052 | 8.8 | 0.915 | |
| TRACER | 0.81 | 0.541 | 46% | 0.015 | 7.2 | 0.668 | |
| Self-Info | Uniform-0.5 | 0.62 | 1.207 | -21% | 0.128 | 10.2 | 1.947 |
| Recency | 0.71 | 1.242 | -24% | 0.112 | 10.4 | 1.749 | |
| Token-prop. | 0.66 | 1.187 | -19% | 0.121 | 10.0 | 1.798 | |
| Tool-type-cond. | 0.70 | 0.891 | 11% | 0.062 | 9.1 | 1.273 | |
| TRACER | 0.75 | 0.706 | 29% | 0.025 | 8.1 | 0.941 |
Table 1: Main comparison: TRACER vs. fixed and heuristic strategies. Token ratio = . Cost/succ. = Tok. ratio / Success.

TRACER Keep-all Uniform-0.5 Recency Tool-type-cond.
Figure 3: TRACER vs. fixed-strategy baselines across three compressors. Panels (a)–(c): token-ratio training curves (5 seeds, 15-episode rolling window, ±1 std). Panels (d)–(f): task success rate with 95% CI.
et al. 2023), ranks clauses by self-information scored by Qwen-2.5-0.5B (Team 2024). Summarization uses Qwen-3.7-Max (Team 2025) to condense text semantically. A fourth AGORA-style (Zhang and Sun 2026) step-level compressor is held out to test cross-compressor transfer.
Queries We collect 120 queries from production logs spanning three difficulty tiers: 25 simple lookups, 55 multi-step queries combining schema retrieval with SQL, and 40 multitable permission-gated joins. We split them into 80 training and 40 held-out queries, stratified by difficulty, each with a human-verified answer. Every RL configuration trains for 100 episodes per seed with 5 seeds. Held-out evaluation uses frozen deterministic policies.
Baselines All strategies share the same compressor backend. Keep-all serves as the success ceiling and token baseline. Uniform-0.5 applies a constant ratio. Recency decays the ratio linearly with age, , where indexes invocation order, so the most recent output retains 0.9 and the oldest 0.1. Token-proportional penalizes size, , so the largest output retains 0.3. Tool-type-conditional assigns a fixed ratio per canonical tool type, tuned by greedy coordinate descent over visiting types in decreasing mean-output-size order for two passes, each coordinate maximizing success rate minus 0.3 times token ratio on the training queries. It isolates whether tool identity alone suffices without query-conditioned adaptation.
Configuration The reward weights are and , with no event discount (). Retention ratios are requested on [0.05, 1.0] with Beta concentration , so a sampled ratio is . Policy and outcome model are trained with Adam at and respectively, with the policy gradient norm clipped at 1. Appendix H lists the full configuration.
Metrics Method comparisons use the paired Wilcoxon signed-rank test. For attribution experiments, the key metric is iso-success token ratio: we compare token ratios only within the success stratum so that savings are never confounded with task failure. Interquartile mean with stratified bootstrap 95% confidence intervals are also used. The recall column in the result tables is the event-local invocation rate of Eq. 2 taken without the factor, averaged first over the events of each evaluation record and then over the set of valid query–seed records:
Statistical details appear in Appendix J.
4.2 Main Comparison: TRACER vs. Fixed Strategies
Does learning per-tool retention ratios improve upon fixed compression strategies?
Table 1 shows that fixed baselines largely fail to reduce total tokens. Under truncation and Self-Info, they increase consumption by 3–24% relative to keep-all, with re-invocation rates at . Neither temporal proximity nor output size captures downstream importance. These results directly evidence the compression–consequence gap: indiscriminate compression triggers recovery behavior that offsets or exceeds the initial savings.
TRACER saves 29–46% of tokens while maintaining task success across all compressors. Summarization benefits most at 46% because it exploits fine-grained retention signals semantically; Self-Info saves 29%, truncation 31%, and the AGORA-style backend 34%. Re-invocation rates remain at or below 0.025 across all backends, confirming that the learned policy does not purchase savings through costly recovery.
The tool-type-conditional baseline captures part of the inter-tool variance, achieving 11–28% savings. TRACER further reduces tokens by 15–18% beyond this static allocation. The residual gap arises because the same tool type requires different retention across queries: an SQL result feeding a downstream multi-step join needs higher retention than one answering a single lookup directly. Query-conditioned adaptation drives the remaining gains. Savings are consistent across difficulty tiers at 32–48%, with a per-difficulty breakdown in Appendix I. Figure 3 visualizes the training dynamics.
4.3 Ablation: Effect of Attribution
Does the outcome model improve TRACER’s compression decisions?
We compare TRACER against an ablated RL-only variant that uses REINFORCE with uniform credit assignment. Both arms share the same policy architecture, reward, and training schedule. The only difference is whether the outcome model provides per-tool directional signals.
Table 2 shows that attribution improves task success across all three compressors: by 4.8 pp under summarization, 3.5 pp under Self-Info, and 2.2 pp under truncation. The pooled Wilcoxon test confirms significance at p=0.008. The outcome model steers retention toward high-consequence outputs, helping preserve critical information while reducing unnecessary context. This reallocation also reduces the iso-success token ratio across all three backends: by 3.4% under summarization, 4.1% under Self-Info, and 4.7% under truncation. In addition, the re-invocation probability decreases by 13% in aggregate. Figure 4 shows that TRACER converges to lower token ratios and re-invocation rates than RL-only.
Under truncation, attribution increases success by 2.2 pp while reducing the iso-success token ratio from 0.728 to 0.694, corresponding to a 4.7% relative reduction. Although positional truncation offers less flexibility than semantic compression, consequence-aware budget allocation can still protect high-consequence outputs while compressing less consequential content more aggressively. Attribution therefore provides both success protection and additional token savings on this backend.
4.4 Validation with Interventional Rollouts
The ablation shows that attribution improves the policy, but not whether the outcome model correctly predicts the consequence of changing an individual tool's retention ratio. We test this directly against actual single-tool interventions.
From held-out trajectories we sample compression states together with the frozen policy's action . For each active tool we replay the agent from the saved snapshot twice: a factual rollout under , and an intervention rollout that sets while holding all other ratios fixed. Both use the same frozen deterministic policy after the event and share paired seeds to cancel sampling noise. The measured consequence and its model estimate are
where a positive value means that fully retaining tool i lowers expected downstream cost relative to the policy-selected ratio.
Table 3 validates the counterfactual estimates: predicted vs. rollout differences yield Spearman , the attributor recovers 82% of the true top-3 highest-consequence tools, and 84% of predicted credit directions match rollout, confirming the signal provides informative per-tool gradients.
4.5 Behavioral Analysis
Per-tool learned ratios Figure 5 shows the converged ratios across tools. Under summarization, execute_sql converges to the highest retention at 0.65, while resolve_date_range settles at the lowest at 0.48. This ordering aligns with regenerability cost: SQL results carry irreplaceable numeric data, whereas date lookups return static content that is cheap to regenerate. Under truncation, the spread narrows to 0.52–0.60 because positional truncation cannot exploit fine-grained ratio differences.
Cross-backbone transfer To test whether the learned retention structure depends on the training backbone, we freeze the policy trained on Claude Sonnet 4.6 and evaluate it zero-shot on Qwen-3.7-Max (Team 2025) and GPT-5.5 (OpenAI 2025). Table 4 reports results:
Across both unseen backbones, TRACER retains 18–40% savings. GPT-5.5 preserves 78–87% of the training-backbone gains while Qwen-3.7-Max retains 62–76%, consistent with GPT-5.5's stronger tool-calling compliance. In all reported cases, the frozen TRACER policy achieves positive token savings on the two alternative backbones. These results provide initial evidence that the learned retention policy can transfer across model families without retraining.
Deployment cost analysis. The one-time training investment (Appendix H) is modest relative to the recurring savings: at production traffic of 1000+ sessions per day, the
| Compressor | Arm | Success↑ | Iso-succ. tok.↓ | 95% CI | tok | ↓ | (K) |
|---|---|---|---|---|---|---|---|
| Truncation | RL-only | 74.8% | 0.728 | [.703, .753] | — | 0.022 | 72.8 |
| TRACER | 77.0% | 0.694 | [.685, .704] | -4.7% | 0.021 | 69.4 | |
| Summarization | RL-only | 76.2% | 0.560 | [.551, .569] | — | 0.018 | 47.5 |
| TRACER | 81.0% | 0.541 | [.532, .550] | -3.4% | 0.015 | 45.9 | |
| Self-Info | RL-only | 71.5% | 0.736 | [.722, .750] | — | 0.028 | 71.2 |
| TRACER | 75.0% | 0.706 | [.693, .719] | -4.1% | 0.025 | 68.3 |
Table 2: Ablation of TRACER against the RL-only baseline. Each arm uses 5 seeds

Figure 4: Attribution ablation, RL-only (blue) vs. TRACER (orange). Columns are per-compressor; each shows token ratio and re-invocation rate . 5 seeds, 15-episode rolling window; bands are ±1 std.
| Metric | Trunc. | Summ. | Self-Info | Aggr. |
|---|---|---|---|---|
| Spearman | 0.64±.05 | 0.73±.04 | 0.61±.06 | 0.66±.03 |
| NMAE↓ | 0.11±.02 | 0.12±.01 | 0.17±.02 | 0.13±.01 |
| Top-3 overlap↑ | 0.80±.05 | 0.86±.04 | 0.81±.05 | 0.82±.03 |
| Sign Acc.↑ | 0.83±.04 | 0.88±.03 | 0.80±.04 | 0.84±.02 |
Table 3: Validation of the outcome-model counterfactuals against single-tool intervention rollouts on held-out states. Cells are mean ±95% CI.

Figure 5: Converged per-tool retention ratios. Tools are sorted by regenerability cost.
per-session token reduction recoups the full training cost within 3–6 weeks, after which the learned policy delivers compounding savings indefinitely (Appendix L).
4.6 Transfer to an AGORA-Inspired Compressor
Does a policy learned on one compressor transfer to a structurally different one?
The three backends above share clause- or position-level granularity. The AGORA-style (Zhang and Sun 2026) step-level compressor is structurally different: it chains clause seg-
| Comp. | Backbone | Succ.↑ | Tok. r.↓ | ↓ |
|---|---|---|---|---|
| Truncation | Qwen-3.7-Max | 0.72 | 0.78 | 0.035 |
| GPT-5.5 | 0.75 | 0.74 | 0.026 | |
| Summarization | Qwen-3.7-Max | 0.75 | 0.65 | 0.028 |
| GPT-5.5 | 0.78 | 0.60 | 0.020 | |
| Self-Info | Qwen-3.7-Max | 0.69 | 0.82 | 0.039 |
| GPT-5.5 | 0.72 | 0.77 | 0.029 |
Table 4: Cross-backbone transfer: frozen policy (trained on Claude Sonnet 4.6) evaluated zero-shot on alternative backbones.
mentation, self-information scoring, an always-keep floor for numeric content, and greedy budget fill. To this end, we conduct experiments on Agora-style compressor to demonstrate the generalizability of TRACER.
| Strategy | Success↑ | Tok. ratio↓ | Save |
|---|---|---|---|
| Uniform-0.25 | 0.65 | 1.208 | -21% |
| TRACER (zero-shot) | 0.62 | 0.690 | 31% |
| TRACER (on AGORA) | 0.65 | 0.656 | 34% |
Table 5: Transfer to the AGORA-style compressor.
From table 5 we can observe that uniform-0.25 increases total tokens by 21% relative to keep-all: its aggressive budget forces the always-keep floor to dominate, leaving insufficient budget for non-floor clauses and triggering recovery calls.
Also, table 5 reports two TRACER variants. The first, trained only on the truncation backend and applied zero-shot, achieves 31% savings at success 0.62. The second, trained directly on the AGORA backend, reaches 34% savings at matched success 0.65 by learning per-tool budgets that co-operate with the floor mechanism. The per-tool importance structure TRACER learns transfers across backends without fine-tuning, and target-specific training recovers the remaining gap.
4.7 Generalization on LOCA-bench
To further test the generalization, we evaluate TRACER on LOCA-bench (Zeng, Huang, and He 2026), a public benchmark with 15 task environments and deterministic workspace-comparison evaluation. The tool set and task distribution are entirely disjoint from our production training environment. We use the three longest context-window settings (96K, 128K, 256K) where compression pressure is strongest. We train a fresh TRACER policy via 5 rounds of iterative RL over 10 task environments and evaluate on 5 held-out environments. Table 6 reports success rates aggregated across the three context windows.
| Compressor | Strategy | Success↑ | Tok. ratio↓ |
|---|---|---|---|
| Keep-all | 0.37 | 1.000 | |
| Truncation | Recency | 0.39 | 0.978 |
| Token-prop | 0.40 | 0.961 | |
| TRACER | 0.44 | 0.751 | |
| Summarization | Recency | 0.41 | 0.847 |
| Token-prop | 0.23 | 0.938 | |
| TRACER | 0.48 | 0.806 | |
| Self-Info | Recency | 0.35 | 0.891 |
| Token-prop | 0.24 | 0.922 | |
| TRACER | 0.38 | 0.815 |
Table 6: Generalization on LOCA-bench (5 held-out tasks × 5 seeds × 3 context windows).
From table 6 we can know that TRACER outperforms keep-all across all compressor backends. TRACER achieves higher aggregate success than keep-all in the reported long-context settings. Also, TRACER outperforms heuristic baselines while achieving token savings in general. Since uniform-0.5 suffers from truncation that is too aggressive and inflexible, it almost never succeeds on LOCA-bench; we therefore omit further discussion of it here. To be more specific, TRACER's gains concentrate on data-analysis tasks for it preserves data-bearing outputs and compresses auxiliary ones. It also works well on procedural tasks with strong sequential dependencies because its policy identifies the causally critical nodes in the operation chain and allocates context budget to them, allowing the agent to retain a coherent execution spine under severe pressure and complete workflows that other strategies cannot.
5 Conclusion
We presented TRACER, a reinforcement-learning framework that treats context compression as a sequential per-tool decision problem. Our method saves tokens across four compressor backends while preserving task success. A two-channel credit scheme attributes consequences to individual tools through single-tool counterfactuals, lifting success on semantic compressors. The learned policy generalizes to held-out queries, transfers zero-shot across agent backbones and compressor architectures, and achieves 18–25% savings on LOCA-bench.
References
Anthropic. 2025. The Claude Model Family: Claude Opus 4, Claude Sonnet 4.
Arjona-Medina, J. A.; Gillhofer, M.; Widrich, M.; Unterthiner, T.; Brandstetter, J.; and Hochreiter, S. 2019. RUDDER: Return Decomposition for Delayed Rewards. In Advances in Neural Information Processing Systems.
Cao, H.; Yan, N.; Deng, H.; Wang, Z.; Yang, T.; Huo, J.; Zhang, Y.; and Gao, Y. 2026. Tool-Aware Optimization with Entropy Guidance for Efficient Agentic Reinforcement Learning. arXiv:2606.03762.
Chen, J.; Wang, Y.; Wang, J.; Xie, X.; Hu, J.; Wang, Q.; and Xu, F. 2025. Understanding Individual Agent Importance in Multi-Agent System via Counterfactual Reasoning. In Proceedings of the AAAI Conference on Artificial Intelligence.
Chen, L.; Tang, D.; Shi, X.; Chen, D.; Liu, Q.; Wu, S.; and Wang, L. 2026. Learning When Not to Act: Mitigating Tool Abuse in Agentic Reinforcement Learning. arXiv:2606.02132.
Cheng, X.; He, S.; et al. 2026. Beyond Trajectory-Level Attribution: Graph-Based Credit Assignment for Agentic Reinforcement Learning. arXiv:2605.26684.
Cui, F.; Zhu, R.; Fang, C.; Li, S.; and Li, J. 2026. Rethinking Agentic Reinforcement Learning In Large Language Models. arXiv:2604.27859.
Foerster, J. N.; Farquhar, G.; Afouras, T.; Nardelli, N.; and Whiteson, S. 2018. Counterfactual Multi-Agent Policy Gradients. In Proceedings of the AAAI Conference on Artificial Intelligence.
Hu, J.; Zhang, W.; Wang, Y.; Hu, Y.; Xiao, B.; Tan, M.; and Du, Q. 2025. Dynamic Compressing Prompts for Efficient Inference of Large Language Models. arXiv:2504.11004.
Jiang, H.; Wu, Q.; Lin, C.-Y.; Yang, Y.; and Qiu, L. 2023. LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models. In Proceedings of EMNLP.
Jiang, H.; Wu, Q.; Luo, X.; Li, D.; Lin, C.-Y.; Yang, Y.; and Qiu, L. 2024. LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compression. In Proceedings of ACL.
Kang, M.; Chen, W.-N.; Han, D.; Inan, H. A.; Wutschitz, L.; Chen, Y.; Sim, R.; and Rajmohan, S. 2025. ACON: Optimizing Context Compression for Long-horizon LLM Agents. arXiv:2510.00615.
Li, J.; Zhou, P.; et al. 2025. Turn-PPO: Turn-Level Advantage Estimation with PPO for Improved Multi-Turn RL in LLMs. arXiv:2512.17008.
Li, M.; Xu, L. H.; Tan, Q.; Ma, L.; Cao, T.; and Liu, Y. 2025. Sculptor: Empowering LLMs with Cognitive Agency via Active Context Management. arXiv:2508.04664.
Li, Y.; Dong, B.; Guerin, F.; and Lin, C. 2023. Compressing Context to Enhance Inference Efficiency of Large Language Models. In Proceedings of EMNLP.
Li, Y.; Zhou, Q.; Duan, W.; and Chen, L. 2026. When Denser Credit Is Not Enough: Evidence-Calibrated Policy Optimization for Long-Horizon LLM Agent Training. arXiv:2606.05885.
Lu, M.; Sun, W.; Du, W.; Ling, Z.; Yao, X.; Liu, K.; and Chen, J. 2025. Scaling LLM Multi-turn RL with End-to-end Summarization-based Context Management. arXiv:2510.06727.
Lu, Z.; Lin, Z.; et al. 2026. HISR: Hindsight Information Modulated Segmental Process Rewards for Multi-turn Agentic RL. arXiv:2603.18683.
OpenAI. 2025. GPT-5.5 System Card.
Packer, C.; Wooders, S.; Lin, K.; Fang, V.; Patil, S. G.; Stoica, I.; and Gonzalez, J. E. 2024. MemGPT: Towards LLMs as Operating Systems. In Advances in Neural Information Processing Systems.
Pan, Z.; Wu, Q.; Jiang, H.; Xia, M.; Luo, X.; Zhang, J.; Lin, Q.; Rühle, V.; Yang, Y.; Lin, C.-Y.; et al. 2024. LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression. arXiv:2403.12968.
Schick, T.; Dwivedi-Yu, J.; Dessì, R.; Raileanu, R.; Lomeli, M.; Hambro, E.; Zettlemoyer, L.; Cancedda, N.; and Scialom, T. 2024. Toolformer: Language Models Can Teach Themselves to Use Tools. Advances in Neural Information Processing Systems.
Su, J.; Zeng, X.; et al. 2025. Enhancing Agentic RL with Progressive Reward Shaping and Value-based Sampling Policy Optimization. arXiv:2512.07478.
Team, Q. 2024. Qwen2.5: A Party of Foundation Models. arXiv:2412.15115.
Team, Q. 2025. Qwen3 Technical Report. arXiv:2505.09388.
Verma, N. 2026. Active Context Compression: Autonomous Memory Management in LLM Agents. arXiv:2601.07190.
Wang, D.; Li, Q.; et al. 2026. StepPO: Step-Aligned Policy Optimization for Agentic Reinforcement Learning. arXiv:2604.18401.
Williams, R. J. 1992. SIMPLE Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning. Machine Learning, 8(3): 229–256.
Wolpert, D. H.; and Tumer, K. 2001. Optimal Payoff Functions for Members of Collectives. Advances in Complex Systems, 4(2–3): 265–279.
Xu, F.; Shi, W.; and Choi, E. 2024. RECOMP: Improving Retrieval-Augmented LLMs with Compression and Selective Augmentation. arXiv:2310.04408.
Yao, S.; Zhao, J.; Yu, D.; Du, N.; Shafran, I.; Narasimhan, K.; and Cao, Y. 2023. ReAct: Synergizing Reasoning and Acting in Language Models. In Proceedings of ICLR.
Yi, L.; Lei, R.; Yao, L.; Xie, Y.; Li, Y.; Zhang, W.; Wei, Z.; Li, Y.; and Nie, J.-Y. 2026. Learning Agent-Compatible Context Management for Long-Horizon Tasks. arXiv:2605.30785.
Yuan, H.; Xu, Z.; et al. 2026. Verifiable Process Rewards for Agentic Reasoning. arXiv:2605.10325.
Zeng, W.; Huang, Y.; and He, J. 2026. LOCA-bench: Benchmarking Language Agents Under Controllable and Extreme Context Growth. arXiv preprint arXiv:2602.07962.
Zhang, H.; and Sun, Z. 2026. AGORA: Adapter-Grounded Observation-Action Retention for Inference-Free Prompt Compression in LLM Agents. arXiv:2605.26596.
Zhang, Z.; Song, K.; Wang, X.; Hu, Y.; Yan, W.; Zhao, C.; Zou, H. P.; et al. 2026. CM : Reinforcement Learning with Checklist Rewards for Multi-Turn and Multi-Step Agentic Tool Use. arXiv:2602.12268.
Technical Appendix
A Score Function of the Beta Policy
The reference implementation uses , , and . Thus , where has mean , with and . The log-density is
Differentiating gives digamma terms and . Since and , the two terms cancel:
Using the Beta log-moment identity (differentiate the normalizer under the integral), , so . Zero mean makes any constant or action-independent baseline unbiased, and gives , the entry point for Appendix C. At evaluation, the deterministic Beta mean is mapped back to the retention interval, so the applied ratio is .
B Full Training Algorithm
Algorithms 2 and 3 give the event-level training path implemented in the supplement. Phase 0 keep-all rollouts establish but are not inserted into the outcome-model replay buffer. The coevolve arm initializes its outcome model randomly and does not accept a pretrained predictor. Eligible policy-rollout events accumulate during the warmup; the first fit occurs immediately at the boundary after the 20th completed episode, and later fits occur every five completed episodes. Consequently, in Eq. (7) is a model counterfactual, not a separately observed Phase 0 label.
C Gradient-Direction Intuition for Attribution
This section provides implementation intuition rather than a new theoretical claim. Equation (7) combines two terms with opposing effects. The immediate-saving term uses the ratio sampled and requested by the policy; it grows as requested retention decreases and therefore rewards compression. The counterfactual downstream-cost term is , so only predicted harm relative to fully retaining tool is subtracted. Predicted negative cost differences do not create an extra reward. The net credit favors compression for low-consequence outputs and protects outputs with predicted downstream cost.
The model is not assumed to provide a formal causal guarantee. Its usefulness is evaluated empirically by the attribution ablation in Table 2 and the single-tool interventional rollouts in Table 3 of the main paper.
D Sequential Semi-MDP Formulation
With events , the main paper defines the base reward only at the terminal event. No discount factor is specified or needed to restate that objective. The undiscounted base return and normalized advantage used by the shaped surrogate are
Because rescales and adds model-based shaping, is the expected update direction of Eqs. (5) and (8), not an unbiased estimator of for the task-level objective in Eq. (3). stays event-local and is consumed by the credit at event ; it is not replaced by a session-level count. Reference windows are obtained by replaying the same compression-trigger boundaries over the five keep-all timelines and matching windows by event order; is their mean call count. The active mask sums log-probabilities over all tools present at the event, so every event is logged separately. The reference implementation estimates from the most recent 20 rewards after at least three observations, with a floor of 0.01, as specified in Algorithm 2 and Table A2.
E Provenance-Based Attribution
This appendix specifies the provenance upgrade referenced in the main paper. It replaces the proximal time-window proxy with causal source matching: each removed span at event is tagged with , where is a content signature, and a later tool call is matched to an earlier removed span:
The resulting count sums matched costs and defines a provenance-based penalty and targeted floor:
When , the floor conserves the penalty by construction and removes the time-window mixing identified in the main paper. Match precision remains an empirical property of the signature and threshold, so a deployment should calibrate hit and mismatch rates on labeled calls. The reported experiments and Algorithm 2 retain the measured window-based signal in Eq. (2); provenance is the stated upgrade path rather than a replacement for those reported numbers.
Algorithm 2 TRACER: Rollout and Event Recording
Require: Queries Q, compressor C, agent A, per-run trigger on backend-estimated full
1: Initialize policy ( MLP), random outcome model , and replay buffer B (capacity 500)
2: Initialize per-query EMA baselines and reward histories
3: Phase 0: Baseline Collection
4: for each do
5: Run A five times with ; set to mean total tokens and retain reference timelines
6: end for
7: Phase 1: Online Training
8: for episode do
9: Sample query
10: for ; otherwise
11: Initialize event records
12: Run A on q with the compression policy
13: for each compression event do
14: Build ordered output-instance slots, state , and the active mask
15: for each tool slot i
16: Sample ; request
17: Apply C with requested ratios
18: Observe and matched keep-all count in the same event window
19: Compute event-local with the Eq. (2) zero-reference rule; set
20: Append to
21: end for
22: if any event-local recall measurement is missing then
23: Skip the update rather than treating missing recall as zero
24: end if
25: Observe success and total session tokens T
26:
27: ;
28: if , else
29: ; update with decay 0.9 and append to
30: Pass to Algorithm 3
31: end for
32: return Frozen policy ; use its deterministic mean for evaluation
F Design Considerations and Solutions
• Bounded action. The Beta policy in Eq. (4) of the main text matches the bounded action support without post-sampling truncation.
• Smooth downstream cost. The reported uses for its token term. No result for a hard-clamped alternative is reported.
• Optional inverse-propensity weighting. A stabilized self-normalized inverse-propensity weight could be investigated when action–state dependence is a concern. It is not part of the objective, algorithm, or reported experiments, and this appendix makes no identifiability claim for it.
• Optional provenance matching. The measured proximal-window target can include natural call-count variation. Appendix E describes a possible upgrade, not a component of the reported method.
G Feature Definitions
The released policy state is
The 16 positions are fixed-width tensor slots for ordered tool-output instances present at the current compression event, not one slot per canonical tool type. Repeated calls to the same tool retain distinct output identifiers, slots, ratios, and gradients. Unused positions are zero-padded and masked. The reference implementation rejects events containing more than 16 eligible outputs rather than silently merging or dropping them.
The outcome model reuses the ten dimensions for each output and appends the applied retention ratio as an eleventh dimension. A separate seven-dimensional query token is projected into the same 64-dimensional embedding space. It predicts , , and the auxiliary success probability ; only and enter .
Algorithm 3 TRACER: Policy and Outcome-Model Updates
Require: Episode , attribution weight , records , advantage , event count , baseline
1: for each event record do 2: with 3: credit for (Eq. 6) 4: credit 5: if then 6: 7: 8: credit (Eq. 7) 9: end if 10: coeff (Eq. 8) 11: end for 12: Policy Update (shaped surrogate): 13: 14: Adam update of (LR ; gradient norm clipped at 1) 15: Add eligible event records with propensity and outcomes to ; mark episode completed 16: if or and then 17: Update for 10 steps from batches of 16 using the multi-task loss in Appendix H 18: At , fail the coevolve run if eligible labels are insufficient or the first fit fails 19: end if 20: Every 10 episodes, retain the checkpoint with the best rolling-10 mean reward
H Reported Baselines and Experimental Configuration
H.1 Baseline Strategy Formulas
We restate the baseline definitions from Section 4.1 of the main text. Exact formulas are shown only when the main text specifies them.
Keep-all. for all tools. Serves as the success ceiling and token baseline ( ).
Uniform-0.5. for all tools, regardless of type, size, or position.
Recency. The ratio decays linearly from the most recent tool output (highest ratio) to the oldest:
where is the position of tool sorted by invocation time (most recent = ). This yields for the most recent and for the oldest. For the single-output case , the reference implementation uses the midpoint .
Token-proportional. For output-size estimate size ,
The largest output receives 0.3; smaller outputs approach 1.
Tool-type-conditional. The released search uses greedy coordinate descent over , visiting canonical tool types in decreasing mean-output-size order. Each coordinate maximizes success rate minus 0.3 times token ratio on training queries while holding other coordinates fixed; the default script runs two passes.
H.2 Reference Implementation Configuration
Table A2 records the checked-in defaults used by the reference implementation. These values document the released training path; they are not a per-table run manifest, and command-line or environment overrides must be recorded when regenerating an experiment.
The outcome loss is
with count and token predictions and targets standardized by running statistics. The auxiliary success head is trained by this loss but is omitted from . The released updater can additionally apply propensity weighting and an EMA anchor; these are implementation stabilizers rather than new terms in the paper objective.
H.3 Computing Infrastructure and Runtime
The reference environment used a single Intel Xeon Platinum 8369B server (32 CPU cores, 128 GB RAM) running Alibaba Cloud Linux 3 with kernel 5.10. The software stack was Python 3.12.4, PyTorch 2.3.1, NumPy 1.26.4, SciPy 1.13.0, Flask 3.0.3, and Transformers 4.42.0. The policy and outcome model together contain 102,306 trainable parameters (31,696 and 70,610, respectively), approximately 102K, and run on CPU; external agent and compressor-model calls dominate wall-clock cost.
| Block | Dim. | Meaning |
| Query | 0.3 log, a token-length proxy. | |
| Numeric-constraint indicator. | ||
| Multi-hop/comparison indicator. | ||
| Mutually exclusive retrieval, SQL/aggregation, report, and other intents. | ||
| Output | Presence flag. | |
| 0.1 log, output-size feature. | ||
| Output-token share within the current event. | ||
| 0.1 log within the event. | ||
| for repeated calls. | ||
| Query relevance; fallback static criticality prior high/medium/low = 1.0/0.5/0.2. | ||
| Prefix-available downstream-reuse annotation, else zero. | ||
| Prefix-available redundancy annotation, else zero. | ||
| Normalized event-slot recency, from oldest 0 to newest 1. | ||
| Prefix rework annotation when available, else zero. | ||
| Context | System, instruction/tool-definition, dialogue-history, tool-output, and scratchpad fractions. | |
| Context pressure relative to compression threshold . | ||
| Normalized compression-event index. |
Table A1: Reference implementation feature specification. Runtime annotations use only values available in the trajectory prefix; unavailable annotations default to zero or the stated prior.
The production agent backbone is Claude Sonnet 4.6 with a 200K-token context window. Truncation is local string slicing, Self-Info uses a local Qwen-2.5-0.5B clause scorer, and summarization uses Qwen-3.7-Max through an API; the AGORA-inspired backend combines step/clause segmentation, self-information scoring, and a numeric-content floor. A rollout takes roughly 30–180 seconds depending on query and backend. A 100-episode, five-seed run for one compressor takes about 25–42 hours. The broader experimental campaign was approximately 400 compute-hours and $2,800 in backbone API charges; these figures are operational measurements, not controlled efficiency outcomes.
H.4 Outcome Model Held-Out Accuracy
Table A3 restates the two held-out metrics reported in Section 3.4 of the main text.
The Spearman result supports the directional ranking used by the counterfactual credit. The success-probability head is an auxiliary prediction head evaluated by the Brier score. It is excluded from the downstream-cost definition in the main paper.
H.5 LOCA-bench Training Configuration
Section 4.7 and Table 6 of the main paper report the LOCA-bench experiment. A fresh TRACER policy is trained for five rounds of iterative RL on 10 of the benchmark's 15 task environments and evaluated on the other 5. Evaluation aggregates the 96K, 128K, and 256K context-window settings over 5 seeds.
I Difficulty Tiers and Evaluation Boundary
The full production-query corpus contains 120 queries in three tiers:
-
25 simple lookups;
-
55 multi-step queries combining schema retrieval with SQL; and
-
40 multi-table permission-gated joins.
The stratified 80/40 split yields the following held-out composition: Held-out evaluation uses frozen deterministic policies on these 40 queries. The main paper reports the cross-cell range above.
J Statistical Procedures and Reporting Boundary
Each RL configuration trains for 100 episodes per seed with five seeds; this training schedule is not itself the sample size of a held-out hypothesis test. Test sample sizes are determined after aligning the available method records on their observation keys and applying the metric-specific validity filter. No post-hoc power calculation is reported.
J.1 Reported Recall Statistic
The uppercase in Eq. (2) is a training penalty, where the event-local rate is
For the set of valid query–seed evaluation records, the low-ercase table statistic first averages events within each record and then averages the resulting record-level rates:
Zero-reference cases are handled as in Algorithm 2. Thus is an event-local rate, not a probability or a training penalty: it does not include and does not sum across events. Training curves apply the stated rolling-window mean to the corresponding record-level rates.
| Group | Setting | Value |
|---|---|---|
| Reward | 0.3, 0.2, 0.3 | |
| 0.1, 0.3, 0.5 | ||
| 1.0 (no event discount) | ||
| Policy | Architecture | 174→128→64→16, ReLU |
| Action interval; | [0.05, 1.0]; 8.0 | |
| Optimizer; LR; grad clip | Adam; ; 1.0 | |
| Baseline | EMA decay | 0.9 |
| Scale estimate | Last 20 rewards after 3 samples; floor 0.01 | |
| Outcome | Architecture | |
| Inputs | 16 output tokens 11 dims; one 7-dim query token | |
| Optimizer; LR | Adam; | |
| Loss weights () | (1.0, 1.0, 0.3) | |
| Monotonicity weight | ||
| Batch; replay capacity | 16; 500 event records | |
| Refresh work | 10 gradient steps per refresh | |
| EMA anchor | Decay 0.995 after warmup | |
| Schedule | Warmup; annealing; refresh | 20 episodes; 10 episodes; at 20 completed episodes, then every 5 |
| Environment | Compression threshold | Caller-supplied per run; backend-estimated full |
| Keep-all reference | 5 runs per query | |
| Training length; seeds | 100 episodes; {0, 1, 2, 3, 4} |
Table A2: Reference implementation defaults.
| Metric | Value | Description |
|---|---|---|
| Spearman | 0.72 | Rank correlation between predicted and actual per-tool re-invocation counts |
| Brier score () | 0.07 | Calibration of success-probability prediction |
Table A3: Outcome-model held-out metrics reported in the main paper.
J.2 Confidence Interval Construction
Method-comparison token summaries use the interquartile mean (IQM) with 10,000 stratified bootstrap resamples. Observations are grouped by difficulty tier; within each resample, observations are sampled with replacement inside each tier while preserving the original tier sizes. The 2.5th and 97.5th percentiles of the bootstrap IQM distribution form the 95% interval. If no stratification variable is supplied, the implementation uses a single stratum rather than treating each observation as its own stratum.
Table 3 uses a different construction for counterfactual validation: each cell center is the metric's native point estimate, and percentile-bootstrap resampling treats each held-out state as a cluster so that paired interventions from the same state remain together. The reported value is the half-width of the resulting interval. These Table 3 intervals are not IQM intervals.
J.3 Hypothesis Testing
Method comparisons use a two-sided paired Wilcoxon signed-rank test. Records are aligned on the common explicit observation key—normally (query id, seed, episode) for training histories and (query id, seed) for one-shot held-out runs—before testing; unmatched records are not positionally paired. The pooled attribution-ablation result reported in the main paper is . Table 1 has no -value column, so the appendix does not attribute unreported per-baseline -values to it. Cliff's and Holm–Bonferroni utilities are included for additional analyses but are not retroactively attached to the main table.
Success conditioning. For the attribution experiments, the main paper defines the key token metric as the iso-success token ratio, computed within the success stratum. That conditioning should not be silently extended to every token ratio in the paper: the main comparison defines token ratio simply as .
J.4 Reproducibility of Randomness
Production-query RL runs use seeds . Each run seeds Python random, NumPy, and PyTorch before query sampling, policy initialization, Beta exploration, and replay-buffer sampling; output names carry the seed suffix. Frozen evaluation uses the deterministic policy mean. The LOCA launcher additionally propagates its selected seed through PYTHONHASHSEED. These controls reproduce the released program's stochastic choices but cannot make remote model or production-backend responses deterministic.
| Tier | Simple | Multi-step | Multi-table |
|---|---|---|---|
| Held-out queries | 7 | 19 | 14 |
| Reported saving | 32–48% across the reported tier-compressor cells | ||
Table A4: Composition of the held-out production-query split.
K Extended Related Work
Section 2 of the main paper groups related approaches into step/turn-level credit (Wang, Li et al. 2026; Li, Zhou et al. 2025; Li et al. 2026), structural or process-reward decomposition (Cheng, He et al. 2026; Lu, Lin et al. 2026; Su, Zeng et al. 2025; Zhang et al. 2026; Yuan, Xu et al. 2026; Cui et al. 2026), and redundant-tool-call penalties (Cao et al. 2026; Chen et al. 2026). These approaches optimize the agent's action policy, whereas TRACER freezes that policy and trains the context policy.
TRACER draws on counterfactual credit assignment (Foerster et al. 2018; Wolpert and Tumer 2001; Arjona-Medina et al. 2019; Chen et al. 2025): it compares the predicted consequence of the selected retention ratio with a single-tool fully retained alternative. This is the distinction established by the main paper; no additional claims about the cited methods' implementations are needed for reproduction.
L Cost-Benefit Analysis
Training adds an up-front cost, whereas token savings recur with use. For a deployment with training cost , average keep-all tokens , observed token ratio r, token price p, and daily volume V, a simple scenario calculation is
The point calculation underlying the deployment discussion uses the conservative full-campaign backbone-API expenditure , tokens, the Summarization ratio r = 0.541, an input-token price tokens, and V = 1,000 sessions/day. It gives
This point lies within the 3–6 week scenario range stated in the main paper. Holding the other quantities fixed, an effective billed input-token price of approximately 3 per million gives the 24-day point above. Thus the range reflects pricing sensitivity rather than a confidence interval.
The calculation credits input-token reduction only. It excludes summarizer-model calls and tokens, Self-Info scorer compute, output-token pricing, CPU/server cost, retries, latency, integration and maintenance effort, distribution shift, and any monetary value assigned to a change in task success. It therefore should not be read as net profit, annual ROI, a guarantee of permanent savings, or evidence that the policy will not degrade. A deployment must recompute the expression from its billed costs and observed traffic.
M Released Data, Code, and Reproduction Boundary
The accompanying code_supplement contains the reference Beta policy, feature construction, outcome model, event-level training loop, policy server, compressor interfaces, reward and credit functions, statistical utilities, and API-adapter boundary. It also contains protocol scripts for fixed baselines and tool-type grid search, held-out evaluation, single-output interventions, cross-backbone transfer, AGORA-style evaluation, and LOCA-bench evaluation; offline unit tests; pinned Python dependencies; and an anonymized query-schema file.
The query file preserves the nominal 120-query composition, difficulty labels, and 80/40 split, including the 7/19/14 held-out stratification. Some evaluation targets are deliberately redacted or empty. The loaders mark those records unscorable rather than treating them as failures. Thus the file documents schema and split construction but is not a drop-in replacement for the private evaluation set.
The supplement does not include the proprietary production agent, warehouse or knowledge-base contents, raw production prompts and tool outputs, event logs and trajectories, trained checkpoints, or the raw matched inputs from which the paper tables were computed. It also does not vendor LOCA-bench or commercial model endpoints. api_client.py specifies an integration contract rather than implementing the production backend; evaluation commands require the corresponding external backend, checkpoint, trajectory, or benchmark artifacts and fail when they are absent.
Accordingly, the artifact supports source inspection, offline semantic tests, and reruns against a separately configured compatible backend. It does not support exact end-to-end replay of the production experiments.