Source-linked AI summary
MeClear: Cooperative Game-Theoretic Attribution and Risk-Aware Memory Clearance for Long-Horizon LLM Agents
Boyu Yang, Jiazheng Sun, Zilong Lu, Zhi Qiu, Xin Peng, Jun Zheng
TL;DR
Long-horizon agents can retrieve memories that are semantically relevant but harmful, outdated, or conflicting for the current task. MeClear uses cooperative attribution to identify such memories, then performs reversible minimal clearance with verified recovery, achieving 85.9% target recall and 82.3% task recovery, 25.5 percentage points above LOO baselines.
Problem
Semantic retrieval can introduce outdated, misleading, redundant, or conflicting evidence because relevance does not guarantee downstream task utility.
Method
MeClear combines LOO screening, sampled cooperative Shapley attribution, and query-scoped minimal clearance with recovery verification without permanently altering memory.
Results
85.9% target recall and 82.3% overall task recovery represent a 25.5 percentage point improvement over LOO baselines.
Takeaways & Limitations
Coalition-aware, reversible context clearance supports non-destructive memory maintenance while preserving beneficial task context.
Abstract
from arXiv · showhide
Long horizon Large Language Model (LLM) agents rely on external memory systems to preserve user preferences and task knowledge across extended interactions. Conventional retrieval mechanisms optimize semantic compatibility rather than downstream utility, frequently introducing outdated, misleading, or conflicting evidence into the active context. We present MeClear, a task conditioned memory clearance framework that identifies memories featuring negative downstream utility through cooperative attribution and selectively suppresses them from agent execution. MeClear combines Leave One Out screening with sampled cooperative Shapley attribution to distribute utility across interacting evidence, effectively resolving redundant conflict masking where single removal evaluations fail. Utilizing attribution rankings, MeClear executes a query scoped minimal clearance strategy over a nested filtration, verifying task recovery on the cleared context without permanently altering the persistent memory bank. Comprehensive experimental evaluations across ten long dialogue memory pools demonstrate that MeClear achieves a target recall of 85.9% and an overall task recovery rate of 82.3%, representing a 25.5 percentage point improvement over Leave One Out (LOO) baselines.
Introduction
MeClear addresses harmful retrieved memories by combining cooperative attribution with reversible, query-scoped context clearance. Across ten memory pools, it reports 85.9% target recall and 82.3% task recovery, improving over LOO baselines by 25.5 percentage points.
- Semantic relevance can retrieve stale, misleading, redundant, or incompatible memories that harm downstream tasks.
- Single-record deletion can miss jointly harmful memories when redundant evidence masks each record’s counterfactual effect.
- MeClear combines LOO screening with sampled cooperative Shapley attribution to model interacting memory contributions.
- MeClear performs query-scoped minimal clearance and verifies task recovery without permanently altering the persistent memory bank.
- 85.9% target recall and 82.3% overall task recovery improve over LOO baselines by 25.5 percentage points.
Related Work
Prior memory systems improve storage and retrieval, but semantic retrieval alone does not guarantee downstream utility. Existing evaluation and filtering approaches provide limited causal attribution and do not fully capture interaction-dependent harms or verify safe clearance.
- External-memory research spans heuristic retrieval, hierarchical context, reflection, graph representations, consolidation, and reinforcement learning.
- Superior retrieval does not guarantee downstream task utility, motivating evaluation of post-retrieval functional effects and contextual interactions.
- Long-term memory benchmarks assess response quality but provide limited causal credit assignment for individual records.
- Operation-level rewards and single-record interventions miss interaction-dependent phenomena such as mutual redundancy.
- Permanent memory modification risks irreversible cross-task errors, while retrieval-time filtering avoids overwrites but does not verify interacting harmful memories.
Problem Formulation
MeClear evaluates retrieved memories as a query-conditioned cooperative game whose value is expected task utility. It identifies harmful memories through coalition-aware attribution and selects the smallest clearance achieving maximal task recovery.
- The retriever forms a bounded context Mt from memory bank Bt for query qt, while MeClear evaluates the already retrieved context rather than replacing retrieval.
- Coalition value vt(S) is the query-conditioned expected task utility of agent outputs generated from memory subset S.
- Cooperative attribution measures each memory’s marginal effect across diverse predecessor coalitions, capturing redundancy and complementarity.
- A memory is harmful when its attribution is below the tolerance threshold τ, indicating decreased task utility across coalition contexts.
- Harmfulness is query-conditioned and depends on the current query, retrieved context, agent, and task-value function rather than being intrinsic to a record.
- The clearance objective first maximizes task gain and then minimizes the number of removed memories among equally effective interventions.
Method
MeClear evaluates retrieved memories by task-conditioned utility rather than semantic compatibility alone, combining local screening, cooperative attribution, interaction diagnosis, and verified query-scoped clearance. It freezes the retrieved context, ranks harmful memories, and tests a nested sequence of removals without modifying persistent storage.
- Architecture: The architecture combines adaptive retrieval, local screening, cooperative attribution, and verified clearance while suppressing harmful memories only from active context.Persistent storage remains unchanged, and the design uses context capacity, permutation budget, and one tolerance threshold rather than stage-specific tuning coefficients.
- Adaptive Task-Conditioned Context Retrieval: MeClear retrieves a query-dependent context and evaluates agent behavior on memory coalitions separately from retrieval compatibility.The retrieved context is frozen before interventions, so subsequent behavioral changes are attributable to memory removal.
- Local Counterfactual Screening: LOO screening provides an interpretable local signal, but zero or near-zero effects can conceal harm when substitutable memories sustain task failure.MeClear therefore uses LOO for screening rather than as a definitive harmfulness criterion.
- Counterfactual Cooperative Attribution: Sampled Shapley attribution estimates each memory’s marginal contribution across predecessor coalitions, exposing negative utility masked by redundancy or substitution.Sampling avoids enumerating all permutations while preserving beneficial, neutral, and harmful memories in coalition contexts.
- Counterfactual Cooperative Attribution: Pairwise interaction profiles diagnose substitution, complementarity, and joint interference as non-additive structural dependencies rather than semantic categories.These profiles extend individual attribution to higher-order evidence interactions.
- Verified Query-Scoped Clearance: MeClear orders harmful memories by estimated negative contribution and searches a nested clearance sequence, reducing candidates from 2^ht arbitrary subsets to ht + 1 contexts.Each candidate is evaluated for query-scoped task recovery before output generation.
Experiments
Across 745 causally verified cases from ten long-dialogue memory pools, MeClear outperforms baselines in attribution and downstream recovery, with the largest gains under redundant and joint memory dependencies. Its verified clearance also improves recovery while limiting context distortion.
- Evaluation Setup: 745 causally verified test cases cover 1,115 fault records synthesized from 368 clean queries across ten LoCoMo conversations.The evaluation includes direct conflicts, redundant conflicts, and joint interactions under a hybrid retrieval budget K = 5.
- Overall Results: 85.9% memory micro-recall and 82.3% binary task recovery make MeClear stronger overall than LOO, ContextCite, ProxySPEX, and Qwen3.5-Plus.MeClear also achieves 47.0% exact fault set identification; paired comparisons report recovery gains of +25.5% over LOO, +5.0% over ProxySPEX, and +38.7% over Qwen3.5-Plus.
- Performance Across Structural Fault Mechanisms: 83.2% recall and 89.6% recovery in direct conflicts show MeClear performs strongly even when single-record effects are observable.The direct-conflict comparison uses n = 375 cases.
- Performance Across Structural Fault Mechanisms: 83.2% recall, 49.1% exact identification, and 68.4% recovery under redundant conflicts contrast with LOO’s 12.3% recall and 6.3% recovery.The redundant-conflict comparison uses n = 285 cases and targets masking caused by local substitution.
- Performance Across Structural Fault Mechanisms: 87.1% recall and 91.8% recovery under joint interactions show MeClear handles higher-order dependencies where LOO reaches 0.0% exact match.The joint-interaction comparison uses n = 85 cases.
- Query-Scoped Clearance and Context Composition: 80.5% overall recovery comprises 44.0% exact-set recovery and 36.5% harmless over-selection, with 14.8% unrecovered failures.LOO has 40.5% failures, while direct LLM filtering has 52.8% failures from overtruncation or hallucinated deletion.
Conclusion
MeClear frames coalition-aware context clearance as a safe, non-destructive approach to maintaining long-horizon agent memory. Across ten long-dialogue memory pools, it improves target recall and task recovery over LOO baselines.
- Conclusion: 85.9% target recall and 82.3% task recovery rate were achieved across ten long dialogue memory pools.The evaluation reports these outcomes for MeClear.
- Conclusion: 25.5 percentage points improvement over Leave-One-Out baselines was reported for task recovery.The comparison is stated in the experimental summary.
- Conclusion: MeClear establishes coalition-aware context clearance as a foundational pillar for safe, non-destructive agent memory maintenance.The framework clears active context without permanently altering the underlying memory bank.
- Conclusion: The appendix supplements the page-limited main paper with theoretical analyses, experimental details, and complete baseline configurations.Appendix A analyzes redundant-harm blind spots, while later appendices provide estimation and clearance guarantees.
A.1 Proof of Theorem 1
Theorem 1 formalizes a redundant-harm blind spot: single-memory LOO deletion can show no effect even when each memory contributes harmful utility under coalition evaluation. Cooperative attribution exposes this harm by averaging marginal effects across permutation-defined predecessor coalitions.
- A.1 Proof of Theorem 1: Removing either of two redundant harmful memories leaves the penalty active, so both exact LOO effects equal zero.The proof uses a model where the penalty applies whenever at least one of the two memories remains.
- A.1 Proof of Theorem 1: −∆t/2 is the cooperative contribution assigned to each of the two redundant harmful memories.Each memory activates the penalty first in half of uniformly random relative orderings.
- A.1 Proof of Theorem 1: Coalition-level marginal evaluation can reveal harmful contributions that remain invisible under single-memory deletion.The result is limited to showing that zero LOO effect does not exclude harmful cooperative contribution.
- A.1 Proof of Theorem 1: MeClear treats LOO effects within tolerance κ as locally inconclusive and determines the operational harmful set using sampled contributions with harm tolerance τ.LOO remains a screening profile rather than the definitive harmfulness criterion.
- A.1 Proof of Theorem 1: For a redundant group of r memories, LOO assigns zero effect to every member while cooperative attribution assigns each member −∆t/r.The total penalty is introduced when the first group member appears in a permutation.
Appendix B: Finite-Sample Cooperative Estimation
Appendix B analyzes sampled cooperative attribution for a fixed empirical game, establishing unbiasedness and a uniform accuracy guarantee. It also clarifies that the resulting sample bound is sufficient rather than practically necessary or optimal.
- Appendix B: Finite-Sample Cooperative Estimation: Sampled permutation contributions are independent and identically distributed for each fixed memory conditional on the empirical value function.Their expectation equals the corresponding empirical Shapley value.
- Appendix B: Finite-Sample Cooperative Estimation: The empirical Shapley estimates are unbiased for the fixed empirical game.This follows from linearity of expectation applied to independently sampled permutations.
- Appendix B: Finite-Sample Cooperative Estimation: Hoeffding’s inequality and a union bound provide a uniform finite-sample accuracy guarantee across the K memories.The proof does not require independence across memories because concentration is applied separately for each fixed memory.
- Appendix B: Finite-Sample Cooperative Estimation: Equation (39) gives a sufficient worst-case sample-size bound based only on bvt(S) ∈ [0, 1].The bound is not claimed to be necessary or optimal in practice.
- Appendix B: Finite-Sample Cooperative Estimation: If exact contributions are separated from the harm threshold by more than the estimation error, the estimated harmful set and sufficiently separated rankings are preserved with probability at least 1 −δ.The ordering guarantee applies when contribution gaps exceed twice the estimation error.
- Appendix B: Finite-Sample Cooperative Estimation: The finite-sample proposition controls approximation error for the empirical game, not the difference between empirical and population contributions.Relating the empirical evaluator to the population value function requires an additional assumption.
C.1 Proof of Theorem 2
Theorem 2 shows that MeClear selects an admissible clearance candidate with nonnegative empirical gain, verifies recovery for any positive-gain selection, and minimizes clearance size among maximum-gain admissible candidates.
- C.1 Proof of Theorem 2: The baseline candidate guarantees that the selected empirical gain is at least zero.The unchanged context is always admissible with zero gain.
- C.1 Proof of Theorem 2: Any selected positive-gain candidate satisfies the recovery predicate on the cleared context.Recovery is an explicit admissibility condition for every positive candidate.
- C.1 Proof of Theorem 2: The nested candidate construction ensures the selected maximum-gain clearance has minimum cardinality among admissible candidates attaining that gain.Candidate sets grow by one memory at each filtration step.
- C.1 Proof of Theorem 2: If no positive candidate satisfies gain and recovery conditions, MeClear returns the unchanged context.Otherwise, it returns a positive candidate whose cleared context satisfies recovery.
C.2 Scope of the Guarantee and Evaluator Error
The guarantee applies only to a nested clearance family and an operational harmful set produced by attribution, while evaluator-error conclusions remain conditional rather than population-wide.
- Scope of the guarantee: Theorem 2 guarantees empirical non-degradation, verified recovery for positive admissible selections, and minimum cardinality among maximum-gain candidates within the nested family.It does not establish global optimality over all subsets of the estimated harmful set.
- Scope of the guarantee: The guarantee is conditional on the operational harmful set and does not assert that it equals the unknown exact harmful set.
- Evaluator error: If the evaluator error is uniformly bounded by η_t, the selected gain is at least −2η_t, and it is positive when the empirical gain exceeds 2η_t.
- Evaluator error: The positive-gain conclusion is conditional on Equation (45) and does not become an unconditional population guarantee.
D.1 Experimental Setup
The supplementary evaluation uses a fixed paired cohort of LoCoMo cases spanning direct, redundant, and joint interactions, and examines method performance, sensitivity, and risk trade-offs.
- Cohort: The evaluation uses 745 valid causally verified cases from ten conversations, containing direct, redundant, and joint interaction structures.The cohort includes 1,115 fault records and excludes two cases because complete attribution outputs were unavailable.
- Interaction-by-fault evaluation: Across redundant-fault categories, MeClear achieves 81.9–84.8% Recall@|M| versus 10.7–16.1% for LOO.
- Sensitivity analysis: Figure 9 reports Recall@|M|, Complete Set Recall, Exact Set Match, and extra-background selection with 95% two-level cluster-bootstrap intervals across permutation budgets.
- Configuration: MeClear is evaluated with retrieval budget K = 5, permutation budget L = 16, and tolerance settings κ = τ = 0.05.Sensitivity analysis also varies the permutation budget across L ∈ {4, 8, 16}.
- Risk analysis: The risk frontier compares residual-error risk, extra background memories selected per case, and Binary Task Recovery, with lower values preferred on the first two axes.
- Sensitivity analysis: MeClear reaches 85.9% Recall@|M| at L = 16, compared with 67.6% at L = 4, while extra-background selection is nonmonotonic across budgets.
D.3 Metrics and Supplementary Evaluation
The evaluation measures ranking, harmful-set completeness, selection precision, and task recovery, using paired comparisons and supplementary rank and risk analyses.
- Metrics: Recall@|M|, Complete Set Recall, Exact Set Match, and Binary Task Recovery respectively measure ranking quality, harmful-set completeness, selection precision, and task recovery.
- Paired evaluation: All method comparisons use the same paired cohort of 745 cases with hierarchical two-level cluster-bootstrap confidence intervals.The analysis uses 2,000 bootstrap replicates and computes paired differences before resampling.
- Comparator results: MeClear improves over LOO by 47.6, 22.6, 12.8, and 25.5 percentage points in Recall@|M|, Complete Set Recall, Exact Set Match, and Recovery, respectively.
- Risk frontier: MeClear achieves 13.3% residual-error risk and 82.3% Binary Task Recovery while selecting 0.623 extra background memories per case.
- Rank concentration: At ranks 2 and 3, MeClear reaches 88.1% and 93.6% target coverage, while ContextCite is slightly higher at rank 1.