StateComp: Learning When to Compress History in Long Horizon Agents
Anonymous authors
ICLR 2027
TL;DR. StateComp learns when historical interactions become safe to compress based on the current agent state, reducing total token usage by 52.27% while maintaining task performance.
Abstract. Long horizon agents continuously accumulate interaction history during task execution, yet the importance of past interactions changes as the agent state evolves. Existing context management methods largely compress history based on fixed windows, periodic schedules, or current relevance, overlooking a more fundamental question: when has a past interaction become safe to replace? Premature compression may remove information still needed for future actions, while overly conservative retention leads to substantial context overhead. To address this, we propose State Conditioned Compression (STATECOMP), a framework that determines when historical interactions can be safely compressed according to the current agent state. STATECOMP constructs KEEP and READY supervision through a two stage annotation procedure and trains an imbalance aware router on hidden representations from a frozen language model. A bounded state representation further reduces the cost of evaluating long histories, while adjacent READY interactions are grouped into continuous spans and replaced with compact summaries during execution. Across four domains of long horizon agent tasks, STATECOMP reduces total agent and summarization tokens by 52.27% while maintaining task performance, and achieves a 12.67× speedup in representation extraction.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
ICLR 2027
Under review · 3 reviews · OpenReview
Updated 25 Nov 2026, 10:39 UTC.
- Rating
- 1/4
- Confidence
- 3/4
- Soundness
- 1/3
- Presentation
- 2/3
- Informativeness
- 1/3
Read review
Summary
This paper introduces StateComp, which uses a router to decide which historical interactions to retain in full or summarize based on the current agent state. The motivation is that the need for the original details of past interactions changes as a task progresses. The authors construct LLM-assisted annotations and train a router on representations from a frozen language model to predict whether an interaction can be compressed. On WorkBuddyBench, StateComp marginally improves task performance while reducing agent and summarization tokens relative to the no-compression baseline. The comparison with diverse compression methods in Table 3 shows the highest mean task reward among the evaluated methods, together with lower token usage than the no-compression baseline.
Strengths
- The idea of predicting which past interactions can be compressed based on the current agent state is interesting.
Weaknesses
-
I have serious concerns about the reliability and generalizability of the supervision described in Section 3. The KEEP/READY labels and earliest safe compression boundaries are derived through an annotation procedure involving an LLM. Although the authors state that they reviewed the procedure and resulting labels, it remains unclear whether these judgments transfer reliably to other long-horizon agent tasks beyond those evaluated. The annotation model is not disclosed, and the paper does not establish how the choice of annotating LLM affects label quality or the performance of the trained router.
-
The empirical evidence is insufficient to establish broader generalizability and practical efficiency. Although the paper evaluates StateComp against no compression on 260 tasks, the comparisons with diverse existing methods in Table 3 are limited to 40 tasks. This restricts the strength of the comparative evidence. The implementation and evaluation settings for these baselines are also insufficiently explained. In addition, although representation-extraction runtime and GPU memory are reported separately, the full deployment cost of the representation model and router is not quantified end to end. The reported token savings therefore do not establish the overall efficiency gain once this computation is included.
Questions for the authors
-
Approximately 93.6% of interaction-state pairs in the supervision data are labeled KEEP. How do the KEEP/READY proportions change during online evaluation? Please report these proportions, the fraction of interactions actually summarized, and the corresponding token volumes to clarify where the reported token savings come from.
-
KEEP and READY are used in the Introduction before they are defined. Could the authors define these labels when they first appear?
7 comments
Evaluation, Costs, and Offline Router Results
Weakness 2: Baselines, evaluation scope, and deployment efficiency
Evidence for broader generalizability and practical efficiency is insufficient. The 260-task evaluation compares against no compression, but Table 3's multi-method comparison covers only 40 tasks, with insufficient baseline implementation and evaluation details. Representation-model and Router deployment costs are not quantified end to end, so token savings alone do not establish overall efficiency.
Thank you for identifying these gaps. The revision will distinguish Full260 evaluation, Eval40 controls, and external benchmarks, and document baseline implementation sources, adaptations, evaluation settings, and token accounting.
2.1 Three seeds on fixed Eval40
Each seed uses the same 40 tasks, giving 120 complete runs per method.
| Seed | Base Reward | τ=0.60 Reward | Base tokens M/task | τ=0.60 tokens M/task |
|---|---|---|---|---|
| 17 | 0.6819 | 0.7215 | 1.8286 | 1.0744 |
| 31 | 0.6680 | 0.7085 | 1.9346 | 1.1278 |
| 53 | 0.6711 | 0.7181 | 1.8908 | 1.0864 |
| Mean | 0.6737 | 0.7160 | 1.8847 | 1.0962 |
All three seeds show higher mean Reward and lower Combined Tokens, adding repeatability evidence on fixed tasks. Full260 and the external benchmarks separately provide broader task coverage.
2.2 End-to-end latency including auxiliary computation
Mean complete-task latency in the same Eval40 evaluation:
| Method | E2E sec/task |
|---|---|
| Baseline | 910.22 |
| STATECOMP | 892.13 |
STATECOMP's E2E time includes Agent execution, summarization, local Qwen3.5-9B feature extraction, and Router forward computation. Combined Tokens count Agent and summary Input + Output; local computation is reported through latency and memory.
2.3 Feature extraction and local resources
STATECOMP uses a frozen feature model and lightweight classification head without autoregressively generating READY/KEEP judgments. It incurs no additional generative Router API bill, but uses local GPU compute, memory, and model-residency resources.
Paired measurements from Appendix C.3:
| Metric | Full history | Bounded representation |
|---|---|---|
| Paired feature-extraction time | 76.40 sec | 6.03 sec |
| Mean latency/state | 10.914 sec | 0.861 sec |
| Peak GPU memory | 29.426 GiB | 18.620 GiB |
| Forward workspace | 11.867 GiB | 1.062 GiB |
| Throughput | 0.0916 states/s | 1.1611 states/s |
Bounded representations provide a 12.67× extraction speedup, 36.72% lower peak memory, and 91.05% less forward workspace. This speedup concerns feature extraction; E2E latency is reported separately above.
Local feature-computation times on external benchmarks:
| Benchmark | Valid timing N | Mean 9B CUDA sec/task |
|---|---|---|
| SWE-bench Verified | 100 | 13.2817 |
| τ-bench | 165 | 2.2544 |
| Terminal-Bench 2.0 | 89 | 10.6537 |
CUDA times measure active local computation. Bounded representations, non-autoregressive classification, and execution gates control auxiliary overhead. Thank you for helping us separately report offline annotation cost, online token usage, local computation, and complete-task latency.
Question 1: How do 93.6% KEEP, online READY, and actual compression relate?
Approximately 93.6% of supervision interaction-state pairs are KEEP. How do online KEEP/READY proportions change? Please report these proportions, the fraction of interactions summarized, and corresponding token volumes to explain the savings.
Thank you for requesting clearer accounting. The original supervision is approximately 93.6% KEEP and 6.4% READY. Offline pairs, online interactions, and committed spans use different counting units; we report them separately.
3.1 Independent offline threshold evaluation
The final Router uses Weighted BCE () and frozen Qwen3.5-9B Layer 32 features. Its independent test set contains 110 trajectories and 3,732 interaction-state pairs.
This set deliberately samples trajectories with more READY opportunities to examine READY recognition. Its label distribution does not represent the original 244,526-pair supervision set.
| Threshold | Test pairs N | Precision | Recall | Predicted READY |
|---|---|---|---|---|
| 0.35 | 3,732 | 70.2368% | 79.9401% | 71.3023% |
| 0.40 | 3,732 | 72.7184% | 63.7297% | 54.9035% |
| 0.50 | 3,732 | 80.7420% | 39.0932% | 30.3323% |
| 0.55 | 3,732 | 83.5821% | 28.7425% | 21.5434% |
| 0.60 | 3,732 | 85.4130% | 20.7870% | 15.2465% |
| 0.65 | 3,732 | 87.9177% | 14.6279% | 10.4234% |
| 0.70 | 3,732 | 90.1099% | 10.5218% | 7.3151% |
| 0.75 | 3,732 | 92.7273% | 6.5441% | 4.4212% |
| 0.80 | 3,732 | 95.0617% | 3.2934% | 2.1704% |
The 15.2465% is the offline test-set prediction rate, not the online READY proportion.
Online Compression and Terminology
3.2 Online READY predictions and successful commitments
Online READY steps count distinct historical interactions predicted READY at least once anywhere in a complete trajectory. An interaction predicted READY at multiple checkpoints is counted once.
| Run (τ=0.60) | Tasks N | Mean READY steps/task | Mean committed spans/task |
|---|---|---|---|
| SWE-bench | 100 | 23.80 | 0.86 |
| τ-bench | 165 | 12.59 | 0.5273 |
| Terminal-Bench | 89 | 35.60 | 1.0787 |
| Full260 | 260 | 26.15 | 1.2308 |
READY candidates must also pass contiguous-span, minimum-source-token, and summary-validity gates, so candidate and commitment counts differ. Although τ-bench histories are generally shorter, some contain eligible intervals and are compressed.
In Full260, approximately 35.51% of online READY candidate interactions enter successfully committed compression spans. The denominator is READY candidates, rather than all historical interactions.
3.3 Commitments and token volumes by domain
| Domain | Tasks N | Successful events | Mean events/task | Previously counted content/tool direct reduction | Summary Input + Output |
|---|---|---|---|---|---|
| Code | 80 | 88 | 1.10 | 36,943 | 77,381 |
| Office | 50 | 23 | 0.46 | 23,868 | 43,653 |
| Security | 60 | 118 | 1.97 | 174,299 | 267,966 |
| Web | 70 | 91 | 1.30 | 103,243 | 165,664 |
| Overall | 260 | 320 | 1.2308 | 338,353 | 554,664 |
Compression-event distribution per task:
| Domain | Tasks N | 0 events | 1 event | 2 events | ≥3 events | Total committed spans |
|---|---|---|---|---|---|---|
| Code | 80 | 40 | 20 | 10 | 10 | 88 |
| Office | 50 | 34 | 11 | 3 | 2 | 23 |
| Security | 60 | 20 | 15 | 10 | 15 | 118 |
| Web | 70 | 35 | 15 | 8 | 12 | 91 |
| Overall | 260 | 129 | 61 | 31 | 39 | 320 |
The earlier 338,353-token count incompletely covered separate reasoning fields. Including them gives:
| Supplementary item | Full260 total | Per-task mean |
|---|---|---|
| Previously counted content/tool direct reduction | 338,353 | 1,301.36 |
| Reasoning-field tokens | 20,038,720 | 77,072.00 |
| Complete-history direct removal | 20,377,073 | 78,373.36 |
| Summary Input + Output | 554,664 | 2,133.32 |
Memory replacement also reduces repeated input in subsequent requests, so one-time removal and cumulative complete-task savings are different quantities. The revision will distinguish supervision labels, offline predictions, online candidates, commitments, direct removal, and cumulative usage. Thank you for helping us clarify these relationships.
Question 2: Define KEEP and READY at their first appearance
KEEP and READY appear in the Introduction before being defined. Could you define them at their first appearance?
Thank you for identifying this issue so carefully. The manuscript was written by the authors themselves and was not generated by AI. We are firmly committed to not using AI to directly generate papers. Nevertheless, during writing and proofreading, we overlooked defining these terms at their first appearance, increasing the reader's burden. We sincerely apologize. We will add the definitions immediately upon first use in the Introduction and check terminology and cross-references throughout. Thank you for your careful review and professional guidance in improving the paper's clarity and rigor.
The first-use definitions will be:
- KEEP: At the current checkpoint, the historical interaction still requires its original details and is not yet ready for replacement by a summary.
- READY: At the current checkpoint, the history prefix contains sufficient supporting evidence to replace the interaction's original details with an accurate summary while retaining information needed for subsequent execution.
We will immediately clarify that READY does not mean immediate summarization. Commitment additionally requires a sufficiently long contiguous span, minimum source length, summary validity, and a shorter resulting history.
Thank you sincerely for recognizing the research idea and for your specific guidance on supervision reliability, evaluation scope, system cost, and accounting. Your careful review helped us identify and improve reporting gaps and clarify the evidence and scope of the method. We deeply appreciate the time and care you have devoted to understanding and strengthening this work.
- Rating
- 3/4(+1)
- Confidence
- 3/4(−1)
- Soundness
- 2/3
- Presentation
- 2/3
- Informativeness
- 2/3
Read review
Summary
This paper studies context compression for long-horizon agents. The main point is that whether a past step can be summarized depends on the agent's current status and progress in a task. For example, an error log matter while the agent is debugging, but not after the bug is found. The authors use an LLM to label each past step at each later point in time; this label says whether it can be safely summarized at that point. Then they train a small classifier on hidden states of a frozen LLM to predict these labels during the run. When enough neighboring steps are predicted safe, they are replaced by one summary. The results are pretty good. For example, on WorkBuddyBench, the paper reports about half the tokens used with similar task reward and similar gains with other models.
Strengths
+ very timely research question in the domain of AI agents: whether context should be compressed or not
+ the design is reasonable (LLM-based labeler + training a small classifier for prediction) and is easy to follow
+ one insight from the paper that is quite solid: whether certain context can be compressed depends a lot on timing; some context can be important now but not later; i appreciate the authors bringing this up and using it as a design motivation
+ end-to-end results are good especially table 3
Weaknesses
- i am not sure if the reported gains are from the method itself: to be specific, the method summarizes a few thousand tokens per task, but the token saving report averages to more than a million per task? (one example is table A7) i think there is something deeper here: maybe the agent is able to execute the task better with a different path (that is also more token-efficient) after compression, which yields more gain? it is unclear to me what is the true source of end-to-end token saving.
- significance-related issue: very commonly seen in agent research. for the authors' experiments, each setting is run once. it is also unclear if Eval40 is a legit and statistically significant subset that can endorse the design choices.
- i don't quite get the motivation of the router: it seems quite heavy in terms of compute, but does not improve the system much if we look at 5.2?
Questions for the authors
See "weaknesses". I am always ready to be convinced.
6 comments
Response to Reviewer XFaZ (1/3): Sources of Token Savings
Dear Reviewer,
Thank you sincerely for your time and careful review, and for recognizing the practical value of our research question, state-conditioned design, and end-to-end evaluation. Your comments on token attribution, repeatability, and Router necessity helped us refine the accounting, add controls, and clarify the scope of our conclusions. We respond point by point below.
Weakness 1: Why do small summaries correspond to million-token cumulative savings?
I am unsure whether the reported gains come from the method itself. Only a few thousand tokens are summarized per task, yet the reported savings exceed one million tokens per task, e.g., in Table A7. Does compression lead the agent to a different execution path that improves performance while using fewer tokens? The source of the end-to-end savings is unclear.
Thank you for identifying this key issue. Our audit found that the earlier direct-reduction count covered message content and tool-interaction fields but incompletely included separate reasoning and reasoning_content fields. A successful Memory commit replaces the entire original message interval, so these reasoning fields also leave the subsequent effective history. We have supplemented the accounting and distinguish the following effects.
1.1 Complete-history removal and reduced repeated input
Full260 contains 320 successful compression events, averaging 62,621 reasoning tokens per event, or 20,038,720 in total. Adding the previously counted 338,353 tokens gives 20,377,073 tokens of one-time complete-history removal.
| Item | Full260 total | Per-task mean |
|---|---|---|
| Previously counted direct reduction in content/tool fields | 338,353 | 1,301.36 |
| Reasoning-field tokens | 20,038,720 | 77,072.00 |
| Complete-history direct removal | 20,377,073 | 78,373.36 |
| Summary Input + Output tokens | 554,664 | 2,133.32 |
These figures measure one-time removal at commitment. Memory continues to replace the original history in later requests, reducing repeated input; cumulative savings can therefore exceed the immediate reduction.
To examine this mechanism, we replayed fixed action trajectories for four Code tasks. We matched each Memory to its original source by message identity, expanded only that source, kept all other messages and observed actions unchanged, and counted serialized tokens with the frozen Qwen tokenizer.
| Metric | Tasks N | Qwen-serialized tokens/task |
|---|---|---|
| Immediate reduction at commitment | 4 | 6,991.00 |
| Repeated input avoided in later requests | 4 | 51,292.25 |
| Cumulative avoidance along the same observed action trajectory | 4 | 58,283.25 |
| Summarized source span | 4 | 9,523.00 |
| Inserted Memory | 4 | 2,532.00 |
With the action trajectory fixed, the mean immediate reduction was 6,991 tokens and cumulative avoidance was 58,283.25 tokens; approximately 88.01% came from reduced repetition in subsequent requests. This validates the accumulation mechanism. Its contribution to Full260 still requires event-level accounting using the corresponding request logs.
1.2 Potential changes to ReAct execution paths
Updating history may also affect later decisions. We do more than shorten history: we assess which interactions are ready for compression, preserve useful evidence, and remove details no longer needed while consolidating the retained information into a summary. This reduces context occupancy while keeping information needed later. Examples include lengthy contents of irrelevant files and unnecessary details of earlier trial-and-error attempts.
For example, an agent may fail with approach A, then identify the cause through approach B and tool feedback. Some exploratory details can then be summarized while retaining the failure cause, key feedback, and confirmed conclusions. This may affect tool selection, error recovery, repeated exploration, interaction counts, and termination.
We therefore evaluate context savings along fixed action trajectories separately from behavioral changes in closed-loop execution. The four-task replay examines the former; Full260 reports complete-task outcomes. Their respective contributions to Full260 have not yet been independently quantified. Thank you for helping us clarify the relationship between local history replacement and cumulative token changes.
Response to Reviewer XFaZ (2/3): Repeated Runs and Router Controls
Weakness 2: Single runs and insufficient statistical support from Eval40
Statistical significance is a concern. Each setting was run only once, and it is unclear whether Eval40 is a reasonable subset with sufficient statistical support for the design choices.
Thank you for highlighting experimental reliability. We added three independent seeds on the fixed Eval40 set. Each seed uses the same 40 tasks, giving 120 complete runs per method.
2.1 Three-seed results
| Seed | Base Reward | τ=0.60 Reward | Base tokens M/task | τ=0.60 tokens M/task |
|---|---|---|---|---|
| 17 | 0.6819 | 0.7215 | 1.8286 | 1.0744 |
| 31 | 0.6680 | 0.7085 | 1.9346 | 1.1278 |
| 53 | 0.6711 | 0.7181 | 1.8908 | 1.0864 |
| Mean | 0.6737 | 0.7160 | 1.8847 | 1.0962 |
All three seeds show higher mean Reward and lower Combined Tokens. The revision will clarify that Eval40 supports component and design comparisons on fixed tasks, while Full260 and external benchmarks assess performance across broader task settings.
2.2 External benchmarks
| Benchmark | Tasks N | Base Reward | STATECOMP Reward | Base Combined tokens/task | STATECOMP Combined tokens/task | Token savings |
|---|---|---|---|---|---|---|
| SWE-bench Verified | 100 | 84/100 | 86/100 | 1,364,732 | 839,798.58 | 38.46% |
| τ-bench | 165 | 113/165 | 112/165 | 97,701 | 90,971.73 | 6.89% |
| Terminal-Bench 2.0 | 89 | 48/89 | 52/89 | 1,010,511 | 573,879.81 | 43.21% |
SWE-bench and Terminal-Bench show both higher Reward and lower token usage; τ-bench shows a quality–usage trade-off.
These differences relate to interaction length, history accumulation, and tool-use patterns. Software repair and terminal tasks involve repeated reading, editing, testing, or debugging, with long histories carried into later requests. τ-bench interactions are typically shorter, leaving less replaceable history; some tasks may also fail to meet the contiguous-span or minimum-token gates.
Savings therefore depend jointly on READY predictions, eligible compression intervals, and subsequent history reuse. The supplementary results indicate greater savings opportunities in long-horizon, tool-intensive tasks and more limited gains in shorter tasks.
Weakness 3: Router necessity and computational cost
I do not fully understand the motivation for the Router. Its computational overhead seems substantial, while the improvements in Section 5.2 appear limited.
Thank you for this helpful suggestion. The Router judges whether history can be replaced by a summary at the current execution state. Older history may still contain essential constraints, whereas completed exploration may no longer need to be retained in full. Learned predictions select candidates, and execution gates determine whether a summary is committed.
3.1 Controlled comparisons with simple rules
All methods use the same tasks, acting model, and tool protocol. Recency and Random operate under comparable compression-commit budgets.
| Method | Router | Contiguous-span gate | Minimum-token gate | Purpose |
|---|---|---|---|---|
| Baseline | None | Off | Off | No-compression reference |
| Full STATECOMP | Learned | On | On | Complete method |
| Recency Router | Temporal heuristic | On | On | Learned Router contribution |
| Random Router | Random selection under a comparable commit budget | On | On | History-selection contribution |
| w/o Span Gate | Learned | Off | On | Contiguous merging contribution |
| w/o Token Gate | Learned | On | Off | Minimum source-length contribution |
The full configuration uses frozen Qwen3.5-9B Layer 32 features, Weighted BCE (w₁=10), and an online threshold of τ=0.60. A contiguous span must contain at least four complete interactions and 1,000 source tokens. Recency selects by temporal position; Random samples eligible candidates. Other gates remain identical.
Combined Tokens include Agent and summary Input + Output. E2E time additionally includes local feature extraction and Router forward computation. The outcome tables and cost measurements follow in Part 3.
Response to Reviewer XFaZ (3/3): Router Results and Computational Cost
3.1 Controlled comparisons: results
| Method | Reward (Mean±SD) | Combined tokens (M/task, Mean±SD) | Token savings | E2E sec/task |
|---|---|---|---|---|
| Baseline | 0.6737±0.2090 | 1.8847±2.2164 | — | 910.22 |
| Full STATECOMP | 0.7160±0.2459 | 1.0962±1.1001 | 41.84% | 892.13 |
| Recency Router | 0.6957±0.2376 | 1.1752±1.1567 | 37.64% | 914.68 |
| Random Router | 0.6840±0.2527 | 1.1665±1.1478 | 38.11% | 915.21 |
| w/o Span Gate | 0.6828±0.2735 | 0.9782±1.1639 | 48.10% | 928.44 |
| w/o Token Gate | 0.7065±0.2534 | 1.0821±1.0012 | 42.58% | 912.50 |
Reward by domain:
| Method | Code | Office | Security | Web | Overall |
|---|---|---|---|---|---|
| Baseline | 0.7474 | 0.8224 | 0.4797 | 0.6451 | 0.6737 |
| Full STATECOMP | 0.7805 | 0.8500 | 0.5156 | 0.7180 | 0.7160 |
| Recency Router | 0.7551 | 0.8318 | 0.4927 | 0.7032 | 0.6957 |
| Random Router | 0.7408 | 0.8190 | 0.4661 | 0.7101 | 0.6840 |
| w/o Span Gate | 0.7445 | 0.8134 | 0.4398 | 0.7335 | 0.6828 |
| w/o Token Gate | 0.7733 | 0.8405 | 0.5002 | 0.7120 | 0.7065 |
Full STATECOMP achieves higher mean Reward and lower Combined Tokens than Recency and Random, supporting the practical value of learned history selection. Removing the Span Gate further reduces tokens but lowers Reward and increases latency. Removing the Token Gate slightly reduces tokens, but additional summary calls may offset part of the efficiency benefit. These results support evaluating history selection and execution gates together.
3.2 Feature extraction and local computation
STATECOMP combines a frozen feature extractor with a lightweight decision head: Qwen3.5-9B Layer 32 provides 12,288-dimensional features, and a head with hidden width 2,048 outputs READY probabilities without generating natural-language judgments.
Paired measurements of bounded history representations are:
| Metric | Full history | Bounded representation |
|---|---|---|
| Paired feature-extraction time | 76.40 sec | 6.03 sec |
| Mean latency/state | 10.914 sec | 0.861 sec |
| Peak GPU memory | 29.426 GiB | 18.620 GiB |
| Forward workspace | 11.867 GiB | 1.062 GiB |
| Throughput | 0.0916 states/s | 1.1611 states/s |
Bounded representations provide a 12.67× feature-extraction speedup, reduce peak memory by 36.72%, and reduce forward workspace by 91.05%. This speedup concerns feature extraction; complete-system latency is reported separately through E2E measurements above.
The model can remain resident on a local GPU and be reused across states, without online training or token-by-token decoding. The Router incurs no additional generative API bill, but consumes GPU compute, memory, and residency resources, which are represented in the local and E2E measurements. The measured 18.620 GiB peak memory also provides a deployment resource reference.
Online commitment additionally requires that the READY score meet the threshold, adjacent candidates form a contiguous span of at least four interactions, the source contain at least 1,000 tokens, and summarization succeed with a shorter resulting history. Memory is committed only when all conditions hold; otherwise, the original history is retained. Committed Memory can be reused in later requests.
Thus, bounded representations, lightweight classification, and execution gates jointly control overhead. STATECOMP integrates as an external context-management module without accessing or modifying acting-model weights. The Router selects replaceable history according to the current state, reducing repeated input while retaining information needed for the task.
Thank you again for your careful review and professional guidance. Your comments prompted us to improve token accounting, add repeated runs, and use controlled comparisons to clarify the Router’s benefits and costs. We sincerely appreciate the time and care you have devoted to understanding and improving this work.
- Rating
- 3/4
- Confidence
- 3/4
- Soundness
- 2/3
- Presentation
- 3/3
- Informativeness
- 2/3
Read review
Summary
This paper proposes STATECOMP, a state-conditioned framework for deciding when historical interactions in a long-horizon agent can be safely replaced by summaries. Rather than relying on fixed windows, periodic schedules, or the relevance of an interaction in isolation, STATECOMP predicts whether each historical interaction is still needed in its original form given the current agent state. The method constructs KEEP/READY supervision using a two-stage annotation procedure, trains an imbalance-aware router on hidden representations from a frozen language model, and uses a bounded state representation to reduce the cost of evaluating long histories. Adjacent READY interactions are grouped into spans and summarized only when execution gates indicate that the rewrite is worthwhile. On WorkBuddyBench's 260 tasks, the method reduces agent-plus-summary tokens from 698.17M to 333.24M (52.27%) while mean reward changes from 0.6987 to 0.7026. Additional Eval40 and cross-model experiments investigate the quality/cost trade-off.
Strengths
- The paper identifies a useful decision point in context management. Selecting information to compress and deciding when it has become safe to replace are related but distinct problems. Conditioning readiness on the current agent state is a reasonable formulation, particularly for histories in which the significance of an interaction changes as a task progresses.
- The system considers the cost of actually executing compression. The router does not automatically trigger a summary for every positive prediction: span-size and token gates help avoid spending more tokens on summarization than the rewrite saves. The bounded representation also directly addresses the overhead of scoring long histories.
- The reported token reduction is substantial on the main benchmark. On WorkBuddyBench, STATECOMP cuts total agent and summary tokens by 52.27% while keeping aggregate reward close to the baseline. The paper reports results across Code, Office, Security, and Web rather than relying on a single task category.
- The paper reports useful implementation details and cross-model tests. The grouped trajectory split helps avoid leakage between pairs from the same trajectory, and the runtime/memory measurements make the representation-efficiency claim more concrete.
Weaknesses
- The readiness router appears to operate at a very conservative point, and the practical implications are not fully characterized. The paper reports 72.22% external precision at only 0.11% recall for one selective configuration. This may be an intentional choice to avoid destructive compression, but it raises a central question: how much of the observed 52.27% token reduction is attributable to the learned router versus span aggregation, execution thresholds, or other parts of the pipeline? The paper would be stronger with a more complete precision–recall–cost curve and end-to-end results across operating points.
- The strongest end-to-end evidence is concentrated in one benchmark and one acting model. WorkBuddyBench provides useful domain diversity, but the headline 260-task result uses DeepSeek-V4-Flash. Eval40 and cross-model results help, yet they are smaller fixed subsets. It remains unclear how robust the gains are across longer trajectories, different interaction protocols, and independently developed agent systems.
- The quality gains are small and domain-dependent. The average reward rises from 0.6987 to 0.7026, with Security slightly decreasing. The paper appropriately emphasizes efficiency, but the evidence supports “maintains task performance while reducing tokens” more clearly than a general claim that state-conditioned compression improves task quality. Uncertainty estimates or repeated runs would help determine whether small reward differences are meaningful.
- The annotation procedure and its transferability deserve more analysis. KEEP/READY labels are central to training the router. The paper describes a two-stage procedure, but the review would benefit from a clearer account of annotation cost, inter-annotator or judge consistency (if applicable), and sensitivity to the labeling rules. Since the target is semantic replaceability rather than ordinary relevance, errors in the annotation protocol could directly limit generalization.
- Token savings are not equivalent to total serving-cost or latency savings. The paper separately reports representation-extraction runtime, but the end-to-end cost also includes router inference, summary generation, cache effects, and the consequences of changed agent trajectories. A consolidated deployment accounting would make the practical claim more convincing.
Questions for the authors
- Can you report end-to-end token and reward results over a range of router thresholds, including the corresponding precision, recall, number of committed spans, and summarization overhead?
- How much of the token reduction remains if the router is replaced by a simple heuristic or oracle readiness selector, and how much is due to the span/token execution gates?
- Can you provide repeated-run confidence intervals or significance tests for the WorkBuddyBench and Eval40 reward differences, particularly for the Security domain?
- What is the cost and reliability of constructing KEEP/READY supervision, and how sensitive are the results to alternative annotation or labeling rules?
- Can you report total end-to-end latency and monetary cost—including representation extraction, routing, summary calls, and cache effects—under a realistic serving configuration?
- How well does the router transfer to a new acting model or task domain without relabeling or retraining?
8 comments
Router and compression statistics
Dear Reviewer,
We sincerely thank you for the time and care you devoted to reviewing our work. We especially appreciate your recognition of state-conditioned readiness, execution gates, and bounded representations. Your thoughtful suggestions on operating points, component contributions, statistical reliability, supervision, and system costs have helped us improve our analysis and reporting. We respond to the five weaknesses first, followed by the six questions.
Weakness 1: The router appears conservative, and compression frequency and token-savings attribution are insufficiently characterized.
Thank you for identifying this issue. The previously reported precision of 72.222% and recall of 0.111% came from an early weighted-BCE configuration (). We apologize for insufficiently distinguishing it from the final online controller, which uses :
| Item | Setting |
|---|---|
| Representation model | Frozen Qwen3.5-9B |
| Feature layer | Layer 32 |
| Router objective | Weighted BCE |
| READY positive weight | |
| Router input dimension | 12,288 |
| Hidden width | 2,048 |
| Online threshold | 0.60 |
| Span threshold | 3; at least 4 complete interactions |
| Minimum source length | 1,000 tokens |
Adjacent READY interactions are grouped into contiguous spans. KEEP interactions, protected messages, and committed summaries interrupt candidate spans. After satisfying the span and token thresholds, a replacement must also preserve request-protocol validity and actually shorten the effective history before commitment.
Offline results for the final controller.
The evaluation contains 110 independent test trajectories and 3,732 interaction-state pairs. It deliberately includes more opportunities for READY judgments to assess READY recognition; its label distribution is reported separately from the original supervision set. The latter contains 244,526 pairs, including 15,633 READY pairs (6.3932%).
| Threshold | Test pairs | Precision | Recall | Predicted READY |
|---|---|---|---|---|
| 0.35 | 3,732 | 70.2368% | 79.9401% | 71.3023% |
| 0.40 | 3,732 | 72.7184% | 63.7297% | 54.9035% |
| 0.50 | 3,732 | 80.7420% | 39.0932% | 30.3323% |
| 0.55 | 3,732 | 83.5821% | 28.7425% | 21.5434% |
| 0.60 | 3,732 | 85.4130% | 20.7870% | 15.2465% |
| 0.65 | 3,732 | 87.9177% | 14.6279% | 10.4234% |
| 0.70 | 3,732 | 90.1099% | 10.5218% | 7.3151% |
| 0.75 | 3,732 | 92.7273% | 6.5441% | 4.4212% |
| 0.80 | 3,732 | 95.0617% | 3.2934% | 2.1704% |
At the default threshold, precision is 85.4130% and recall is 20.7870%. Higher thresholds select histories with stronger READY evidence, increasing precision while reducing recall. The default setting combines this operating point with execution gates to balance compression coverage and information retention.
Online predictions and actual commitments.
We count distinct historical interactions predicted READY at least once during a complete trajectory; repeated predictions for the same interaction count once. All settings below use .
| Evaluation | Tasks | Distinct interactions ever READY/task | Committed spans/task |
|---|---|---|---|
| SWE-bench Verified | 100 | 23.80 | 0.86 |
| τ-bench | 165 | 12.59 | 0.5273 |
| Terminal-Bench 2.0 | 89 | 35.60 | 1.0787 |
| Full260 | 260 | 26.15 | 1.2308 |
READY predictions pass through span aggregation, token thresholds, and summary checks before commitment. In Full260, approximately 35.51% of online READY candidate interactions enter committed spans.
The domain-level statistics are:
| Domain | Tasks | Compression events | Events/task | Content/tool tokens directly removed | Summary input + output tokens |
|---|---|---|---|---|---|
| Code | 80 | 88 | 1.10 | 36,943 | 77,381 |
| Office | 50 | 23 | 0.46 | 23,868 | 43,653 |
| Security | 60 | 118 | 1.97 | 174,299 | 267,966 |
| Web | 70 | 91 | 1.30 | 103,243 | 165,664 |
| Overall | 260 | 320 | 1.2308 | 338,353 | 554,664 |
The earlier count of 338,353 directly removed tokens covered content and tool fields. Including the separate reasoning fields gives:
| Measure | Full260 total | Mean/task |
|---|---|---|
| Content/tool tokens directly removed | 338,353 | 1,301.36 |
| Reasoning-field tokens removed | 20,038,720 | 77,072.00 |
| Complete-history tokens directly removed | 20,377,073 | 78,373.36 |
| Summary input + output tokens | 554,664 | 2,133.32 |
The 320 events involve a reported mean of 62,621 reasoning tokens per event, totaling 20,038,720. Complete-history removal measures the one-time change at commitment; savings from repeated inputs in later requests are analyzed separately.
Compression distribution and Weaknesses 2–5
Weakness 1 (continued): compression-count distribution.
The distribution of compression counts per task is:
| Domain | Tasks | 0 compressions | 1 | 2 | 3 or more | Total committed spans |
|---|---|---|---|---|---|---|
| Code | 80 | 40 | 20 | 10 | 10 | 88 |
| Office | 50 | 34 | 11 | 3 | 2 | 23 |
| Security | 60 | 20 | 15 | 10 | 15 | 118 |
| Web | 70 | 35 | 15 | 8 | 12 | 91 |
| Overall | 260 | 129 | 61 | 31 | 39 | 320 |
| Measure | Result |
|---|---|
| No compression | 129/260 (49.62%) |
| At least one compression | 131/260 (50.38%) |
| Exactly one | 61/260 (23.46%) |
| Exactly two | 31/260 (11.92%) |
| Three or more | 39/260 (15.00%) |
| Total committed spans | 320 |
| Mean compressions/task | 1.2308 |
| Mean among tasks with compression | 2.4427 |
These results show that compression opportunities depend on task state: some tasks retain the original history throughout, while others undergo one or more replacements. End-to-end operating points, savings mechanisms, and component ablations are detailed in Questions 1 and 2.
Weakness 2: The strongest evidence is concentrated in one benchmark and acting model, leaving transfer to other environments unclear.
Thank you for highlighting the evaluation scope. We extended evaluation to software repair, interactive tool use, and terminal operations:
| Benchmark | Tasks | Base outcome | STATECOMP outcome | Base combined tokens/task | STATECOMP combined tokens/task | Savings |
|---|---|---|---|---|---|---|
| SWE-bench Verified | 100 | 84/100 | 86/100 | 1,364,732 | 839,798.58 | 38.46% |
| τ-bench | 165 | 113/165 | 112/165 | 97,701 | 90,971.73 | 6.89% |
| Terminal-Bench 2.0 | 89 | 48/89 | 52/89 | 1,010,511 | 573,879.81 | 43.21% |
All three benchmarks directly reuse the same final router checkpoint, without relabeling or retraining, and follow their native execution protocols.
SWE-bench and Terminal-Bench show improved task outcomes and reduced tokens. On τ-bench, token savings are smaller and one fewer task succeeds; we report these differences explicitly.
Software repair and terminal operations often involve repeated inspection, execution, and lengthy tool feedback, creating opportunities to avoid repeated historical inputs. History accumulation is more limited in our τ-bench evaluation, and some candidates do not satisfy the span and source-token gates. These task characteristics offer a possible explanation for the differences and motivate evaluating benefits in their context.
Weakness 3: Reward changes are small and domain-dependent, requiring uncertainty estimates or repeated runs.
Thank you for this suggestion. We provide paired task-bootstrap intervals for the single-seed Full260 and historical Eval40 records in Question 3.
The Full260 mean reward difference is +0.0039, while Security is −0.0045; both intervals cross zero. The revision will report token usage, mean performance, and domain differences, while distinguishing uncertainty across tasks from variation across independent runs.
Weakness 4: Annotation cost, consistency, and sensitivity to labeling rules require clarification.
Thank you for your careful attention to supervision reliability. We report an annotation cost of approximately USD 2,000 for 244,526 pairs, together with agreement between GPT-6 Sol and DeepSeek-V4.1-Flash on 30 sampled trajectories; details appear in Question 4.
We will also release the complete prompts for both stages, label-decision rules, and boundary-review procedure to clarify the supervision target of semantic replaceability and its reproducibility conditions.
Weakness 5: Token savings alone do not establish total deployment-cost or latency benefits.
Thank you for emphasizing this distinction. System costs include agent execution, summary calls, local representation extraction, router computation, and cache effects. We report end-to-end time and account for API usage and local GPU resources in Questions 2 and 5.
The frozen extractor and router perform forward computation without autoregressive text generation. Their costs primarily involve GPU computation, memory, and model residency. Bounded representations, model reuse, and execution gates reduce these overheads; a unified monetary total requires actual billing and deployment conditions.
Question 1—Operating points and interventions
Question 1: Can you report end-to-end tokens and reward across router thresholds, together with precision, recall, committed spans, and summarization overhead?
Thank you for suggesting that predictive performance be evaluated together with execution costs. Offline precision, recall, and predicted READY rates appear under Weakness 1.
Each threshold and component-ablation setting uses the fixed Eval40 task list with three independent seeds, totaling 120 task runs per setting, with the same acting model, tool environment, and scoring rules. Combined tokens include agent and summary input/output tokens. E2E time includes local representation computation.
| Setting | Reward ± SD | Combined M/task | Savings | Spans/task | E2E s/task |
|---|---|---|---|---|---|
| Baseline | 0.6737 ± 0.2090 | 1.8847 | — | 0 | 910.22 |
| τ = 0.50 | 0.7021 ± 0.2932 | 1.0442 | 44.60% | 1.208 | 878.83 |
| τ = 0.60 | 0.7160 ± 0.2459 | 1.0962 | 41.84% | 1.033 | 892.13 |
| τ = 0.70 | 0.7053 ± 0.2897 | 1.2520 | 33.57% | 0.708 | 903.03 |
| τ = 0.80 | 0.6889 ± 0.2340 | 1.4605 | 22.51% | 0.342 | 924.26 |
Domain-level results at the default threshold are:
| Domain | Base reward | τ = 0.60 reward | Base M/task | τ = 0.60 M/task | Savings |
|---|---|---|---|---|---|
| Code | 0.7474 | 0.7805 | 1.4414 | 1.0055 | 30.24% |
| Office | 0.8224 | 0.8500 | 1.0504 | 0.6803 | 35.23% |
| Security | 0.4797 | 0.5156 | 3.9717 | 1.7123 | 56.89% |
| Web | 0.6451 | 0.7180 | 1.0752 | 0.9866 | 8.24% |
| Overall | 0.6737 | 0.7160 | 1.8847 | 1.0962 | 41.84% |
Higher thresholds reduce committed spans and token savings. Among these operating points, has the highest mean reward; saves more tokens, while is slightly slower than the baseline. Operating points therefore need to be assessed jointly through performance, compression volume, and auxiliary overhead.
Complete-task tokens and summarization overhead.
Full260 separates agent and summary usage as follows:
| Method | Tasks | Agent tokens/task | Summary tokens/task | Combined tokens/task |
|---|---|---|---|---|
| Baseline | 260 | 2,685,258.58 | 0 | 2,685,258.58 |
| STATECOMP | 260 | 1,279,556.55 | 2,133.32 | 1,281,689.87 |
Combined tokens decrease by 1,403,568.71 per task (52.2694%). Total summary overhead is 554,664 tokens. Summarization is included in the combined counts across thresholds; the Full260 accounting additionally provides its separate contribution.
How history replacement produces cumulative savings.
A replacement removes the original interactions from subsequent effective histories, so savings can accumulate across later requests. On four Code tasks, we replayed fixed observed action sequences, matched memory entries to their source text by message identity, and kept other messages and observed actions unchanged. Counts use the frozen Qwen tokenizer:
| Measure | Tasks | Qwen-serialized tokens/task |
|---|---|---|
| Immediate reduction at commitment | 4 | 6,991.00 |
| Avoided repetition in later requests | 4 | 51,292.25 |
| Cumulative avoidance on the same observed action sequence | 4 | 58,283.25 |
| Source spans summarized | 4 | 9,523.00 |
| Inserted memory | 4 | 2,532.00 |
For these four tasks, approximately 88.01% of cumulative avoided tokens come from reduced repetition in later requests. This directly supports the memory-reuse mechanism within these four fixed action sequences.
Paired compression interventions from the same state.
We additionally sampled 10 tasks per domain, totaling 40. For each task, we saved the same environment state and history, launched compression and no-compression branches, and continued both to completion:
| Domain | No-compression reward | Compression reward | No-compression M/task | Compression M/task |
|---|---|---|---|---|
| Code | 0.7754 | 0.7930 | 1.3347 | 1.1065 |
| Office | 0.8388 | 0.8288 | 0.7496 | 0.6708 |
| Security | 0.4959 | 0.5014 | 2.3359 | 1.8356 |
| Web | 0.7102 | 0.7270 | 1.3388 | 1.2347 |
| Overall | 0.7051 | 0.7126 | 1.4398 | 1.2119 |
This intervention captures both history shortening and subsequent execution-path changes. Compression may affect tool selection, error recovery, repeated exploration, interaction counts, and termination. Summaries retain established conclusions, failure causes, and useful tool feedback so that this information remains available to later decisions.
Comments on the paper
1 comment
Summary
We would like to express our heartfelt appreciation to all three reviewers for their thorough evaluations, insightful comments, and constructive recommendations. We are also sincerely grateful to the Area Chair and Senior Area Chairs for the valuable time, attention, and dedication they have devoted to overseeing the review process.
Motivated by the reviewers' valuable feedback, we have substantially expanded our experimental evaluation, including router-threshold sensitivity analyses, controlled component ablations, repeated trials with statistical assessments, annotation consistency studies, evaluations on additional benchmarks, and more detailed accounting of system-level costs. In addition to addressing the specific concerns raised, we have undertaken further same-state compression experiments and fixed-trajectory analyses to better understand historical information reuse. We have also provided more detailed examinations of online READY decisions, committed compression spans, and accumulated token savings over complete task trajectories. These additional experiments and analyses have not only allowed us to address the reviewers' questions more thoroughly and in greater depth, but have also provided further empirical evidence to strengthen our findings. Through these supplementary investigations, we hope to offer the reviewers and Area Chair a clearer, more transparent, and more comprehensive understanding of StateComp's research motivation, methodological design, operational mechanisms, and practical implications for long-horizon agents.
We are deeply thankful for the considerable effort, careful consideration, and academic expertise invested by everyone involved in reviewing our submission. Your thoughtful feedback has been invaluable in strengthening our experimental validation, refining the presentation of our findings, and helping us better understand the strengths and limitations of our approach. We greatly appreciate your generosity in sharing your time and expertise, and we will incorporate these valuable suggestions into the revised paper with great care.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Supervision Reliability and Generalization
Dear Reviewer,
Thank you sincerely for your careful review and recognition of state-conditioned history compression. Your comments helped us refine supervision, evaluation, costs, and compression reporting. We address your two weaknesses and two questions below.
Weakness 1: Reliability and generalizability of LLM supervision
Section 3.3 and Appendix A.2 describe the two-stage process, but model disclosure was insufficient. We apologize and provide the details below.
1.1 Annotation model and objective
GPT-6 Sol annotated the 244,526 interaction-state pairs. Each interaction is assessed in its current state: whether original details remain necessary or existing history supports replacement by an accurate summary.
We will disclose the model's full name, version, and inference settings, release both stages' full prompts, label rules, and boundary-review procedure, and reference the appendix.
1.2 Two-stage annotation
Stage 1: Independent checkpoint annotation. Historical interactions are assessed using task progress, observation complexity, anticipated next-subtask needs, remaining interaction value, and evidence already in the history prefix.
Records include rationales, evidence locations, initial KEEP/READY labels, and dependencies preventing compression. Checkpoints are judged independently without inheriting READY labels.
READY requires evidence already in the current prefix. Later interactions may reveal information loss and invalidate an earlier candidate boundary, but future information cannot establish that earlier compression was safe.
Stage 2: Cross-checkpoint boundary review. Initial judgments and original evidence for each interaction are reviewed jointly to identify the earliest boundary supported by existing history. Insufficient or uncertain evidence yields KEEP, rather than propagating the first READY judgment.
For interaction Si with boundary ti∗:
Without a supported boundary, ti∗=∞ and the interaction remains KEEP. READY depends on the current state and available evidence, rather than being a fixed interaction property.
1.3 Annotation cost and cross-model agreement
The 244,526-pair supervision set cost approximately USD 2,000, mainly for long-context inputs and two-stage annotation. This offline construction cost will be reported separately from online system costs.
We compared GPT-6 Sol and DeepSeek-V4.1-Flash annotations on 29,182 interaction-state pairs and 829 historical interactions from 30 trajectories. Pair-level agreement and Cohen’s κ were computed on pooled pairs; per-trajectory agreement was macro-averaged, and boundary agreement aggregated by interaction.
Agreement on the earliest compressible boundary:
These quantify cross-model label and boundary agreement. We will specify metric definitions, full prompts, label conditions, and boundary review to improve transparency and reproducibility.
1.4 Evaluation across task environments
Three external benchmarks cover software repair, interactive tool use, and terminal operations, each with its native execution protocol.
SWE-bench and Terminal-Bench show higher Reward and lower token usage. τ-bench generally has shorter interactions and less replaceable history, showing smaller savings and a quality–usage trade-off.
Annotation comparisons assess cross-model consistency; benchmarks assess cross-task execution. We will distinguish these to clarify how supervision relates to task performance. Thank you for your helpful suggestions.