Source-linked AI summary
When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compression
Mingxuan Wang, Fei Luo, Bo Wang, Guorun Yao, Yinglong Guo, Chao Ning, Hongyue Chen, Yanbiao Ma, Jungong Han
TL;DR
Long-horizon agents accumulate reasoning history even after actions have been taken and feedback observed, while removing that history can alter later interactions. ICLR compresses reasoning online using frozen proxy entropy while preserving actions, tool calls, and observations. Across long-horizon tasks, it improves reward while reducing token use; the paper further links reasoning’s replaceability to externalized task state.
Problem
In long-horizon agent tasks, accumulated reasoning raises context length and inference cost, but unlike static trace compression, removing it can change future actions and interaction trajectories.
Source: §1 · p. 1Method
ICLR is a training-free online method that uses frozen proxy entropy to compress reasoning blocks while preserving actions, tool calls, and observations.
Source: §1 · pp. 2–3Results
Reward rises from 0.699 to 0.718 while input, output, and cache read tokens fall by 25.5%, 14.4%, and 33.3%, respectively.
Source: §1 · p. 2Takeaways & Limitations
Historical reasoning appears more replaceable when task-relevant derived state has been externalized into reliable carriers such as code, files, tool outputs, or environmental feedback.
Source: §5 · p. 11The paper frames future reasoning necessity as a hypothesis dependent on the current agent state and whether task-relevant information has been externalized.
Source: §1 · p. 2
Abstract
from arXiv · showhide
Long horizon language model agents continually accumulate reasoning history, increasing context length and inference cost even after earlier decisions have been executed and observed. Unlike static Chain of Thought compression, removing historical reasoning can change future actions and the resulting interaction trajectory. We study when such reasoning can be safely forgotten. We propose Interaction Aware Compression for Long Horizon Reasoning (ICLR), a training free online method that ranks reasoning blocks using frozen proxy entropy while preserving actions, tool calls, and observations. On 260 WorkBuddyBench tasks, ICLR improves average reward from 0.699 to 0.718, while reducing input, output, and cache read tokens by 25.5%, 14.4%, and 33.3%, respectively. Ablations reveal trajectory amplification, where local reasoning deletion produces nonlinear changes in total computation by altering subsequent interaction. Representation probing, activation patching, and controlled trajectory analyses further suggest that historical reasoning becomes more replaceable once task relevant derived state has been reliably externalized into code, files, tool outputs, or environmental feedback. These results characterize agent reasoning as dynamic working state rather than permanent interaction history.
1 Introduction
The introduction presents ICLR as online reasoning compression for agents, where deleting history can change later interactions. It argues that reasoning’s future value depends on whether task-relevant state remains only in reasoning or has been externalized.
- The introduction frames reasoning utility as state-dependent: the most effective setting varies with task difficulty, and more reasoning does not consistently yield higher scores.Online interventions also show a nonmonotonic relation among reasoning removal, reward, and input reduction.Source: §1 · p. 1, Figure 1 · p. 2
- Unlike static trace editing, deleting an agent’s reasoning can change its next tool call, observation, and subsequent decisions.Compression therefore intervenes in a closed-loop decision process rather than evaluating a fixed final answer.Source: §1 · p. 2
- Across long-horizon agent tasks, ICLR raises reward from 0.699 to 0.718 while reducing input, output, and cache read tokens by 25.5%, 14.4%, and 33.3%.The method compresses reasoning online while preserving actions, tool calls, and observations.Source: §1 · pp. 2–3
- Ablations show that local reasoning deletion and total system computation are not proportional, because interventions can alter later decisions and token use.Removing all reasoning does not necessarily produce the shortest trajectory; the paper calls this effect trajectory amplification.Source: §1 · p. 2
- Probing and activation patching indicate that current hidden states contain information associated with later rederivation, additional reasoning, and replanning.Probing reaches AUROC 0.844; KL Repair rises from 0.047 at layer 4 to 0.978 at layer 31.Source: §1 · p. 2
- When derived task state remains only in reasoning, future behavioral risk is 67.3%, compared with 36.2% after that state is externalized.Controlled interventions also find that clearing reasoning after relevant code is written leaves the final score unchanged, while hiding environmental feedback prompts an additional interaction to recover information.Source: §1 · pp. 2–3
2 Related Work
Prior work compresses completed reasoning traces and manages long agent histories with context operations or external memory. This paper distinguishes its focus: whether reasoning remains necessary after its consequences have been observed in a changing interaction.
2.1 Efficient Reasoning and Chain of Thought Compression
- Reasoning-compression methods remove redundant steps to reduce explicit reasoning, but evaluate against a fixed downstream answer rather than evolving actions and observations.Step Entropy [9], CONCISE [11], and TokenSkip [12] identify low-contribution steps or tokens in completed generations.Source: §2.1 · p. 3
- In agent interactions, removing historical reasoning can change the next action, observation, and later decisions, so the objective is sustained effectiveness under repeated closed-loop compression.The relevant question is not only whether a compressed trace preserves the same answer.Source: §2.1 · pp. 3–4
2.2 Context Management and Memory for Language Model Agents
- Agent context-management approaches prune, summarize, or otherwise manage evolving histories, while memory systems preserve or recover information outside the immediate interaction window.Examples include ACON [4], PACE [5], MemGPT [16], and SAM [17].Source: §2.2 · p. 4
- This work asks whether reasoning that produced an action remains necessary after its consequences are observed, including when plans or conclusions move into code, files, tool outputs, or environmental feedback.The paper uses probing and activation interventions to examine future reasoning reuse and replaceability after externalization.Source: §2.2 · p. 4
3 Methodology
ICLR compresses reasoning online within the agent interaction loop, preserving external interaction records while modifying the history used by later requests. The methodology combines context-conditioned entropy pruning with analyses of future reasoning reuse and the effects of externalizing derived state.
3.1 Online Reasoning Compression
- ICLR edits persistent history before subsequent requests, preserving actions, tool calls, and observations while allowing deletions to alter later decisions and computation.The first request is uncompressed, and deleted reasoning is not restored.Source: §3.1 · p. 5
3.2 Entropy Guided and Context Conditioned Pruning
- The method partitions reasoning into blocks and removes low-entropy blocks scored in the accumulated context, while leaving actions, tool arguments, outputs, observations, and final answers unchanged.A fixed compression ratio supports consistent interventions, and block-based deletion makes realized token reduction vary across steps.Source: §3.2 · pp. 5–6
3.3 Future Necessity Probing
- A linear probe tests whether hidden states at the current context boundary predict later rederivation, additional reasoning, or explicit replanning, using nested task-level splits to limit task leakage.The probe asks whether the current representation contains information that generalizes across tasks.Source: §3.3 · p. 7
3.4 Mechanistic Interventions for Reasoning Persistence
- Activation patching replaces the deleted-history boundary representation with its full-history counterpart and measures recovery of the full-history next-token distribution.The patching intervention is performed on the frozen sensor model, not the online ICLR policy.Source: §3.4 · p. 7
- Controlled state interventions compare retaining or deleting recent reasoning, clearing it after relevant code is written, and hiding previously observed environmental feedback.Derived state means an intermediate plan, relation, constraint, synthesis, or task-specific conclusion; external carriers include code, files, tool outputs, and environmental feedback.Source: §3.4 · p. 8
4 Experiments
Across WorkBuddyBench experiments, ICLR improved aggregate reward, while ablations and trajectory analyses examined how compression changes computation and when externalized state makes history replaceable.
4 Experiments
- The full benchmark comprised 260 WorkBuddyBench tasks across Code, Office, Security, and Web, using DeepSeek V4 Flash as executor and frozen Qwen3.5 9B for entropy scoring.A fixed 80-task set, with 20 tasks per domain, was used for ablation analysis.Source: §4 · p. 8
4.1 Overall Performance
- Average reward increased from 0.699 to 0.718 on the complete benchmark, with 102 wins, 76 ties, and 82 losses.Table 2 reports full-benchmark system performance; the prose gives the reward and win/tie/loss totals.Source: §4.1 · p. 8, Table 2 · p. 9
4.2 Ablations and Trajectory Amplification
- On the fixed 80-task set, ICLR reached reward 0.738 versus baseline 0.627; Step Only Entropy scored 0.711 and deleting all thinking 0.718.Random deletion variants changed task performance, but none reached the reward of full-history entropy.Source: §4.2 · p. 10, Table 3 · p. 10
- Random 10% reasoning deletion reduced input 60.5%, versus 44.0% for Random 20%; local edits can alter calls and whole trajectories.The paper calls this trajectory amplification: changes to reasoning can propagate through tool selection, observations, repeated reasoning, recovery, and termination.Source: §4.2 · p. 10, Figure 3 · p. 10
4.3 Future Necessity Analysis
- The probe reached AUROC 0.844, AP 0.811, and balanced accuracy 0.760; patching Mean KL Repair rose from 0.047 at layer 4 to 0.978 at layer 31.The probe associates current representations with later rederivation, additional reasoning, and replanning; patching progressively restores the next-token distribution.Source: §4.3 · p. 11
4.4 State Externalization and Controlled Interventions
- Future behavioral risk was 67.3% when derived state remained only in reasoning versus 36.2% after externalization; clearing reasoning after writing code left the rule score at 0.759.The authors conclude that reasoning becomes more replaceable as relevant state is transferred to persistent artifacts or environmental feedback.Source: §4.4 · p. 11
5 Conclusion
The conclusion frames agent reasoning as dynamic working state: its usefulness changes as interaction proceeds and information moves into external carriers. The appendix formalizes information bounds, trajectory perturbation, external-state sufficiency, and token accounting, then details the online compression protocol.
5 Conclusion
- ICLR treats reasoning as dynamic working state whose value changes as task-relevant state moves into code, files, tool outputs, or environmental feedback.The conclusion also reports that online compression changes future decisions and trajectories.Source: §5 · p. 11
B.1 Notation and scope
- At a compression boundary, C precedes the completed reasoning, B is the ordered reasoning-block sequence, and U contains the completed step’s unchanged action, tool record, and observation.The notation also defines B−j as all blocks except Bj and B<j as the blocks preceding Bj.Source: §B.1 · p. 17
B.2 Residual information of a reasoning block
- A low-entropy reasoning block has limited residual information about a downstream target, and a fixed removed-block set is bounded by its conditional entropy.The appendix distinguishes this fixed-subset information structure from ICLR’s adaptive ranking of observed proxy scores.Source: §B.2 · p. 17, §B.3 · p. 18
B.4 Online trajectory perturbation
- Repeated local policy changes can accumulate across an interaction trajectory, providing a theoretical basis for trajectory amplification.The perturbation result concerns two policies interacting with the same environment over a finite horizon.Source: §B.4 · p. 18, Then the observable trajectory laws… · p. 19
B.5 A sufficient condition for forgetting externalized state
- When compressed and full-history policies share sufficient external state and identical next-action laws, they induce identical observable trajectories and terminal-score distributions.This is a sufficient condition for external state to replace discarded reasoning.Source: §B.5 · p. 19
B.6 Exact token accounting and trajectory amplification
- Whole-trajectory token savings depend on the induced interaction path as well as direct deletion from the current request.The token decomposition accounts for later input, output, and request-count changes.Source: §B.6 · pp. 19–20
C.1 Runtime settings
- If the frozen scorer exceeds its 42K-token limit, pruning is skipped rather than truncating the acting agent’s history.The acting model generates actions and reasoning; the frozen scorer supplies only the ranking signal and is not updated during evaluation.Source: §C.1 · p. 20
C.2 Reasoning extraction and entropy alignment
- Predictive entropy is averaged within each block for ranking; after the first request, rewritten history is used, with the lowest ⌊0.8N⌋ blocks replaced by [SKIP].Actions, tool arguments, outputs, observations, and final answers remain unchanged; controls distinguish wholesale deletion, random token removal, and step-only entropy scoring.Source: §C.2 · p. 20, §C.3 · p. 21, §C.4 · p. 21
D.1 Evaluation sets
The appendix distinguishes complete-task results from local representation and fixed-state analyses, defines token accounting, and reports task-level uncertainty for externalization analyses.
D.1 Evaluation sets
- Whole-task results measure end-to-end agent behavior, while representation and fixed-state analyses use local states sampled from trajectories.Each analysis is reported with its corresponding denominator.Source: §D.1 · p. 21
D.2 Metrics and token accounting
- Processed tokens in the main tables equal input plus output tokens; cache-read usage is reported separately, and task performance uses official WorkBuddyBench reward.Wins, ties, and losses compare the method and base system on the same benchmark tasks.Source: §D.2 · p. 22
D.3 Task level uncertainty
- Externalization-analysis confidence intervals resample complete tasks with replacement, keeping states from the same task grouped.The appendix reports the recorded task-level intervals.Source: §D.3 · p. 22
E.1 Full benchmark domain results
On the complete benchmark, aggregate reward rises despite mixed domain results; the appendix distinguishes that Full260 evaluation from the fixed Pilot40 comparison.
E.1 Full benchmark domain results
- 0.699 to 0.718 average reward, with the largest positive domain change in Security; Code, Office, and Web scores are lower than their base runs, and Code uses more input.Aggregate cache-read reduction is 33.28%.Source: Table 7 · p. 22, §E.1 · p. 22
E.2 Pilot40 precision
- Pilot40 is the fixed forty-task context-management comparison, whereas Full260 reports the complete benchmark evaluation.Table 8 records Pilot40 precision for ICLR, without a precision value in the supplied passage.Source: §E.2 · p. 22, Table 8 · p. 23
F Ablation Details
The ablations compare entropy-based selection with deletion controls, find nonmonotonic token effects from local interventions, and define the local-state probing target as later reasoning reuse.
F.1 Reward summary
- In the fixed 80-task ablation summary, ICLR has the highest reported average reward; Delete All Thinking also exceeds the displayed base average, while Step Only Entropy remains competitive but below full-history entropy.Source: Table 9 · p. 23, §F.1 · p. 23
F.2 Token reduction and trajectory amplification
- 60.53% input reduction for Random 10% versus 44.01% for Random 20%, illustrating nonmonotonic whole-trajectory effects from local deletion.The analysis relates this mismatch to changes in subsequent requests and induced trajectories.Source: Table 10 · p. 23, §F.2 · p. 24
G.1 Cohort and target
- The probing target records whether a later trajectory contains rederivation, additional reasoning, or explicit replanning; the unit is a compression-boundary sample, not a complete task.Multiple boundary samples may come from one task, so model selection and evaluation are separated at task level.Source: §G.1 · p. 24
G.2 Nested task level evaluation
The nested task-level probe evaluation tests whether a cross-task signal associated with later reasoning reuse is readable, while activation patching examines how full-history information is restored across model depth.
G.2 Nested task level evaluation
- The linear probe detects a readable cross-task signal associated with later reasoning reuse and serves as an analysis instrument for characterizing that signal.The nested evaluation keeps samples from the same task on one side of the outer split; preprocessing choices are selected using training tasks only.Source: §G.2 · p. 24, Table 12 · p. 24
H Activation Patching
- Activation-patching recovery increases toward later layers, indicating that full-history information is progressively expressed closer to the output readout.The figure describes replacement of deleted-history residuals with corresponding full-history residuals at the prompt boundary.Source: H Activation Patching · p. 25, Figure 4 · p. 25
H.1 Intervention and measurement
- The patching analysis uses 47 samples from 8 tasks on a frozen Qwen3.5 9B sensor and measures next-token distributions after replacing deleted-history residuals.KL Repair compares the patched distribution with the full-history and deleted-history conditions; values near one indicate strong restoration relative to deletion.Source: §H.1 · p. 25
H.2 Layerwise results
Layerwise patching repair rises from early to late layers, while the internalization–externalization analyses associate greater behavioral risk with derived state available only in reasoning.
H.2 Layerwise results
- Repair rises substantially from early to late layers, with Top 1 agreement increasing in the same direction; layer 32 is a positive control with repair equal to one.The final-layer control follows from patching the full-history residual before the same deterministic readout in both conditions.Source: §H.2 · p. 26, Table 13 · p. 26
I.1 Internalization and externalization gap
- Future behavioral risk is higher when relevant derived state remains available only in reasoning, and within-task contrasts preserve the same direction.The pooled values are descriptive; the accompanying tables group states by the internalization–externalization gap and report within-task contrasts.Source: Table 14 · p. 26, §I.1 · p. 27, Table 15 · p. 27
I.2 Controlled state interventions
Controlled interventions show that reasoning’s value depends on whether task-relevant state remains internal or has been externalized; observed environmental feedback can also serve as an external information carrier.
I.2 Controlled state interventions
- After relevant code is written to disk, clearing subsequent reasoning leaves the rule score unchanged at 0.7587, while deleting the latest reasoning causes a larger drop than keeping it.The controlled state interventions distinguish where useful task state is stored.Source: §I.2 · p. 27, Table 16 · p. 27
I.3 Environmental feedback intervention
- When observed stderr is hidden, the agent makes another Bash call and recovers the same error, whereas visible feedback lets it act directly on the observed state.The table compares the next action after retaining or hiding already-observed stderr.Source: §I.3 · p. 28, Table 17 · p. 28
J Motivation Figure Details
- Reasoning intensity and task score vary across difficulty levels, while local deletion strength and end-to-end savings vary across online interventions.Figure 1 panels compare task score and token use across reasoning settings and difficulty levels, and summarize reward and input reduction under online interventions.Source: J Motivation Figure Details · p. 28
K Main Text to Appendix Map
- The supplementary evidence is organized into system-level benchmark results, local mechanistic diagnostics, and mathematical analysis.The table maps major main-text claims to supplementary evidence.Source: K Main Text to Appendix Map · p. 28, Table 18 · p. 29
L Broader Impact and Future Directions
- ICLR selectively compresses reasoning while preserving actions, tool calls, and observations; future work includes aligning its frozen proxy scorer with the acting agent.The paper also identifies behavioral labels, additional models and longer interventions, and explicit modeling of sufficient external carriers as future directions.Source: L Broader Impact and Future Directions · p. 29
- Raw trajectory access should respect the confidentiality of prompts, credentials, tool outputs, and generated artifacts.Source: L Broader Impact and Future Directions · p. 29
M.1 Task set summary
The supplementary task-set records provide a composition summary and a reproducibility checklist for the experiments and analyses.
M.1 Task set summary
- The Full260, fixed 80-task ablation set, and Pilot40 comparison offer complementary views of benchmark performance, ablation behavior, and context-management comparison.The task-set composition is documented in the corresponding table.Source: §M.1 · p. 29, Table 19 · p. 30
M.2 Available records
- The reproducibility checklist records implementation, evaluation, representation analysis, intervention results, and theoretical material documented in the paper and appendix.Source: §M.2 · p. 30, Table 20 · p. 30
Related papers
This paper cites
- Self-Consistency Improves Chain of Thought Reasoning in Language Models2022
- Generative Agents: Interactive Simulacra of Human Behavior2023
- Efficient Streaming Language Models with Attention Sinks2023
- Training Large Language Models to Reason in a Continuous Latent Space2024
- Designing and Interpreting Probes with Control Tasks2019
- Learning to Compress Prompts with Gist Tokens2023