TL;DR
ContraMem is a training-free framework that builds a compact, self-evolving procedural memory bank for computer-use LLM agents by contrasting trajectories from different models. By treating same-task behavioral differences as a supervision signal, it extracts reusable rules that more than double agent success rates and transfer seamlessly to unseen models.
What Problem Does This Paper Address?
Large language model (LLM) agents are increasingly deployed to handle complex, long-horizon computer tasks like calling APIs, tracking application states, and executing database writes. However, even frontier models remain brittle, frequently stumbling over procedural details—misunderstanding tool semantics, mistracking state dependencies, or failing to handle ambiguity.
While giving agents "procedural memory" (retaining knowledge from past experiences) can prevent them from repeating mistakes, existing methods face major bottlenecks:
- Blind-spot inheritance: Memories distilled from a single model's rollouts tend to reproduce the exact same gaps and systemic errors inherent to that model's policy.
- Memory bloat and drift: Append-only memory logs or whole-bank rewriting strategies introduce redundancy, propagate stale errors, and cause performance to degrade over time.
Methods
ContraMem introduces an offline, training-free pipeline that leverages heterogeneous multi-model exploration. Instead of relying on a single agent's experience, it collects trajectories from multiple distinct frontier models tackling the exact same task and processes them through three main components:
- The Reflector: Acts as a post-mortem analyzer. By comparing where different models diverged (e.g., success vs. failure, efficient vs. inefficient paths), it isolates the exact "decision boundary" that determined the outcome and abstracts it into a reusable rule.
- Granular Memory Bank: Rather than storing raw text traces, ContraMem splits memory into two distinct layers:
- Function Cards: App-level tool contracts detailing what a function does, safe usage rules, and evidence-supported mistake guards.
- Skill Cards: Task-level decision rules and procedural logic.
- The Curator: To prevent memory bloat, a localized Curator manages the bank. When the Reflector proposes a new memory delta, the Curator applies targeted edits (
ADD,PATCH,MERGE,NARROW, orNOOP) to maintain a compact, high-quality bank.
At runtime, relevant cards are retrieved via BM25 (with a soft app-family prior) and injected as text guidance at the start of a task or just-in-time before tool calls.
Datasets
The authors evaluated ContraMem across two challenging computer-use benchmarks:
- GAIA2/ARE: A dynamic environment testing five core abilities (Execution, Search, Ambiguity, Adaptability, Time) featuring asynchronous state changes and action-level write verification.
- AppWorld: A stateful Python REPL environment where agents orchestrate roughly 450 APIs across 9 applications, evaluated on both Test-Normal and Test-Challenge splits.
Key Insights and Ideas
- Disagreement as Supervision: Multi-model disagreement is a rich, zero-cost supervision signal. When one model succeeds where another fails, the contrast exposes the exact causal boundary separating success from failure.
- Diversity Beats Sampling Volume: Simply sampling more rollouts from the same model (multi-rollout) does not yield high-quality memory. The margin of improvement comes from cross-model behavioral diversity, which effectively cancels out individual model blind spots.
- Curation Over Accumulation: Localized, schema-validated edits by the Curator successfully combat context collapse. In evaluations, curation removed roughly 25% of redundant cards while simultaneously improving downstream task success.
Key Results
- Doubled Success Rates: On held-out GAIA2/ARE tasks, ContraMem more than doubled the macro success rate across three source models, jumping from 26.2% to 55.3%.
- Zero-Shot Model Transfer: A memory bank constructed from GPT-5.5, Claude Sonnet 4.6, and DeepSeek V4 Pro transferred completely unchanged to an unseen target model (Qwen3.7 Plus), boosting its success rate from 18.5% to 35.5%. This proves the memory captures transferable procedural knowledge rather than model-specific behavioral fixes.
- Cross-Benchmark Validation: On AppWorld, ContraMem consistently outperformed "no memory" baselines and single-source "self-memory" variants, raising Test-Normal task goal completion from 54.4% to 75.0%.
- Improved Efficiency: Alongside accuracy gains, ContraMem reduced the average trajectory length by 13.6% on GAIA2, helping agents find shorter, cleaner paths to success.
Limitations and Future Work
- Bounded by Source Failures: ContraMem is fundamentally bounded by the exploration of its source models. If all source models fail at the exact same step without demonstrating any recovery behavior, the Reflector can only generate diagnostic or recovery tips rather than a successful recipe.
- The Limits of Text Injection: The framework struggled to improve the "Time" ability in GAIA2/ARE, where tasks require tracking asynchronous notifications against a simulated clock. The authors note that text-injected memory cannot replace a dedicated runtime controller for complex temporal tracking.
Summary updated