Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compression
Summary
This paper introduces Geometry Guided Evidence Preserving Memory (GEM), a training-free compressor for long-horizon agents that optimizes for preserved task evidence over geometric coverage, reducing token usage while maintaining performance.
View Cached Full Text
Cached at: 09/24/26, 09:23 AM
# Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compression
Source: [https://arxiv.org/html/2609.27332](https://arxiv.org/html/2609.27332)
Fei LuoAffiliation:TierFlow TeamBo WangAffiliation:TierFlow TeamGuorun YaoAffiliation:TierFlow TeamYinglong GuoAffiliation:TierFlow TeamChao NingAffiliation:TierFlow TeamHongyue ChenAffiliation:TierFlow TeamYanbiao MaAffiliation:Gaoling School of Artificial Intelligence, Renmin University of ChinaJungong HanAffiliation:Tsinghua University\*Corresponding authors\.
###### Abstract
Long horizon agents accumulate growing interaction histories that increase context and inference costs\. We find that geometric redundancy alone is an insufficient criterion for safe compression\. Although agent histories exhibit strong low dimensional structure, similar global geometry can preserve very different amounts of task evidence\. At identical retained block counts, evidence aware selection raises next action Top 3 retention from0\.310\.31to0\.690\.69, while centroid similarity remains0\.980\.98\. Controlled replacement further shows that action related information can be substantially altered while global geometric measures remain nearly unchanged\. Motivated by this gap between geometry and evidence, we introduceGeometry Guided Evidence Preserving Memory \(GEM\), a training free compressor that protects task and execution evidence before using geometric residuals to complete coverage\.GEMreduces mean combined token usage from2\.692\.69M to2\.112\.11M per task, a21\.4%21\.4\\%reduction, while maintaining comparable task reward\. Our results show that efficient agent history compression should optimize for preserved task evidence rather than geometric coverage alone\.
## 1 Introduction
Language\-model agents continuously accumulate task instructions, plans, tool calls, environment observations, errors, and intermediate artifacts throughout long\-horizon execution[36](https://arxiv.org/html/2609.27332#bib.bib23),[22](https://arxiv.org/html/2609.27332#bib.bib25),[16](https://arxiv.org/html/2609.27332#bib.bib3),[11](https://arxiv.org/html/2609.27332#bib.bib7)\. As the trajectory grows, repeatedly forwarding the full interaction history increases context and inference costs[14](https://arxiv.org/html/2609.27332#bib.bib13),[15](https://arxiv.org/html/2609.27332#bib.bib14),[16](https://arxiv.org/html/2609.27332#bib.bib3)\. Existing systems therefore summarize, edit, retrieve, or selectively retain historical information[26](https://arxiv.org/html/2609.27332#bib.bib1),[31](https://arxiv.org/html/2609.27332#bib.bib8),[19](https://arxiv.org/html/2609.27332#bib.bib2),[18](https://arxiv.org/html/2609.27332#bib.bib9)\. However, compression is not only a question of how much history can be removed\. A more fundamental question is which historical records can be discarded without removing information that remains necessary for subsequent execution\. This question is particularly difficult when redundant\-looking records encode different stages of task execution across prolonged sequences of interaction\.
A natural approach is to preserve the dominant geometry of the history representation\. Prior studies show that contextual representations often exhibit anisotropy and concentration along dominant directions[5](https://arxiv.org/html/2609.27332#bib.bib37),[24](https://arxiv.org/html/2609.27332#bib.bib38),[7](https://arxiv.org/html/2609.27332#bib.bib39)\. If most historical variation lies in a low\-dimensional subspace, a small subset of interaction blocks may appear sufficient to cover the trajectory\. Yet geometric redundancy does not imply execution redundancy\. A plan to modify a file, the command that performs the modification, and a later partial read may occupy similar semantic directions while establishing different facts about the task state\. A historical block may therefore contribute little new geometric variation while still carrying information required for the next action\. We refer to this mismatch as the gap between geometry and evidence\.
This distinction makes history compression inherently evidence sensitive\. Recent agent\-memory studies likewise emphasize that task state, execution dependencies, and persistent evidence can remain important across long interaction horizons[4](https://arxiv.org/html/2609.27332#bib.bib28),[39](https://arxiv.org/html/2609.27332#bib.bib29),[33](https://arxiv.org/html/2609.27332#bib.bib30),[11](https://arxiv.org/html/2609.27332#bib.bib7)\. Removing a geometrically redundant block is harmless only when its execution role has also become redundant\. In contrast, removing a low\-novelty record that contains a goal constraint, state transition, unresolved error, or source\-bearing observation may eliminate information that later actions still depend on\. Global representational coverage alone is therefore insufficient for deciding which blocks are safe to remove\. Compression should first identify evidence that remains consequential for execution and only then use geometric redundancy to decide which remaining records can be omitted\. This suggests that compression should jointly account for representational coverage and the execution role of retained records\.
Motivated by these observations, we introduceGeometry\-Guided Evidence\-Preserving Memory \(GEM\), a training\-free external compressor for long agent histories\.GEMfirst protects task and execution evidence, including recent context, goal\-related observations, execution\-state records, fresh errors, and source\-bearing information\. It then completes the retained set using geometric residuals so that uncovered representation directions are preserved without allowing low geometric novelty to override protected evidence\. Retained interaction blocks remain unchanged and are reconstructed in chronological order before being forwarded to the acting model through its standard request interface\. The main contributions are as follows:
- •Geometry and evidence gap in agent histories\.We distinguish global representational coverage from execution\-relevant evidence retention and show that similar geometric coverage can correspond to substantially different preservation of next\-action information\. Controlled replacement further isolates low\-energy evidence whose removal changes action\-related information while leaving global geometry nearly unchanged\.
- •Evidence\-first geometric compression\.We introduce a two\-stage selection principle that protects consequential task and execution evidence before applying geometric residual completion\. This prevents geometric redundancy from being treated as sufficient evidence that a historical interaction is safely removable during long\-horizon execution\.
- •Execution\-aware online history management\.We operate on complete interaction blocks, preserve call\-result structure, and maintain original message content and chronological order\. Online forwarding constraints limit each compression update while allowing newly activated evidence to remain available during subsequent execution\.
## 2 Related Work
### 2\.1 Context Management for Long Horizon Agents
Methods for controlling growing agent histories differ in what they remove and how they decide to remove it\. ReSum periodically summarizes interaction history, ACON improves compression guidelines using failure feedback, and PACE adjusts historical detail according to predicted relevance to the next action[16](https://arxiv.org/html/2609.27332#bib.bib3),[32](https://arxiv.org/html/2609.27332#bib.bib12)\. SelfCompact and Self\-GC give agents context management operations, while Sculptor supports summarizing, hiding, restoring, and searching historical information[19](https://arxiv.org/html/2609.27332#bib.bib2),[9](https://arxiv.org/html/2609.27332#bib.bib4),[18](https://arxiv.org/html/2609.27332#bib.bib9)\. Other recent approaches learn what to retain, decouple context management from the acting model, or expose agentic context\-management mechanisms[12](https://arxiv.org/html/2609.27332#bib.bib5),[38](https://arxiv.org/html/2609.27332#bib.bib6),[20](https://arxiv.org/html/2609.27332#bib.bib10)\.GEMinstead selects complete original interaction blocks\. It neither produces a replacement summary nor requires the acting agent to learn new memory operations\.
### 2\.2 Memory and Execution Evidence
Memory systems preserve information beyond the active context[25](https://arxiv.org/html/2609.27332#bib.bib21),[27](https://arxiv.org/html/2609.27332#bib.bib22),[29](https://arxiv.org/html/2609.27332#bib.bib24)\. MEM1 jointly learns reasoning and memory consolidation, SAM combines compact memory cues with access to raw history, and AdaCoM learns an external context manager for a frozen agent[39](https://arxiv.org/html/2609.27332#bib.bib29),[11](https://arxiv.org/html/2609.27332#bib.bib7)\. MAGE organizes history around execution dependencies and errors, and Proactive Memory Agent emphasizes that information present in a transcript may still fail to influence later behavior[4](https://arxiv.org/html/2609.27332#bib.bib28),[33](https://arxiv.org/html/2609.27332#bib.bib30)\. These studies motivate explicit treatment of task state\. Our focus is more specific: when original records share semantic content, their execution roles may still differ\.GEMprotects such evidence before completing coverage of the remaining history\.
### 2\.3 Task\-Aware Context Selection
Prompt compression methods such as LLMLingua\-2 learn which tokens to retain, while SWE\-Pruner and SWE\-Pruner Pro study selective retention of tool context[26](https://arxiv.org/html/2609.27332#bib.bib1),[31](https://arxiv.org/html/2609.27332#bib.bib8)\. Dynamic token pruning and long\-context evaluation further study which parts of a long context remain useful under fixed model interfaces[6](https://arxiv.org/html/2609.27332#bib.bib31),[10](https://arxiv.org/html/2609.27332#bib.bib32),[37](https://arxiv.org/html/2609.27332#bib.bib33)\. Retrieval systems likewise explore hierarchical or adaptive evidence selection[28](https://arxiv.org/html/2609.27332#bib.bib34),[13](https://arxiv.org/html/2609.27332#bib.bib35),[1](https://arxiv.org/html/2609.27332#bib.bib36)\. Work on context interference further shows that retaining relevant evidence is not sufficient when surrounding information impairs its use\. We study selection at the level of complete interaction blocks and distinguish coverage of history representations from information related to the next action\. The selector is training\-free and uses only the current task and available history without modifying the acting model\.
## 3 Geometry and Task Information in Agent Histories
We analyze history representations to distinguish redundancy from information needed for continued execution\. The recorded next action is used only for offline measurement and is never available to the deployed compressor\.
### 3\.1 History Representation
A removable interaction block contains an assistant tool\-call message and all of its corresponding tool results\. Calls and results are retained or removed together\. The system and task prefix is kept separately, and messages that cannot be safely assigned to complete blocks are not deleted\.
Prior analyses of representation spaces characterize anisotropy, dominant directions, and rank\-based concentration in contextual and sentence embeddings across modern neural representation models[5](https://arxiv.org/html/2609.27332#bib.bib37),[24](https://arxiv.org/html/2609.27332#bib.bib38),[7](https://arxiv.org/html/2609.27332#bib.bib39)\.
LetHt=\{o1,…,on\}H\_\{t\}=\\\{o\_\{1\},\\ldots,o\_\{n\}\\\}denote the available complete blocks\. A frozen encoder maps each block to a unit vectorxi∈ℝdx\_\{i\}\\in\\mathbb\{R\}^\{d\}\. WithX=\[x1,…,xn\]⊤X=\[x\_\{1\},\\ldots,x\_\{n\}\]^\{\\top\}and mean representationx¯\\bar\{x\}, we study centered variation through the following centered matrix decomposition
Xc=X−𝟏x¯⊤=UΣV⊤,Σ=diag\(σ1,…,σr\)\.X\_\{c\}=X\-\\mathbf\{1\}\\bar\{x\}^\{\\top\}=U\\Sigma V^\{\\top\},\\qquad\\Sigma=\\operatorname\{diag\}\(\\sigma\_\{1\},\\ldots,\\sigma\_\{r\}\)\.\(1\)
The singular values are ordered from largest to smallest\. Writingpj=σj2/∑kσk2p\_\{j\}=\\sigma\_\{j\}^\{2\}/\\sum\_\{k\}\\sigma\_\{k\}^\{2\}, we summarize concentration by using two complementary spectral statistics
reff\(Xc\)=exp\(−∑jpjlogpj\),rρ\(Xc\)=min\{k:∑j≤kpj≥ρ\}\.r\_\{\\mathrm\{eff\}\}\(X\_\{c\}\)=\\exp\\Bigl\(\-\\sum\_\{j\}p\_\{j\}\\log p\_\{j\}\\Bigr\),\\qquad r\_\{\\rho\}\(X\_\{c\}\)=\\min\\Bigl\\\{k:\\sum\_\{j\\leq k\}p\_\{j\}\\geq\\rho\\Bigr\\\}\.\(2\)
We also reportr¯ρ=rρ/n\\bar\{r\}\_\{\\rho\}=r\_\{\\rho\}/n\. The spectral analysis setsρ\\rhoto0\.900\.90\. Low effective dimension indicates concentration of variation, not that every block outside a dominant representation can be safely removed during subsequent downstream execution steps\.
### 3\.2 Coverage and Action\-Related Retention
LetS⊆\[n\]S\\subseteq\[n\]index a retained subset,x¯S\\bar\{x\}\_\{S\}be its mean, andQSQ\_\{S\}contain an orthonormal basis for its span\. Overall geometric coverage is measured by
C\(S\)=x¯S⊤x¯‖x¯S‖2‖x¯‖2,E\(S\)=1n∑i=1n‖QS⊤xi‖22\.C\(S\)=\\frac\{\\bar\{x\}\_\{S\}^\{\\top\}\\bar\{x\}\}\{\\\|\\bar\{x\}\_\{S\}\\\|\_\{2\}\\\|\\bar\{x\}\\\|\_\{2\}\},\\qquad E\(S\)=\\frac\{1\}\{n\}\\sum\_\{i=1\}^\{n\}\\\|Q\_\{S\}^\{\\top\}x\_\{i\}\\\|\_\{2\}^\{2\}\.\(3\)Centroid similarityC\(S\)C\(S\)measures preservation of the mean direction\. Captured energyE\(S\)E\(S\)measures average projection onto the retained span\. Unlike the centered spectral analysis,E\(S\)E\(S\)uses the original normalized block vectors, matching the online selector\.
For the unit representationaaof the recorded next action, we separately measure
Pa\(S\)=‖QS⊤a‖22,Ra\(S\)=Pa\(S\)Pa\(\[n\]\),T3\(S,a\)=\|S∩𝒩3\(a\)\|3\.P\_\{a\}\(S\)=\\\|Q\_\{S\}^\{\\top\}a\\\|\_\{2\}^\{2\},\\qquad R\_\{a\}\(S\)=\\frac\{P\_\{a\}\(S\)\}\{P\_\{a\}\(\[n\]\)\},\\qquad T\_\{3\}\(S;a\)=\\frac\{\|S\\cap\\mathcal\{N\}\_\{3\}\(a\)\|\}\{3\}\.\(4\)Here𝒩3\(a\)\\mathcal\{N\}\_\{3\}\(a\)contains the three history blocks most similar toaa\. Projection measures retention of the action direction; Top\-3 retention measures retention of the corresponding original blocks\. Neither is a task success rate\. Ratios are evaluated only when their denominators are defined\.
### 3\.3 Information Outside the Dominant Subspace
LetVhigh=\[v1,…,vrρ\]V\_\{\\mathrm\{high\}\}=\[v\_\{1\},\\ldots,v\_\{r\_\{\\rho\}\}\]andVlow=\[vrρ\+1,…,vr\]V\_\{\\mathrm\{low\}\}=\[v\_\{r\_\{\\rho\}\+1\},\\ldots,v\_\{r\}\]\. The latter directions account for at most a fraction1−ρ1\-\\rhoof centered history variation\. Their share of the action projection is
mlow\(a\)=‖Vlow⊤a‖22‖V⊤a‖22\.m\_\{\\mathrm\{low\}\}\(a\)=\\frac\{\\\|V\_\{\\mathrm\{low\}\}^\{\\top\}a\\\|\_\{2\}^\{2\}\}\{\\\|V^\{\\top\}a\\\|\_\{2\}^\{2\}\}\.\(5\)A large value indicates that action\-related information extends beyond the leading history directions\. It does not identify a removable block by itself\. For the controlled replacement analysis, we additionally measure the low\-energy fraction of each centered block and its alignment with the action in this subspace\. Appendix[C\.3](https://arxiv.org/html/2609.27332#A3.SS3)gives the complete definitions\.
## 4 Evidence Beyond the Dominant Subspace
We test whether agent histories contain non\-random representational redundancy, whether matching global geometry is sufficient to retain task evidence, and whether action\-related information can be selectively removed from low\-energy directions\.
### 4\.1 Histories Exhibit Structured Redundancy
The first analysis contains171171trajectories and4,7014\{,\}701complete blocks\. Each block is encoded independently using mean layer\-32 representations from a frozen Qwen3\.5\-9B encoder, producing4,0964\{,\}096\-dimensional vectors\. A second analysis uses the1,0241\{,\}024\-dimensional Qwen3\-Embedding\-8B representations used by the online selector on3232trajectories and1,1621\{,\}162block representations\. These are isolated block encodings or external selector embeddings, not hidden states of the acting model under its full history\.
For each trajectory, we compare the real representation matrix with two matched controls\. Independent circular feature shifts preserve every feature’s marginal values but disrupt alignment across blocks; a Gaussian control matches matrix shape\. Figure[1](https://arxiv.org/html/2609.27332#S4.F1)gives the visual comparison, while the exact centered effective\-rank andr90/nr\_\{90\}/nmedians are moved to Appendix[C](https://arxiv.org/html/2609.27332#A3), Table[C\.1](https://arxiv.org/html/2609.27332#A3.T1)\. Median effective ranks are8\.398\.39,16\.9916\.99, and19\.9619\.96for real, feature\-shift, and Gaussian isolated blocks, and14\.0414\.04,23\.5423\.54, and30\.0730\.07in selector space\. All171171isolated\-block comparisons and all3232selector\-space comparisons place the real history below its feature\-shift control in effective rank\. Across the four primary feature\-shift comparisons, the reported Holm\-adjusted values satisfyp≤1\.86×10−9p\\leq 1\.86\\times 10^\{\-9\}\.
Figure 1:Structured redundancy in agent histories\. Real histories are compared with feature\-shift and Gaussian controls\. The two representation spaces show the same concentration pattern\.The result establishes representational concentration, not safe removability\. Indeed, the uncentered greedy\-coverage analysis uses a median of six isolated blocks and ten selector blocks, corresponding to median retained fractions of0\.300\.30and0\.350\.35, respectively\. Those counts describe geometric coverage only; they do not imply that the omitted blocks are task\-irrelevant\.
### 4\.2 Coverage Does Not Determine Evidence Retention
We next compare geometry\-only and evidence\-constrained selection at identical retained block counts\. The dense replay contains650650checkpoints from3232trajectories, starting after1616complete blocks\. Individual trajectories contribute between22and7373checkpoints \(median15\.515\.5\), with130130,108108,161161, and251251checkpoints from Code, Office, Security, and Web, respectively\. The independent statistical units remain the3232trajectories\. At the same retained budget, evidence\-constrained selection preserves substantially more task information, particularly next\-action Top\-3 retention, while global geometry remains nearly unchanged\.
Table 1:Matched\-budget retention at 650 checkpoints\.Table[1](https://arxiv.org/html/2609.27332#S4.T1)reports the pooled same\-budget means\. At the same retained count, next\-action Top\-3 retention rises from0\.310\.31to0\.690\.69, while centroid similarity is unchanged at two\-decimal precision\. Action, final\-state, and goal projections show the same pattern: evidence retention improves without a comparably large shift in the global centroid measure\. The metric definitions and pooled\-checkpoint aggregation are detailed in Appendix[C\.2](https://arxiv.org/html/2609.27332#A3.SS2)\.
The dense numbers are descriptive pooled checkpoint means, with trajectories remaining the independent statistical units throughout the analysis\. The small mean centroid change alone does not establish statistical equivalence\.
Figure 2:Matched\-budget geometry and task information\. The trajectory\-level visualization contrasts evidence\-constrained and geometry\-only selection at the same retained block count\.
### 4\.3 Low\-Energy Evidence and Controlled Replacement
Figure 3:Next\-action information across ordered spectral bands\.Figure[3](https://arxiv.org/html/2609.27332#S4.F3)shows that next\-action information is not confined to the leading directions\. The plotted bands are descriptive rank bands, not equal\-energy intervals; the formal intervention instead uses directions after the90%90\\%centered\-energy cutoff\. A block can therefore be weakly represented by the dominant variation of the trajectory while still carrying evidence relevant to the next action\.
This observation motivates a controlled single\-block replacement\. The targeted condition removes a retained block whose low\-energy component is strongly aligned with the recorded next action\. The matched condition removes a low\-alignment block while matching representation similarity, recency, and serialized length\.
Table 2:Targeted block replacement effects\.Table[2](https://arxiv.org/html/2609.27332#S4.T2)shows the same dissociation in intervention form\. Targeted replacement reduces action projection by0\.030\.03and next\-action Top\-3 retention by0\.330\.33, whereas centroid similarity changes by only\+0\.00\+0\.00and captured energy by\+0\.00\+0\.00\. The intervention quantities and matching definition are given in Appendix[C\.3](https://arxiv.org/html/2609.27332#A3.SS3)for full reproducibility\.
The targeted replacement therefore removes substantially more action\-related information without a comparable change in the global geometric measures\. This is a representation\-level intervention rather than a rerun of the acting agent, so it supports the distinction between geometry and evidence without by itself establishing a causal task\-reward effect\.
Execution\-aware protection distinguishes plans, state\-changing operations, and subsequent observations, even when they refer to the same artifact\. Appendix[B\.2](https://arxiv.org/html/2609.27332#A2.SS2)details the rules that identify and preserve these different execution roles\.
## 5GEM: Geometry\-Guided Evidence\-Preserving Memory
GEMis a training\-free external compressor for complete interaction histories\. It separates records that should be protected from records selected for additional geometric coverage\. The encoder is frozen, and the acting model is accessed through its ordinary request interface\. No agent hidden states, parameter updates, or generated summaries are required\.
Figure 4:Overview ofGEM\. \(a\) A frozen encoder represents complete interaction blocks\. \(b\) Evidence constraints form the protected set𝒫t\\mathcal\{P\}\_\{t\}\. \(c\) Residual geometric completion adds blocks whose directions are not covered by the current selected span\. \(d\) Retained original blocks are reconstructed in chronological order and forwarded to the unchanged agent\. The online forwarding constraints are described in Section[5\.3](https://arxiv.org/html/2609.27332#S5.SS3)\.Figure[4](https://arxiv.org/html/2609.27332#S5.F4)summarizes the procedure\. The protected set seeds geometric completion; the two stages are not independent selectors\. Embeddings guide selection, while the original message records supply the forwarded context\. This separation keeps the selection mechanism lightweight while preserving the original interaction semantics seen by the acting model\.
### 5\.1 Evidence\-Constrained Selection
We distinguish the protected set𝒫t\\mathcal\{P\}\_\{t\}, the selected coreBtB\_\{t\}, and the final forwarded setStS\_\{t\}\. The core contains the evidence and additional directions identified by the selector\. The forwarded set may be larger because the online deletion guard retains additional original blocks\. This distinction separates the semantic selection objective from the request\-level constraints that determine what is ultimately forwarded to the acting model\.
For nominal core capacityKK, letKt=max\{K,\|𝒫t\|\}K\_\{t\}=\\max\\\{K,\|\\mathcal\{P\}\_\{t\}\|\\\}so that required evidence is not dropped when its count exceeds the nominal capacity\. The ideal core\-selection problem is
Bt⋆=argminB⊆\[n\]\|B\|s\.t\.𝒫t⊆B,E\(B\)≥τ,\|B\|≤Kt\.B\_\{t\}^\{\\star\}=\\operatorname\*\{arg\\,min\}\_\{B\\subseteq\[n\]\}\|B\|\\quad\\mathrm\{s\.t\.\}\\quad\\mathcal\{P\}\_\{t\}\\subseteq B,\\quad E\(B\)\\geq\\tau,\\quad\|B\|\\leq K\_\{t\}\.\(6\)We use a greedy procedure rather than solve this problem exactly\. It need not find the smallest core, and the coverage target can remain unmet when capacity or candidate directions are exhausted\. Importantly,KKis not a hard bound on the number of blocks forwarded to the agent\.
### 5\.2 Protecting Task and Execution Evidence
The protected set combines recent interactions, goal\-related observations, execution\-state evidence, fresh errors, and source records[4](https://arxiv.org/html/2609.27332#bib.bib28),[39](https://arxiv.org/html/2609.27332#bib.bib29),[33](https://arxiv.org/html/2609.27332#bib.bib30),[11](https://arxiv.org/html/2609.27332#bib.bib7)\. These groups are combined and deduplicated before geometric completion\. Recent blocks retain the immediate working context\. Goal selection keeps the eligible block most similar to the current task\. State selection uses the current state query, file paths, and supported operation patterns to identify relevant records of possible changes to task artifacts\. Together, these signals prioritize records whose execution role may remain important even when their semantic content is highly redundant\.
A plan, a write, and a read of the same file can differ in execution value even when they add little geometric novelty\. We therefore inspect explicit editing calls and supported Bash and Python write patterns, rather than relying only on tool names\. State candidates are organized by target path\. Error evidence is protected within a fixed age window, and source protection retains recent records from distinct sources when source\-like observations form a sufficient fraction of the history\.
These rules use only the available history and current goal\. A detected write is evidence of a possible mutation, not an independent verification that it succeeded\. Likewise, the expiration of an error record does not establish that the error was resolved\. The rules provide inexpensive protection cues, not a complete symbolic model of the environment\. Their recorded limits are listed in Appendix[B](https://arxiv.org/html/2609.27332#A2)\.
### 5\.3 Geometric Completion and Online Updates
Starting fromB=𝒫tB=\\mathcal\{P\}\_\{t\}, we construct an orthonormal basisQBQ\_\{B\}with modified Gram\-Schmidt orthogonalization\. For each eligible unselected block, we compute its residual and select the largest:
ri\(B\)=1−‖QB⊤xi‖22,i⋆=argmaxi∉Bri\(B\)\.r\_\{i\}\(B\)=1\-\\\|Q\_\{B\}^\{\\top\}x\_\{i\}\\\|\_\{2\}^\{2\},\\qquad i^\{\\star\}=\\operatorname\*\{arg\\,max\}\_\{i\\notin B\}r\_\{i\}\(B\)\.\(7\)We addi⋆i^\{\\star\}, update the basis, and continue until coverage, capacity, or candidate exhaustion terminates selection\. The residual therefore measures information not yet represented by the current geometric span, rather than relevance to the task itself\. Writing𝒢t=Bt∖𝒫t\\mathcal\{G\}\_\{t\}=B\_\{t\}\\setminus\\mathcal\{P\}\_\{t\}for the blocks added by geometric completion givesBt=𝒫t∪𝒢tB\_\{t\}=\\mathcal\{P\}\_\{t\}\\cup\\mathcal\{G\}\_\{t\}\. A protected record cannot be removed merely because it has a small residual\. The default coverage target isτ=0\.90\\tau=0\.90, and the nominal core capacity isK=16K=16\.
The online implementation limits how much of a request can be removed in one rewrite\. IfL\(S\)L\(S\)is the serialized length of the complete request containing blocksSS, the forwarded set satisfies
Bt⊆St⊆\[n\],L\(St\)≥\(1−δ\)L\(\[n\]\)\.B\_\{t\}\\subseteq S\_\{t\}\\subseteq\[n\],\\qquad L\(S\_\{t\}\)\\geq\(1\-\\delta\)L\(\[n\]\)\.\(8\)We setδ=0\.05\\delta=0\.05\. Starting from the full safe request, the implementation attempts to remove eligible blocks outside the core, prioritizing larger redundant blocks while respecting this guard\. Complete blocks are indivisible, so an event may remove nothing\. All retained messages remain unchanged and in chronological order\.
Requests with fewer than1616complete blocks are left unchanged\. Global selection occurs at the first eligible request, after a session or goal change, or after256256newly added blocks\. Between these events, the implementation keeps the previously forwarded set and appends new blocks and newly activated evidence\. This incremental policy avoids repeatedly reconstructing the retained history when no global reselection is required\. Storing the actual forwarded set prevents a later update from mistakenly removing blocks retained by the deletion guard\. The per\-request character limit is distinct from cumulative token savings over a task\. Appendix[A](https://arxiv.org/html/2609.27332#A1)gives the corresponding geometric derivations and forwarding properties\.
## 6 Experiments
### 6\.1 Experimental Setup
Table 3:WorkBuddyBench Full260 results\.SSdenotes mean reward×100\\times 100, andTTdenotes combined tokens per task \(M\)\. HigherSSand lowerTTare better\.WorkBuddyBench Full260[30](https://arxiv.org/html/2609.27332#bib.bib26)contains260260tasks across Code, Office, Security, and Web\. The main online evaluation uses DeepSeek\-V4\-Flash[34](https://arxiv.org/html/2609.27332#bib.bib11)at temperature zero, whileGEMuses frozen1,0241\{,\}024\-dimensional Qwen3\-Embedding\-8B representations\. Task quality is reported as*Score*=100×=100\\timesmean reward, and combined tokens include model input, model output, and embedding tokens\. Full260 is the primary end\-to\-end evaluation, while the fixed\-40 panel serves as a separate reference for common compression controls\. The same\-IDGEMslice from the Full260 carrier is marked separately in Table[4](https://arxiv.org/html/2609.27332#S6.T4)\. Appendix[E\.3](https://arxiv.org/html/2609.27332#A5.SS3)describes the reference\-panel protocol\.
### 6\.2 Full260 End\-to\-End Results
Across all260260tasks, mean combined usage decreases from2\.692\.69M to2\.112\.11M per task, a reduction of approximately21\.4%21\.4\\%\. Mean score changes from69\.8769\.87to70\.1870\.18\(reward×100\\times 100\)\. The average hides important domain variation\. Security shows the largest token decrease,5\.985\.98M to3\.953\.95M per task, while its mean reward changes from0\.480\.48to0\.500\.50\. Office also increases in mean reward while using fewer tokens, and Web keeps the same rounded reward while reducing tokens\. Code is the clearest boundary case: tokens change only slightly \(1\.371\.37M to1\.351\.35M\) and mean reward decreases by about0\.020\.02\. This pattern is consistent with code tasks being more sensitive to intermediate execution and file\-state evidence, but the domain means alone do not identify the causal mechanism\.
The token decomposition in Appendix[E\.2](https://arxiv.org/html/2609.27332#A5.SS2)shows that the net reduction comes primarily from a lower cached\-input volume\.GEMalso introduces embedding usage and increases uncached input, so its savings are not free; the cached\-input reduction must exceed these added costs\.
Table 4:Fixed\-40 context\-management reference\.SSis mean reward×100\\times 100andTTis combined tokens per task \(M\)\. Each domain contains ten tasks\.
### 6\.3 Fixed\-40 Context\-Management Reference Panel
Table[4](https://arxiv.org/html/2609.27332#S6.T4)reports reward and token use for the fixed\-40 reference panel in each domain\. The panel is useful for understanding how tradeoffs between reward and token use vary across Code, Office, Security, and Web, but it is*not*used as a matchedGEMcomparison because the availableGEMsame\-ID slice belongs to the Full260 carrier snapshot\. The fixed\-40 evaluation protocol is described in Appendix[E\.3](https://arxiv.org/html/2609.27332#A5.SS3)\.
The reference panel illustrates why compression should not be summarized by a single token ratio\. For example, periodic summarization atn=5n=5has a relatively high mean score in this panel but uses more tokens than the uncompressed base, whereas CoMem uses substantially fewer tokens with a much lower mean score\. The domain columns show that these operating points vary substantially across task families\.
### 6\.4 Online Ablation and Compression Strength
The online ablation uses2020formal\-valid tasks, five from each domain\. Random completion retains the same evidence rules and candidate pool but replaces largest\-residual completion with random selection\. Geometry\-only removes the evidence\-protection bundle while retaining residual selection and the online bookkeeping required for valid requests\.
Table 5:Online 20\-task ablation by domain\.SSis mean reward×100\\times 100andTTis combined tokens per task \(M\)\. Each domain contains five tasks\.On this batch, the full method scores60\.3960\.39versus60\.7560\.75for the base agent \(a0\.360\.36\-point difference\) while using about35\.30%35\.30\\%fewer combined tokens overall\. The domain columns make the tradeoff explicit: on the five Code tasksGEMraises reward while slightly increasing tokens, whereas on the five Security tasks it sharply reduces tokens but loses reward\. Relative to random completion and geometry\-only selection, the full method has the highest overall reward and the lowest overall token use in this batch\. The ablation therefore supports the combined selector without implying a universally monotone relationship between reward and compression\.
Figure 5:Compression strength\. \(a\) Next\-action Top\-3 retention at exact retained budgetsKK\. \(b\) Top\-3 retention and retained\-history ratio as the coverage thresholdτ\\tauincreases\. The exact\-KKsweep uses2828trajectories and525525common checkpoints; the coverage sweep uses3232trajectories and5959checkpoints\.Evidence\-constrained selection has higher Top\-3 retention than geometry\-only selection at every tested exact budgetK∈\[8,20\]K\\in\[8,20\]\. Increasingτ\\taufrom0\.850\.85to0\.950\.95raises the retained fraction from0\.380\.38to0\.530\.53and Top\-3 retention from0\.580\.58to0\.650\.65\. The defaultτ=0\.90\\tau=0\.90is therefore an operating point on an observed tradeoff between retention and evidence, not a claim of a universally optimal threshold\. The complete sweep values are listed in Appendix[D\.3](https://arxiv.org/html/2609.27332#A4.SS3)\.
## 7 Conclusion
Agent histories can be highly redundant in representation space while still containing low\-energy records that matter for continued execution\. This paper separates those two notions of importance\. Same\-budget selection and controlled replacement show that preserving dominant geometry does not guarantee preservation of next\-action evidence\.GEMconverts this observation into a simple external compressor: protect task and execution evidence first, then use geometric residuals to complete coverage\. It preserves original messages and leaves the acting model unchanged\. On WorkBuddyBench Full260, the reported operating point reduces mean combined tokens from2\.692\.69M to2\.112\.11M per task while maintaining a similar aggregate reward, with clear domain\-dependent tradeoffs\. The broader lesson is that repeated content can still be consequential evidence; effective history compression should model that distinction explicitly\.
### Reproducibility Statement
We provide the methodological definitions, selection algorithm, implementation settings, evaluation protocols, ablation configurations, and additional analyses required to reproduce the reported results in the main text and appendix\. The acting model and representation encoder remain frozen under the default setting, and all reported comparisons follow the evaluation and token\-accounting procedures described in the manuscript\.
### AI Use Statement
Generative AI tools assisted with code development, analysis scripts, figure and table preparation, and manuscript editing under author supervision\. All experimental results and scientific claims were reviewed and verified by the authors, who take responsibility for the final manuscript\.
## References
- Asaiet al\.\(2024\)A\. Asai, Z\. Wu, Y\. Wang, A\. Sil, and H\. HajishirziSelf\-rag: learning to retrieve, generate, and critique through self\-reflection\.InInternational conference on learning representations,Vol\.2024,pp\. 9112–9141\.Cited by:[§2\.3](https://arxiv.org/html/2609.27332#S2.SS3.p1.1)\.
- Baiet al\.\(2024\)Y\. Bai, X\. Lv, J\. Zhang, H\. Lyu, J\. Tang, Z\. Huang, Z\. Du, X\. Liu, A\. Zeng, L\. Hou,et al\.Longbench: a bilingual, multitask benchmark for long context understanding\.InProceedings of the 62nd annual meeting of the association for computational linguistics \(volume 1: Long papers\),pp\. 3119–3137\.Cited by:[§E\.1](https://arxiv.org/html/2609.27332#A5.SS1.p2.1)\.
- Baiet al\.\(2025\)Y\. Bai, S\. Tu, J\. Zhang, H\. Peng, X\. Wang, X\. Lv, S\. Cao, J\. Xu, L\. Hou, Y\. Dong,et al\.Longbench v2: towards deeper understanding and reasoning on realistic long\-context multitasks\.InProceedings of the 63rd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 3639–3664\.Cited by:[§E\.1](https://arxiv.org/html/2609.27332#A5.SS1.p2.1)\.
- Chenet al\.\(2026\)Y\. Chen, H\. Lai, Y\. Feng, C\. Han, Q\. Zhang, B\. Lu, M\. Li, X\. Wang, Z\. Wang, S\. Xu,et al\.Beyond semantic organization: memory as execution state management for long\-horizon agents\.arXiv preprint arXiv:2606\.06090\.Cited by:[§B\.2](https://arxiv.org/html/2609.27332#A2.SS2.p2.1),[§1](https://arxiv.org/html/2609.27332#S1.p3.1),[§2\.2](https://arxiv.org/html/2609.27332#S2.SS2.p1.1),[§5\.2](https://arxiv.org/html/2609.27332#S5.SS2.p1.1)\.
- Ethayarajh \(2019\)K\. EthayarajhHow contextual are contextualized word representations? comparing the geometry of bert, elmo, and gpt\-2 embeddings\.InProceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing \(EMNLP\-IJCNLP\),pp\. 55–65\.Cited by:[§C\.1](https://arxiv.org/html/2609.27332#A3.SS1.p2.2),[§1](https://arxiv.org/html/2609.27332#S1.p2.1),[§3\.1](https://arxiv.org/html/2609.27332#S3.SS1.p2.1)\.
- Fuet al\.\(2024\)Q\. Fu, M\. Cho, T\. Merth, S\. Mehta, M\. Rastegari, and M\. NajibiLazyllm: dynamic token pruning for efficient long context llm inference\.arXiv preprint arXiv:2407\.14057\.Cited by:[§2\.3](https://arxiv.org/html/2609.27332#S2.SS3.p1.1)\.
- Gaoet al\.\(2021\)T\. Gao, X\. Yao, and D\. ChenSimcse: simple contrastive learning of sentence embeddings\.InProceedings of the 2021 conference on empirical methods in natural language processing,pp\. 6894–6910\.Cited by:[§C\.1](https://arxiv.org/html/2609.27332#A3.SS1.p2.2),[§1](https://arxiv.org/html/2609.27332#S1.p2.1),[§3\.1](https://arxiv.org/html/2609.27332#S3.SS1.p2.1)\.
- Geet al\.\(2023\)T\. Ge, J\. Hu, L\. Wang, X\. Wang, S\. Chen, and F\. WeiIn\-context autoencoder for context compression in a large language model\.arXiv preprint arXiv:2307\.06945\.Cited by:[§B\.1](https://arxiv.org/html/2609.27332#A2.SS1.p3.1)\.
- Haoet al\.\(2026\)X\. Hao, H\. Meng, X\. Yin, J\. Zhu, and C\. CaoSelf\-gc: self\-governing context for long\-horizon llm agents\.arXiv preprint arXiv:2607\.00692\.Cited by:[§2\.1](https://arxiv.org/html/2609.27332#S2.SS1.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.13.1.1)\.
- Hsiehet al\.\(2024\)C\. Hsieh, S\. Sun, S\. Kriman, S\. Acharya, D\. Rekesh, F\. Jia, Y\. Zhang, and B\. GinsburgRULER: what’s the real context size of your long\-context language models?\.arXiv preprint arXiv:2404\.06654\.Cited by:[§2\.3](https://arxiv.org/html/2609.27332#S2.SS3.p1.1)\.
- Huet al\.\(2026\)Y\. Hu, H\. Qian, S\. Wang, J\. Liu, Z\. Zhao, J\. Tan, Z\. Liu, and Z\. DouSAM: state\-adaptive memory for long\-horizon reasoning agent\.arXiv preprint arXiv:2605\.24468\.Cited by:[§B\.2](https://arxiv.org/html/2609.27332#A2.SS2.p2.1),[§1](https://arxiv.org/html/2609.27332#S1.p1.1),[§1](https://arxiv.org/html/2609.27332#S1.p3.1),[§2\.2](https://arxiv.org/html/2609.27332#S2.SS2.p1.1),[§5\.2](https://arxiv.org/html/2609.27332#S5.SS2.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.16.1.1)\.
- Jahan Lia and Mazumder \(2026\)N\. Jahan Lia and A\. MazumderLearning what not to forget: long\-horizon agent memory from a few kilobytes of learning\.arXiv e\-prints,pp\. arXiv–2606\.Cited by:[§2\.1](https://arxiv.org/html/2609.27332#S2.SS1.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.14.1.1)\.
- Jeonget al\.\(2024\)S\. Jeong, J\. Baek, S\. Cho, S\. J\. Hwang, and J\. C\. ParkAdaptive\-rag: learning to adapt retrieval\-augmented large language models through question complexity\.InProceedings of the 2024 conference of the north american chapter of the association for computational linguistics: Human language technologies \(volume 1: Long papers\),pp\. 7036–7050\.Cited by:[§2\.3](https://arxiv.org/html/2609.27332#S2.SS3.p1.1)\.
- Jianget al\.\(2023\)H\. Jiang, Q\. Wu, C\. Lin, Y\. Yang, and L\. QiuLlmlingua: compressing prompts for accelerated inference of large language models\.InProceedings of the 2023 conference on empirical methods in natural language processing,pp\. 13358–13376\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1)\.
- Jianget al\.\(2024\)H\. Jiang, Q\. Wu, X\. Luo, D\. Li, C\. Lin, Y\. Yang, and L\. QiuLongllmlingua: accelerating and enhancing llms in long context scenarios via prompt compression\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 1658–1677\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1)\.
- Kanget al\.\(2025\)M\. Kang, W\. Chen, D\. Han, H\. A\. Inan, L\. Wutschitz, Y\. Chen, R\. Sim, and S\. RajmohanAcon: optimizing context compression for long\-horizon llm agents\.arXiv preprint arXiv:2510\.00615\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1),[§2\.1](https://arxiv.org/html/2609.27332#S2.SS1.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.12.1.1)\.
- Kwonet al\.\(2023\)W\. Kwon, Z\. Li, S\. Zhuang, Y\. Sheng, L\. Zheng, C\. H\. Yu, J\. Gonzalez, H\. Zhang, and I\. StoicaEfficient memory management for large language model serving with pagedattention\.InProceedings of the 29th symposium on operating systems principles,pp\. 611–626\.Cited by:[§E\.2](https://arxiv.org/html/2609.27332#A5.SS2.p3.1)\.
- Liet al\.\(2026a\)M\. Li, L\. Xu, Q\. Tan, L\. Ma, H\. Song, T\. Cao, and Y\. LiuSculptor: empowering llms with cognitive agency via active context management\.InInternational Conference on Learning Representations,Vol\.2026,pp\. 153411–153440\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1),[§2\.1](https://arxiv.org/html/2609.27332#S2.SS1.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.18.1.1)\.
- Liet al\.\(2026b\)T\. Li, J\. Zhang, W\. Jurayj, X\. Wang, C\. Jin, M\. Farajtabar, E\. Nalisnick, and D\. KhashabiSelf\-compacting language model agents\.arXiv preprint arXiv:2606\.23525\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1),[§2\.1](https://arxiv.org/html/2609.27332#S2.SS1.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.11.1.1)\.
- Liet al\.\(2026c\)X\. Li, R\. Ming, M\. Chu, S\. Shao, R\. Jin, and C\. XiongACM: agentic context management for long horizon tasks\.arXiv preprint arXiv:2607\.23809\.Cited by:[§2\.1](https://arxiv.org/html/2609.27332#S2.SS1.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.19.1.1)\.
- Liuet al\.\(2024a\)N\. F\. Liu, K\. Lin, J\. Hewitt, A\. Paranjape, M\. Bevilacqua, F\. Petroni, and P\. LiangLost in the middle: how language models use long contexts\.Transactions of the association for computational linguistics12,pp\. 157–173\.Cited by:[§E\.1](https://arxiv.org/html/2609.27332#A5.SS1.p2.1)\.
- Liuet al\.\(2024b\)X\. Liu, H\. Yu, H\. Zhang, Y\. Xu, X\. Lei, H\. Lai, Y\. Gu, H\. Ding, K\. Men, K\. Yang,et al\.Agentbench: evaluating llms as agents\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 52989–53046\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1)\.
- Muet al\.\(2023\)J\. Mu, X\. Li, and N\. GoodmanLearning to compress prompts with gist tokens\.Advances in Neural Information Processing Systems36,pp\. 19327–19352\.Cited by:[§B\.1](https://arxiv.org/html/2609.27332#A2.SS1.p3.1)\.
- Muet al\.\(2017\)J\. Mu, S\. Bhat, and P\. ViswanathAll\-but\-the\-top: simple and effective postprocessing for word representations\.arXiv preprint arXiv:1702\.01417\.Cited by:[§C\.1](https://arxiv.org/html/2609.27332#A3.SS1.p2.2),[§1](https://arxiv.org/html/2609.27332#S1.p2.1),[§3\.1](https://arxiv.org/html/2609.27332#S3.SS1.p2.1)\.
- Packeret al\.\(2023\)C\. Packer, S\. Wooders, K\. Lin, V\. Fang, S\. G\. Patil, I\. Stoica, and J\. E\. GonzalezMemgpt: towards llms as operating systems\.arXiv preprint arXiv:2310\.08560\.Cited by:[§2\.2](https://arxiv.org/html/2609.27332#S2.SS2.p1.1)\.
- Panet al\.\(2024\)Z\. Pan, Q\. Wu, H\. Jiang, M\. Xia, X\. Luo, J\. Zhang, Q\. Lin, V\. Rühle, Y\. Yang, C\. Lin,et al\.Llmlingua\-2: data distillation for efficient and faithful task\-agnostic prompt compression\.InFindings of the Association for Computational Linguistics: ACL 2024,pp\. 963–981\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1),[§2\.3](https://arxiv.org/html/2609.27332#S2.SS3.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.10.1.1)\.
- Parket al\.\(2023\)J\. S\. Park, J\. O’Brien, C\. J\. Cai, M\. R\. Morris, P\. Liang, and M\. S\. BernsteinGenerative agents: interactive simulacra of human behavior\.InProceedings of the 36th annual acm symposium on user interface software and technology,pp\. 1–22\.Cited by:[§2\.2](https://arxiv.org/html/2609.27332#S2.SS2.p1.1)\.
- Sarthiet al\.\(2024\)P\. Sarthi, S\. Abdullah, A\. Tuli, S\. Khanna, A\. Goldie, and C\. ManningRaptor: recursive abstractive processing for tree\-organized retrieval\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 32628–32649\.Cited by:[§2\.3](https://arxiv.org/html/2609.27332#S2.SS3.p1.1)\.
- Shinnet al\.\(2023\)N\. Shinn, F\. Cassano, A\. Gopinath, K\. Narasimhan, and S\. YaoReflexion: language agents with verbal reinforcement learning\.Advances in neural information processing systems36,pp\. 8634–8652\.Cited by:[§2\.2](https://arxiv.org/html/2609.27332#S2.SS2.p1.1)\.
- Teamet al\.\(2026\)T\. W\. B\. Team, S\. Cai, S\. Chen, X\. Fei, Y\. Mao, Z\. Xu, Z\. Lyu, Z\. Shao, Y\. Shi, S\. Zhang,et al\.Tencent workbuddy bench: a multi\-domain coding\-agent benchmark with contamination\-resistant task construction\.arXiv preprint arXiv:2607\.20911\.Cited by:[§E\.1](https://arxiv.org/html/2609.27332#A5.SS1.p1.1),[§6\.1](https://arxiv.org/html/2609.27332#S6.SS1.p1.1)\.
- Wanget al\.\(2026\)Y\. Wang, Y\. Shi, M\. Yang, R\. Zhang, S\. He, H\. Lian, Y\. Chen, S\. Ye, K\. Cai, and X\. GuSwe\-pruner: self\-adaptive context pruning for coding agents\.arXiv preprint arXiv:2601\.16746\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1),[§2\.3](https://arxiv.org/html/2609.27332#S2.SS3.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.17.1.1)\.
- Weiet al\.\(2026\)L\. Wei, X\. Peng, G\. Zhang, C\. Jiang, H\. Li, L\. Lin, Y\. Xu, J\. Liu, K\. Wang, B\. Wang,et al\.PACE: predictive adaptive context extraction for long\-horizon llm agents\.InProceedings of the 64th Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 27184–27199\.Cited by:[§2\.1](https://arxiv.org/html/2609.27332#S2.SS1.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.9.1.1)\.
- Wuet al\.\(2026\)Y\. Wu, L\. Zhang, Y\. Zhou, M\. Wang, B\. Peng, S\. Li, X\. Fan, and Z\. ZhaoRemember when it matters: proactive memory agent for long\-horizon agents\.arXiv preprint arXiv:2607\.08716\.Cited by:[§B\.2](https://arxiv.org/html/2609.27332#A2.SS2.p2.1),[§1](https://arxiv.org/html/2609.27332#S1.p3.1),[§2\.2](https://arxiv.org/html/2609.27332#S2.SS2.p1.1),[§5\.2](https://arxiv.org/html/2609.27332#S5.SS2.p1.1)\.
- Xuet al\.\(2026\)A\. Xu, B\. Lin, B\. Xue, B\. Wang, B\. Xu, B\. Wu, B\. Zhang, C\. Lin, C\. Dong, C\. Ling,et al\.Deepseek\-v4: towards highly efficient million\-token context intelligence\.arXiv preprint arXiv:2606\.19348\.Cited by:[§E\.1](https://arxiv.org/html/2609.27332#A5.SS1.p1.1),[§6\.1](https://arxiv.org/html/2609.27332#S6.SS1.p1.1)\.
- Xuet al\.\(2024\)F\. Xu, W\. Shi, and E\. ChoiRECOMP: improving retrieval\-augmented lms with context compression and selective augmentation\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 43478–43502\.Cited by:[§B\.1](https://arxiv.org/html/2609.27332#A2.SS1.p3.1)\.
- Yaoet al\.\(2022\)S\. Yao, J\. Zhao, D\. Yu, N\. Du, I\. Shafran, K\. Narasimhan, and Y\. CaoReact: synergizing reasoning and acting in language models\.arXiv preprint arXiv:2210\.03629\.Cited by:[§1](https://arxiv.org/html/2609.27332#S1.p1.1)\.
- Zhanget al\.\(2024\)X\. Zhang, Y\. Chen, S\. Hu, Z\. Xu, J\. Chen, M\. Hao, X\. Han, Z\. Thai, S\. Wang, Z\. Liu,et al\.∞ Bench: extending long context evaluation beyond 100k tokens\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 15262–15277\.Cited by:[§2\.3](https://arxiv.org/html/2609.27332#S2.SS3.p1.1)\.
- Zhanget al\.\(2026\)Y\. Zhang, C\. Dong, S\. Jin, C\. Yu, H\. Cui, H\. Jin, X\. Zhang, H\. Bonab, C\. Lockard, J\. Chen,et al\.CoMem: context management with a decoupled long\-context model\.arXiv preprint arXiv:2605\.30842\.Cited by:[§2\.1](https://arxiv.org/html/2609.27332#S2.SS1.p1.1),[Table 4](https://arxiv.org/html/2609.27332#S6.T4.5.15.1.1)\.
- Zhouet al\.\(2026\)Z\. Zhou, A\. Qu, Z\. Wu, S\. Kim, A\. Prakash, D\. Rus, B\. K\. H\. Low, and P\. LiangMem1: learning to synergize memory and reasoning for efficient long\-horizon agents\.InInternational Conference on Learning Representations,Vol\.2026,pp\. 58413–58438\.Cited by:[§B\.2](https://arxiv.org/html/2609.27332#A2.SS2.p2.1),[§1](https://arxiv.org/html/2609.27332#S1.p3.1),[§2\.2](https://arxiv.org/html/2609.27332#S2.SS2.p1.1),[§5\.2](https://arxiv.org/html/2609.27332#S5.SS2.p1.1)\.
## Appendix AMathematical Derivations and Properties
We derive the geometric and structural properties used byGEM\. Throughout this section, the available history is fixed, the block vectorsxi∈ℝdx\_\{i\}\\in\\mathbb\{R\}^\{d\}have unit norm, andQBQ\_\{B\}contains an orthonormal basis for the span of the selected vectors\. The statements concern these representation\-space quantities and the selection and forwarding operations\.
### A\.1 Residual Selection and Reconstruction Error
WriteX=\[x1,…,xn\]⊤X=\[x\_\{1\},\\ldots,x\_\{n\}\]^\{\\top\}andPB=QBQB⊤P\_\{B\}=Q\_\{B\}Q\_\{B\}^\{\\top\}, withP∅=0P\_\{\\varnothing\}=0\. The selected block identities and the numerical basis are maintained separately: a protected block remains selected even if its vector is already in the span of the other selected vectors\. For any block, the orthogonal decomposition is
xi=PBxi\+ei\(B\),ei\(B\)=\(I−PB\)xi\.x\_\{i\}=P\_\{B\}x\_\{i\}\+e\_\{i\}\(B\),\\qquad e\_\{i\}\(B\)=\(I\-P\_\{B\}\)x\_\{i\}\.\(A\.1\)
###### Proposition A\.1\(Residual score and geometric coverage\)\.
For normalized block vectors,
ri\(B\)\\displaystyle r\_\{i\}\(B\)=‖ei\(B\)‖22=1−‖QB⊤xi‖22,\\displaystyle=\\\|e\_\{i\}\(B\)\\\|\_\{2\}^\{2\}=1\-\\\|Q\_\{B\}^\{\\top\}x\_\{i\}\\\|\_\{2\}^\{2\},\(A\.2\)E\(B\)\\displaystyle E\(B\)=‖XQB‖F2n=1−‖X\(I−PB\)‖F2n\.\\displaystyle=\\frac\{\\\|XQ\_\{B\}\\\|\_\{F\}^\{2\}\}\{n\}=1\-\\frac\{\\\|X\(I\-P\_\{B\}\)\\\|\_\{F\}^\{2\}\}\{n\}\.\(A\.3\)Consequently,0≤ri\(B\)≤10\\leq r\_\{i\}\(B\)\\leq 1,0≤E\(B\)≤10\\leq E\(B\)\\leq 1, and a core satisfyingE\(B\)≥τE\(B\)\\geq\\tauhas mean squared embedding reconstruction error at most1−τ1\-\\tau\.
Proof\.BecausePBP\_\{B\}is a symmetric idempotent projector,PBxiP\_\{B\}x\_\{i\}is orthogonal to\(I−PB\)xi\(I\-P\_\{B\}\)x\_\{i\}\. Thus‖xi‖22=‖PBxi‖22\+‖ei\(B\)‖22\\\|x\_\{i\}\\\|\_\{2\}^\{2\}=\\\|P\_\{B\}x\_\{i\}\\\|\_\{2\}^\{2\}\+\\\|e\_\{i\}\(B\)\\\|\_\{2\}^\{2\}\. Orthonormality gives‖PBxi‖22=‖QB⊤xi‖22\\\|P\_\{B\}x\_\{i\}\\\|\_\{2\}^\{2\}=\\\|Q\_\{B\}^\{\\top\}x\_\{i\}\\\|\_\{2\}^\{2\}\. Using‖xi‖22=1\\\|x\_\{i\}\\\|\_\{2\}^\{2\}=1proves the first identity\. Summing it over allnnblocks gives the second identity and the stated bounds\.□\\square
Equation[A\.2](https://arxiv.org/html/2609.27332#A1.E2)explains the completion rule: the largest\-residual candidate contributes a direction that is poorly represented by the current selected span\. Equation[A\.3](https://arxiv.org/html/2609.27332#A1.E3)gives the coverage target its direct reconstruction interpretation\. These quantities are evaluated on the original normalized vectors, matching the online selector; the centered spectral analysis is defined separately in Appendix[C](https://arxiv.org/html/2609.27332#A3)\.
### A\.2 Coverage Gain and Incremental Basis Updates
For an eligible candidatejjwithrj\(B\)\>0r\_\{j\}\(B\)\>0, modified Gram Schmidt constructs the new unit direction
q=xj−QB\(QB⊤xj\)rj\(B\),QB∪\{j\}=\[QB,q\]\.q=\\frac\{x\_\{j\}\-Q\_\{B\}\(Q\_\{B\}^\{\\top\}x\_\{j\}\)\}\{\\sqrt\{r\_\{j\}\(B\)\}\},\\qquad Q\_\{B\\cup\\\{j\\\}\}=\[Q\_\{B\},q\]\.\(A\.4\)
###### Proposition A\.2\(Monotone coverage completion\)\.
For the update in Eq\.[A\.4](https://arxiv.org/html/2609.27332#A1.E4),
PB∪\{j\}\\displaystyle P\_\{B\\cup\\\{j\\\}\}=PB\+qq⊤,\\displaystyle=P\_\{B\}\+qq^\{\\top\},\(A\.5\)E\(B∪\{j\}\)−E\(B\)\\displaystyle E\(B\\cup\\\{j\\\}\)\-E\(B\)=1n∑i=1n\(q⊤xi\)2,\\displaystyle=\\frac\{1\}\{n\}\\sum\_\{i=1\}^\{n\}\(q^\{\\top\}x\_\{i\}\)^\{2\},\(A\.6\)ri\(B∪\{j\}\)\\displaystyle r\_\{i\}\(B\\cup\\\{j\\\}\)=ri\(B\)−\(q⊤xi\)2\.\\displaystyle=r\_\{i\}\(B\)\-\(q^\{\\top\}x\_\{i\}\)^\{2\}\.\(A\.7\)In particular, the coverage gain is at leastrj\(B\)/n\>0r\_\{j\}\(B\)/n\>0\. More generally,B⊆SB\\subseteq SimpliesE\(S\)≥E\(B\)E\(S\)\\geq E\(B\)\.
Proof\.The normalized residualqqis orthogonal to every column ofQBQ\_\{B\}\. The projector onto the expanded span is thereforePB\+qq⊤P\_\{B\}\+qq^\{\\top\}\. Substituting this expression into the definition ofEEgives Eq\.[A\.6](https://arxiv.org/html/2609.27332#A1.E6), and subtracting the new projected component gives Eq\.[A\.7](https://arxiv.org/html/2609.27332#A1.E7)\. All terms in the coverage gain are nonnegative, and thei=ji=jterm equalsrj\(B\)r\_\{j\}\(B\)\. For nested setsB⊆SB\\subseteq S, extendQBQ\_\{B\}by an orthonormal basis of the additional directions inspan\(S\)\\operatorname\{span\}\(S\)and apply the same argument to each added direction\.□\\square
Formmadded independent directionsq1,…,qmq\_\{1\},\\ldots,q\_\{m\}, the increments sum to
E\(Bm\)=E\(B0\)\+1n∑k=1m‖Xqk‖22\.E\(B\_\{m\}\)=E\(B\_\{0\}\)\+\\frac\{1\}\{n\}\\sum\_\{k=1\}^\{m\}\\\|Xq\_\{k\}\\\|\_\{2\}^\{2\}\.\(A\.8\)Thus geometric completion progressively covers additional directions after the evidence set has been protected\. The residual\-update identity also allows candidate scores to be updated without rebuilding all previous projections at each iteration\.
### A\.3 Evidence Preservation and Forwarding Invariants
The selector begins withB0=𝒫tB\_\{0\}=\\mathcal\{P\}\_\{t\}and uses the expanded capacityKt=max\{K,\|𝒫t\|\}K\_\{t\}=\\max\\\{K,\|\\mathcal\{P\}\_\{t\}\|\\\}\. It only adds indices during completion\. The forwarding stage starts from the full valid request and considers removing indices outside the completed coreBtB\_\{t\}\.
###### Proposition A\.3\(Protected and structurally valid forwarding\)\.
For an accepted global rewrite,
𝒫t⊆Bt⊆St⊆\[n\],L\(St\)≥\(1−δ\)L\(\[n\]\)\.\\mathcal\{P\}\_\{t\}\\subseteq B\_\{t\}\\subseteq S\_\{t\}\\subseteq\[n\],\\qquad L\(S\_\{t\}\)\\geq\(1\-\\delta\)L\(\[n\]\)\.\(A\.9\)Every retained removable block contains its complete assistant call and result group, and the retained messages preserve their original chronological order\. Between global reselections, under stable block identities, the append rule satisfies
St\+1=St∪𝒩t\+1∪𝒜t\+1,St⊆St\+1,S\_\{t\+1\}=S\_\{t\}\\cup\\mathcal\{N\}\_\{t\+1\}\\cup\\mathcal\{A\}\_\{t\+1\},\\qquad S\_\{t\}\\subseteq S\_\{t\+1\},\(A\.10\)where𝒩t\+1\\mathcal\{N\}\_\{t\+1\}and𝒜t\+1\\mathcal\{A\}\_\{t\+1\}are newly available blocks and newly activated evidence, respectively\.
Proof\.The core is initialized to𝒫t\\mathcal\{P\}\_\{t\}and is modified only by insertion, so𝒫t⊆Bt\\mathcal\{P\}\_\{t\}\\subseteq B\_\{t\}\. Forwarding starts from\[n\]\[n\]and deletes only members of its complement toBtB\_\{t\}, provingBt⊆StB\_\{t\}\\subseteq S\_\{t\}\. Initially the length constraint holds; accepting each proposed deletion only when it continues to hold proves the bound by induction\. Parsing constructs complete call and result blocks, selection changes only whole\-block membership, and reconstruction sorts retained messages by their original indices\. This preserves call and result groups and chronological order\. Finally, the ordinary update is a set union with the saved actual forwarded set, proving Eq\.[A\.10](https://arxiv.org/html/2609.27332#A1.E10)\.□\\square
Keeping the actual forwarded set is important: it preserves not only the core but also the additional original blocks retained by the request\-length guard\. Protected block membership is therefore independent of whether a protected embedding introduces a new basis direction\.
## Appendix BAlgorithm and Implementation Details
### B\.1 Complete Blocks and Selection Representations
A removable interaction block contains an assistant message with one or more tool calls and all corresponding tool\-result messages, matched by call ID\. The parser checks identifier uniqueness and complete matching between calls and results\. The system/task prefix and non\-removable messages are preserved independently\. When parsing or reconstructed\-request validation fails, the original request is returned\.
The selection representation concatenates assistant reasoning, assistant text, tool names and arguments, and tool observations under the markersASSISTANT\_REASONING,ASSISTANT\_TEXT,ACTION, andOBSERVATION\. This encoder input is limited to 12,000 characters, retaining its beginning and end for overlength blocks\. Only the selection representation is shortened; forwarded blocks use the complete, unchanged original message objects\. The frozen encoder is Qwen3\-Embedding\-8B with 1,024 output dimensions\.
This block\-level interface differs from compressed retrieved text[35](https://arxiv.org/html/2609.27332#bib.bib17)and learned compact representations such as gist tokens and in\-context autoencoding[23](https://arxiv.org/html/2609.27332#bib.bib15),[8](https://arxiv.org/html/2609.27332#bib.bib16)\. InGEM, embeddings guide which original blocks to retain; the acting model continues to receive ordinary messages\.
### B\.2 Evidence Protection and Shared Settings
The protected set is a deduplicated union
𝒫t=𝒫trecent∪𝒫tgoal∪𝒫tstate∪𝒫terror∪𝒫tsource\.\\mathcal\{P\}\_\{t\}=\\mathcal\{P\}\_\{t\}^\{\\mathrm\{recent\}\}\\cup\\mathcal\{P\}\_\{t\}^\{\\mathrm\{goal\}\}\\cup\\mathcal\{P\}\_\{t\}^\{\\mathrm\{state\}\}\\cup\\mathcal\{P\}\_\{t\}^\{\\mathrm\{error\}\}\\cup\\mathcal\{P\}\_\{t\}^\{\\mathrm\{source\}\}\.\(B\.1\)Recent protection retains four complete blocks of immediate working context\. Goal protection retains the eligible block most similar to the current task\. State protection retains up to three relevant records using the state query, artifact paths, explicit editing calls, and supported Bash/Python write patterns\. Error protection retains up to two recent error records within eight blocks\. Source protection is activated when source\-like blocks constitute at least half of the history and keeps recent evidence from distinct sources\.
These rules distinguish the execution roles of records rather than treating semantic similarity as interchangeability\. State\-related and persistent memory provide the relevant context for this distinction[4](https://arxiv.org/html/2609.27332#bib.bib28),[39](https://arxiv.org/html/2609.27332#bib.bib29),[33](https://arxiv.org/html/2609.27332#bib.bib30),[11](https://arxiv.org/html/2609.27332#bib.bib7)\. The numerical protection limits in Table[B\.1](https://arxiv.org/html/2609.27332#A2.T1)are the sharedGEMsettings\. A detected write is treated as evidence of a possible state change; preserving it does not assert that the operation succeeded\.
Table B\.1:Shared implementation settings across Code, Office, Security, and Web\.- The core capacity expands to include all required evidence\. The recordedbudget\_kis not the final forwarded\-block count: the protected set, core capacity, and request\-length guard jointly determine the forwarded set\.
### B\.3 Global Selection and Incremental Forwarding
Every request is inspected\. Requests with fewer than 16 complete blocks remain unchanged\. Global selection is triggered at the first eligible request, after a session reset/rewrite or goal change, or after 256 newly accumulated blocks\. It initializes the core with protected evidence and adds largest\-residual candidates until coverage, capacity, or candidate exhaustion terminates selection\.
The final forwarded set starts from the full safe request\. Only blocks outside the selected core are considered for deletion, with larger redundant blocks considered first\. Each accepted deletion must preserve at least 95% of the original request’s serialized character count\. Ordinary append events keep the saved actual forwarded set, append new blocks and activated evidence, and preserve chronological order\. Algorithm[1](https://arxiv.org/html/2609.27332#alg1)combines these steps\.
Algorithm 1GEMat an intercepted agent request1:Input:request, goal, saved forwarded state,
τ\\tau,
KK,
δ\\delta
2:Parse complete blocks and preserve the non\-removable prefix
3:ifthe tool protocol is invalid or fewer than 16 complete blocks are availablethen
4:returnthe original request
5:endif
6:Construct and deduplicate the protected set
𝒫t\\mathcal\{P\}\_\{t\}
7:ifglobal reselection is triggeredthen
8:Encode blocks; set
B←𝒫tB\\leftarrow\\mathcal\{P\}\_\{t\}and
Kt←max\{K,\|𝒫t\|\}K\_\{t\}\\leftarrow\\max\\\{K,\|\\mathcal\{P\}\_\{t\}\|\\\}
9:Construct an orthonormal basis
QBQ\_\{B\}of the selected representations
10:while
\|B\|<Kt\|B\|<K\_\{t\},
E\(B\)<τE\(B\)<\\tau, and an independent eligible candidate existsdo
11:Select
j←argmaxi∉B\(1−‖QB⊤xi‖22\)j\\leftarrow\\arg\\max\_\{i\\notin B\}\(1\-\\\|Q\_\{B\}^\{\\top\}x\_\{i\}\\\|\_\{2\}^\{2\}\)over eligible candidates
12:Add
jjto
BBand update the basis and residuals
13:endwhile
14:Initialize
S←\[n\]S\\leftarrow\[n\]; save the original request length
L0L\_\{0\}
15:foreligible blocks
i∉Bi\\notin Bin the deletion\-priority orderdo
16:if
L\(S∖\{i\}\)≥\(1−δ\)L0L\(S\\setminus\\\{i\\\}\)\\geq\(1\-\\delta\)L\_\{0\}then
17:
S←S∖\{i\}S\\leftarrow S\\setminus\\\{i\\\}
18:endif
19:endfor
20:else
21:Keep the saved forwarded set and append new blocks and activated evidence
22:Let
SSbe the resulting index set in the current history
23:endif
24:Reconstruct complete original messages in chronological order
25:ifthe reconstructed request fails structural validationthen
26:returnthe original request
27:endif
28:Save the actual forwarded set and session/goal bookkeeping
29:returnthe reconstructed request
Withnnencoded blocks, dimensiondd, and final basis rankbb, incremental projection updates in Eq\.[A\.7](https://arxiv.org/html/2609.27332#A1.E7)can be implemented inO\(ndb\)O\(ndb\)arithmetic andO\(nd\+db\+n\)O\(nd\+db\+n\)working storage, excluding the original messages and encoder\. These are operation\-count bounds for incremental updates; encoding and request serialization are accounted for separately\.
## Appendix CAdditional Geometry and Evidence Analysis
### C\.1 Representations, Centering, and Matched Controls
The isolated\-block analysis uses 171 trajectories and 4,701 complete blocks, encoded independently with frozen Qwen3\.5\-9B mean layer\-32 representations of dimension 4,096\. The selector\-space analysis uses 32 trajectories and 1,162 block representations of dimension 1,024\. These are the two representation populations used in Section[4\.1](https://arxiv.org/html/2609.27332#S4.SS1)\.
ForXc=X−𝟏x¯⊤=UΣV⊤X\_\{c\}=X\-\\mathbf\{1\}\\bar\{x\}^\{\\top\}=U\\Sigma V^\{\\top\}with positive centered energy, define
pj=σj2∑kσk2,reff=exp\(−∑jpjlogpj\),r¯90=1nmin\{k:∑j≤kpj≥0\.90\}\.p\_\{j\}=\\frac\{\\sigma\_\{j\}^\{2\}\}\{\\sum\_\{k\}\\sigma\_\{k\}^\{2\}\},\\qquad r\_\{\\mathrm\{eff\}\}=\\exp\\\!\\left\(\-\\sum\_\{j\}p\_\{j\}\\log p\_\{j\}\\right\),\\qquad\\bar\{r\}\_\{90\}=\\frac\{1\}\{n\}\\min\\\!\\left\\\{k:\\sum\_\{j\\leq k\}p\_\{j\}\\geq 0\.90\\right\\\}\.\(C\.1\)The centered analysis isolates variation around the mean direction, complementing studies of representation anisotropy and dominant embedding directions[5](https://arxiv.org/html/2609.27332#bib.bib37),[24](https://arxiv.org/html/2609.27332#bib.bib38),[7](https://arxiv.org/html/2609.27332#bib.bib39)\.
The feature\-shift control independently circularly shifts each feature along the block axis, preserving its marginal values while disrupting cross\-feature alignment\. The Gaussian control matches the trajectory matrix dimensions\. Both comparisons are performed within trajectories before aggregation\. Table[C\.1](https://arxiv.org/html/2609.27332#A3.T1)gives the aggregate dimensionality statistics corresponding to the main\-text comparison\.
Table C\.1:Structured low\-dimensionality of agent histories\. Values are trajectory medians for centered representations;r90/nr\_\{90\}/nis the fraction of available blocks required to explain90%90\\%of centered energy\.Real histories have lower effective rank than their feature\-shift controls in all 171 isolated\-block comparisons and all 32 selector\-space comparisons\. The consistent pattern across the two spaces supports structured geometric redundancy as a basis for the completion stage\.
### C\.2 Matched\-Budget Evidence Retention
The matched\-budget analysis holds the retained block count fixed at each checkpoint\. Both selectors are measured on the same available history and recorded next action\. The online compressor has access only to the current goal and available history; the recorded next action is used for offline evaluation\.
For action representationaa, the quantities in Eq\.[4](https://arxiv.org/html/2609.27332#S3.E4)distinguish projected action\-direction energy from retention of actual neighboring history records\. The action projection is‖QS⊤a‖22\\\|Q\_\{S\}^\{\\top\}a\\\|\_\{2\}^\{2\}, and Top\-3 retention is the fraction of the three history blocks most similar toaathat remain inSS\. The 650\-checkpoint comparison in Table[1](https://arxiv.org/html/2609.27332#S4.T1)shows higher action\-related retention with evidence constraints at the same retained count, while the reported centroid similarity remains 0\.98\.
Letfjcf\_\{jc\}denote a checkpoint metric for checkpointccof trajectoryjj, and letmjm\_\{j\}be that trajectory’s checkpoint count\. The pooled statistic is
f¯pooled=∑j=132∑c=1mjfjc∑j=132mj,∑j=132mj=650\.\\bar\{f\}\_\{\\mathrm\{pooled\}\}=\\frac\{\\sum\_\{j=1\}^\{32\}\\sum\_\{c=1\}^\{m\_\{j\}\}f\_\{jc\}\}\{\\sum\_\{j=1\}^\{32\}m\_\{j\}\},\\qquad\\sum\_\{j=1\}^\{32\}m\_\{j\}=650\.\(C\.2\)This specifies the weighting used for pooled checkpoint means; trajectories remain the independent experimental units\. No individual task outcomes are needed to interpret this representation\-level comparison\.
### C\.3 Low\-Energy Subspace and Controlled Replacement
LetVlowV\_\{\\mathrm\{low\}\}contain the centered\-history singular vectors after the 90% energy cutoff, and writex~i=xi−x¯\\tilde\{x\}\_\{i\}=x\_\{i\}\-\\bar\{x\}\. The block’s low\-energy fraction and its alignment with the action are
Li\\displaystyle L\_\{i\}=‖Vlow⊤x~i‖22‖V⊤x~i‖22,\\displaystyle=\\frac\{\\\|V\_\{\\mathrm\{low\}\}^\{\\top\}\\tilde\{x\}\_\{i\}\\\|\_\{2\}^\{2\}\}\{\\\|V^\{\\top\}\\tilde\{x\}\_\{i\}\\\|\_\{2\}^\{2\}\},\(C\.3\)Ai\\displaystyle A\_\{i\}=cos\(VlowVlow⊤x~i,VlowVlow⊤a\)\.\\displaystyle=\\cos\\\!\\left\(V\_\{\\mathrm\{low\}\}V\_\{\\mathrm\{low\}\}^\{\\top\}\\tilde\{x\}\_\{i\},V\_\{\\mathrm\{low\}\}V\_\{\\mathrm\{low\}\}^\{\\top\}a\\right\)\.\(C\.4\)These quantities are evaluated when their denominators and cosine norms are nonzero\. The targeted condition removes a retained block with highAiA\_\{i\}; the matched condition removes a low\-alignment block while matching representation similarity, recency, and serialized length\. The two conditions retain the same number of blocks\. These definitions specify the intervention reported in Table[2](https://arxiv.org/html/2609.27332#S4.T2)\.
The spectral visualization groups ordered directions into rank bands, whereas the intervention uses the cumulative\-energy cutoff above\. Keeping these definitions separate connects the visualization to the formal replacement analysis without treating rank fractions as energy fractions\.
## Appendix DAblation and Hyperparameter Analysis
### D\.1 Selectors at the Same Retained Count
Table[D\.1](https://arxiv.org/html/2609.27332#A4.T1)compares selection strategies at the same retained count on 32 trajectories and 59 checkpoints\. This comparison isolates which records are selected from how many records are retained\. The evidence\-first selector achieves the highest reported final projection and next\-action Top\-3 retention while retaining high geometric coverage\.
Table D\.1:Same\-retained\-count offline selector comparison on 32 trajectories and 59 checkpoints\.
### D\.2 Contribution of Evidence Protection
Table[D\.2](https://arxiv.org/html/2609.27332#A4.T2)reports the component ablation at each variant’s natural retained fraction\. Relative to geometry\-only selection, the complete protection bundle retains more action\-related information\. Removing State or Error protection reduces Top\-3 retention, supporting their role within the combined evidence set\. The natural\-budget comparison complements the fixed\-count comparison above; their retained fractions and checkpoint protocols are reported separately\.
Table D\.2:Offline component ablation at each variant’s natural retained fraction \(32 trajectories, 59 checkpoints\)\.- Because retention differs across variants, this table does not isolate selection quality at identical budgets\. The same\-KKcomparison above provides the corresponding budget\-controlled view\.
For the online ablation in Table[5](https://arxiv.org/html/2609.27332#S6.T5),Random completionretains the protected set and candidate pool and fills remaining slots by seeded sampling to match the greedy reference count\.Geometry onlyremoves the semantic protection groups while retaining the candidate policy, residual rule, and request\-validity bookkeeping\. These definitions separate the roles of evidence protection and geometric completion without duplicating the online outcome table\.
### D\.3 Budget and Coverage Sensitivity
The exact\-KKsweep uses 28 trajectories and 525 checkpoints common to all budgets\. Table[D\.3](https://arxiv.org/html/2609.27332#A4.T3)gives the complete tested rangeK=8,…,20K=8,\\ldots,20, including all four selectors\. Evidence\-constrained selection exceeds geometry\-only Top\-3 retention throughout this range\.
Table D\.3:Exact retained\-count sweep\. Values are next\-action Top\-3 retention on 28 trajectories and 525 checkpoints common to allKK\.The coverage sweep uses 32 trajectories and 59 checkpoints\. Table[D\.4](https://arxiv.org/html/2609.27332#A4.T4)shows the retained fraction, next\-action Top\-3 retention, and action projection for every tested threshold\. Increasingτ\\tauprogressively adds geometric coverage and retains additional task evidence\. Theτ=0\.90\\tau=0\.90row is the operating point highlighted in the main text\.
Table D\.4:Coverage\-threshold sweep on 32 trajectories and 59 checkpoints\.These sweeps provide the tabulated values corresponding to Figure[5](https://arxiv.org/html/2609.27332#S6.F5)\. They evaluate representation\-level evidence retention under controlled compression settings\.
## Appendix EEvaluation Protocol and Efficiency Analysis
### E\.1 Task Units and Aggregate Metrics
The online evaluation uses WorkBuddyBench[30](https://arxiv.org/html/2609.27332#bib.bib26)with DeepSeek\-V4\-Flash[34](https://arxiv.org/html/2609.27332#bib.bib11)at temperature zero\. A complete task is the unit for reward and token aggregation\. For a domainddwithNdN\_\{d\}tasks, define
Scored=100Nd∑i∈dRi,Tokensd=1Nd∑i∈dTi\.\\mathrm\{Score\}\_\{d\}=\\frac\{100\}\{N\_\{d\}\}\\sum\_\{i\\in d\}R\_\{i\},\\qquad\\mathrm\{Tokens\}\_\{d\}=\\frac\{1\}\{N\_\{d\}\}\\sum\_\{i\\in d\}T\_\{i\}\.\(E\.1\)Overall Full260 means weight domains by task count\. The fixed\-40 panel contains ten tasks per domain, and the 20\-task online ablation contains five per domain\. All three use the same domain order: Code, Office, Security, and Web\.
The trajectory\-level geometric analyses evaluate a different question from end\-to\-end reward\. Long\-context understanding is likewise studied through context\-use analyses and dedicated benchmarks[21](https://arxiv.org/html/2609.27332#bib.bib18),[2](https://arxiv.org/html/2609.27332#bib.bib19),[3](https://arxiv.org/html/2609.27332#bib.bib20); here the primary online outcome is the reward of a completed agent task\.
### E\.2 Token Accounting and Full260 Efficiency
For each counted callccin taskii, letIicI\_\{ic\}andOicO\_\{ic\}denote model input and output tokens, and letTiencT\_\{i\}^\{\\mathrm\{enc\}\}be embedding usage\. Combined tokens are
Ti=∑c\(Iic\+Oic\)\+Tienc\.T\_\{i\}=\\sum\_\{c\}\(I\_\{ic\}\+O\_\{ic\}\)\+T\_\{i\}^\{\\mathrm\{enc\}\}\.\(E\.2\)When usage is partitioned,Iic=Iicuncached\+IiccachedI\_\{ic\}=I\_\{ic\}^\{\\mathrm\{uncached\}\}\+I\_\{ic\}^\{\\mathrm\{cached\}\}andOic=Oicnormal\+OicreasoningO\_\{ic\}=O\_\{ic\}^\{\\mathrm\{normal\}\}\+O\_\{ic\}^\{\\mathrm\{reasoning\}\}\. The component counts are not added to the input/output totals a second time\. Model tokens are the four model components; combined tokens additionally include the selector’s embedding usage\.
Table E\.1:Full260 token composition, mean per task\. K and M denote thousands and millions of tokens\. Values use the same reporting precision as the main text\.Table[E\.1](https://arxiv.org/html/2609.27332#A5.T1)explains the net reduction in Table[3](https://arxiv.org/html/2609.27332#S6.T3): combined usage decreases from 2\.69M to 2\.11M per task after accounting for embedding cost\. The reduced cached\-input volume more than offsets the additional embedding and uncached\-input volume\. All categories are retained so that the total is interpretable\.
Token accounting is distinct from the physical memory management studied in LLM serving[17](https://arxiv.org/html/2609.27332#bib.bib27)\. The combined\-token measure here includes both cached and uncached input and is used consistently for the efficiency comparison; it is not presented as a direct wall\-clock measurement\.
### E\.3 Reference Panel and Online Ablation Protocol
The current fixed\-40 method comparison is reported in Table[4](https://arxiv.org/html/2609.27332#S6.T4); the current 20\-task online ablation is reported in Table[5](https://arxiv.org/html/2609.27332#S6.T5)\. This appendix specifies their aggregation and method definitions rather than reproducing task\-level records or expanding the tables into individual task outcomes\.
The fixed\-40 panel and the Full260 evaluation retain the comparison scope stated in the main text\. The same\-IDGEMslice and the reference methods are not treated as a newly executed paired comparison\. The online ablation uses the same protected\-set definitions, candidate policy, and valid\-request structure, with only the completion or protection component changed as described in Appendix[D](https://arxiv.org/html/2609.27332#A4)\.Similar Articles
MESA:Task-Adaptive Multi-Structure Evidence Selection for Long-Horizon Agent Memory
This paper introduces MESA, a framework that dynamically selects and fuses a query-adaptive subset of multiple structural memory views for long-horizon agents, achieving 8.5% accuracy improvement over the strongest baseline while using 41% fewer evidence tokens.
Memory Has Geometry: Non-Uniform Geometric Memory for Long-Horizon Personalized AI
The paper proposes modeling memory as a user-specific dynamical state space with non-uniform geometry to enhance long-horizon personalization in AI, enabling trajectory-conditioned reconstruction for better memory access.
EdgeMem: LLM-Free Agent Memory Construction and Retrieval via Evidence-Preserving Multi-Anchor Hypergraph
EdgeMem proposes an LLM-free method for agent memory construction and retrieval using a multi-anchor hypergraph, preserving evidence to improve performance in memory-grounded question answering.
Geometry Conflict: Explaining and Controlling Forgetting in LLM Continual Post-Training
This research investigates how task geometry influences continual post-training in LLMs, identifying 'geometry conflict' as a cause of forgetting and a mechanism for controlling update integration. The authors propose Geometry-Conflict Wasserstein Merging (GCWM), a data-free method that improves retention and performance across various model sizes.
Geometry as Address: Routing Attention to Visual Memory for Long-Horizon Camera-Controlled Video Generation
This paper introduces GEAR, a Geometry-Enabled Attention Routing framework that uses geometry as explicit token-level addresses for visual memory to enhance long-horizon camera-controlled video generation, achieving state-of-the-art results.