arXiv(opens in a new tab)cs.AIAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.22533

CONTRAMEM: Learning Self-Evolving Procedural Memory from Contrasting Multi-Model Trajectories

Zheyuan Deng, Binghang Lu, Hanqi Feng, Shirley Huang, Dianzhuo Wang, Yuanda Xu, Zhiwei Zhang, Yige Sun, Changhong Mou, Runyu Zhang, Yuexing Hao, Barnabas Poczos, Xiaomin Li

Abstract

Autonomous computer-use agents are increasingly applied to long-horizon tasks requiring coordinated application calls, persistent state tracking, and verifier-sensitive writes, yet they remain prone to procedural failures—misreading application state, tool semantics, or task progress. Procedural memory promises more consistent decisions and less redundant exploration, but constructing high-quality memory without model training remains challenging. We introduce CONTRAMEM, a source-flexible, training-free framework for self-evolving procedural memory that treats same-task outcome variation as supervision: differences in correctness, efficiency, recovery, and failure modes expose outcome-relevant procedural distinctions, distilled into a compact bank of app-level Function Cards and task-level Skill Cards that evolves through localized curation rather than append-only accumulation or whole-bank rewriting. On held-out GAIA2/ARE computer-use tasks, CONTRAMEM more than doubles the success rate across the three source-model targets (26.2% to 55.3%), with consistent per-model gains (GPT-5.5: 27.5 → 61.0; Claude Sonnet 4.6: 28.0 → 52.5; DeepSeek V4 Pro: 23.0 → 52.5). The same bank transfers unchanged to the unseen Qwen3.7 Plus (18.5 → 35.5), indicating transferable procedural knowledge rather than model-specific behavior. The same construction carries over unchanged to AppWorld, beating both no memory and its own single-source self-memory variant for all three mid-tier agents on both public test splits. Under a matched trajectory budget, heterogeneous multi-model trajectories yield stronger memory than self- or same-model multi-rollout memory: the margin comes from contrastive behavioral diversity, not stronger source agents or more sampling.

Introduction

Large language models are increasingly deployed as autonomous computer-use agents that interleave reasoning with action (Yao et al. 2022), invoke application functions and external tools (Schick et al. 2023; Patil et al. 2024; Li et al. 2023), and issue state-changing writes across realistic, multi-application environments (Lu et al. 2025; Trivedi et al. 2024; Froger et al. 2026). A successful agent in this regime must select the correct function, construct valid arguments, interpret asynchronous and often empty observations, maintain pending obligations, and stop only once the task is genuinely complete—and this difficulty does not disappear with scale: even strong models remain brittle on long-horizon tasks with state dependencies, temporal constraints, and verifier-sensitive writes (Trivedi et al. 2024; Froger et al. 2026). A natural, training-free way to close this gap is procedural memory: retained knowledge lets an agent avoid re-deriving equivalent searches, repeating the same function misuse, or relapsing into identical recovery failures (Shinn et al. 2023; Zhao et al. 2024; Wang et al. 2023b; Park et al. 2023; Packer et al. 2023).

Yet turning past experience into high-quality procedural memory without updating model weights is structurally difficult: raw retrieval transfers brittle surface detail instead of reusable logic, per-trajectory summaries miss the causal boundary separating success from failure, and same-model resampling suffers from blind-spot inheritance—a memory distilled from one policy reproduces the very gaps that caused its failures. Append-only accumulation compounds this with redundancy and drift: agents over-follow retrieved experience, propagate stale errors, and degrade as continuously updated memories accumulate faults (Fang et al. 2026; Xiong et al. 2025; Zhang et al. 2026; Xu et al. 2026; Zhang et al. 2025). The question is how to keep the bank compact, grounded, actionable, and retrievable as it evolves.

We identify heterogeneous exploration as an underused source of such memory—much as a team post-mortem that compares several attempts at the same incident teaches more than any single log. When distinct models attempt the same computer-use task, their behavior diverges informatively: one run succeeds where another fails, one path is markedly shorter, one model recovers where another stalls, or several fail at a common operation: same-task differences in correctness, efficiency, recovery, and failure that are not noise to be averaged away but supervision that multi-model practice already produces, at no extra labeling cost. Examining multiple paths surfaces stronger strategies than any single execution (Yao et al. 2023; Besta et al. 2024; DeepSeek-AI et al. 2025; Guo et al. 2026; Chang et al. 2026; Tang et al. 2025); for computer-use agents, such paths need not be consumed at test time and discarded. Instead, they can be distilled offline into reusable memory for future single-agent executions.

∗^{*}These authors contributed equally.

†^{\dagger}Corresponding author.

No memory

Self memory

CONTRAMEM

(a) GAIA2/ARE

Figure

(b) AppWorld: Test-Normal

Figure

(c) AppWorld: Test-Challenge

Figure

Figure 1: Held-out success averaged over three source targets (GAIA2/ARE) and target-macro TGC/SGC (AppWorld): CONTRAMEM beats self memory on every metric.

Building on this view, we introduce CONTRAMEM, a training-free, source-flexible framework that converts execution trajectories into a compact procedural memory bank. Given one or more trajectories for a reference task, CONTRAMEM extracts outcome-relevant distinctions along four axes—correctness, efficiency, recovery, and recurring failure—and distills them, rather than the raw traces, into Function Cards (app-level tool contracts) and Skill Cards (task-level decision rules), maintained by a local Curator through small, targeted edits. Figure 2 summarizes this offline construction and the subsequent frozen-bank runtime. CONTRAMEM does not require source diversity; it improves execution even from a single model's own trajectories. It reaches its strongest form, however, when sources are heterogeneous, transposing the central intuition of contrastive representation learning (van den Oord, Li, and Vinyals 2018; Chen et al. 2020; He et al. 2019) from representations to agent behavior: several models' attempts at one task are multiple views of its procedural structure, and their disagreements form a supervision signal that no single model can reliably supply, because same-model rollouts inherit one policy and one set of blind spots. The analogy is conceptual, not algorithmic: no embeddings, no contrastive objective. Multimodel exploration stays offline; deployment uses one target agent, and no parameters are updated.

We evaluate CONTRAMEM on GAIA2/ARE, a dynamic app-agent benchmark with asynchronous state changes, ambiguity, time-sensitive obligations, and action-level write verification (Froger et al. 2026; Andrews et al. 2025), with GPT-5.5, Claude Sonnet 4.6, and DeepSeek V4 Pro as sources—a high-capability frontier where gains reflect headroom beyond raw capability. Across the three source target models, CONTRAMEM more than doubles held-out success (26.2%→55.3%), transfers the bank unchanged to Qwen3.7 Plus, an unseen target (18.5→35.5), and lands 30.0 points above the strongest prior memory system (Figure 3); Figure 1 summarizes this progression alongside AppWorld, where the same construction beats both no memory and target-specific self memory for all three mid-tier agents on both public test splits (Trivedi et al. 2024). Controlled ablations confirm the gains stem from cross-model heterogeneity rather than stronger sources or more sampling (Table 3).

Our contributions are threefold:

  1. CONTRAMEM: a source-flexible, training-free framework for self-evolving procedural memory, treating cross-model behavioral contrast as procedural supervision.

  2. A granularity-aware representation pairing app-level Function Cards with task-level Skill Cards, maintained by a localized Curator through targeted edits.

  3. Controlled evaluations that separately quantify the architecture’s single-source gains and the added value of heterogeneous contrast, with transfer to an unseen target and cross-benchmark validation on AppWorld.

References (49)