Back Home

代理與強化學習

MemHarness Rewrites Agent Memory Before Acting, Raising 7B Model’s ALFWorld Success Rate to 85.2%

Instead of replaying retrieved past experiences verbatim, MemHarness has the same policy model critique and reorganize them based on the current state before deciding how to act. After end-to-end training with GRPO, it achieved success rates of 85.2% on ALFWorld and 75.6% on WebShop, though the code and model weights have not yet been released.

Rufus Sarsaparilla on wikipédia en · Public domain · Image source
zh-Hant

Agent memory systems often retrieve past experiences and insert them directly into the context. However, object locations, available actions, and intermediate states described in previous trajectories may not apply to a new task. MemHarness divides the process into five stages: observation, retrieval, critique, reorganization, and action. The agent first retrieves three relevant principles from an experience repository. The same policy model then identifies content that conflicts with the current state and rewrites it into actionable guidance. The key is not to add another general-purpose LLM for text processing, but to train memory adaptation and the action policy together using environmental feedback.

The study uses Qwen2.5-7B-Instruct as its backbone. It begins with a cold-start phase using 200 multi-turn interaction trajectories and 200 trajectory-summary pairs, followed by GRPO training. The experience repository is initially empty and is populated during training as the policy model derives principles from its own trajectories. BGE-M3 handles vector retrieval. Eight trajectories are sampled for each prompt across a total of 128 parallel environments. Successful runs receive a reward of 10, failed runs receive 0, and a small formatting reward is also included.

In ALFWorld, a text-based household manipulation environment, MemHarness achieved an average success rate of 85.2% across six task categories, compared with 76.4% for plain GRPO. On WebShop, the shopping agent’s success rate rose from 66.1% to 75.6%. Directly injecting memories without rewriting them reduced ALFWorld performance to 70.1%, indicating that retrieving more content can cause negative transfer. In an ALFWorld out-of-distribution (OOD) evaluation featuring unseen room layouts and object locations, MemHarness scored 85.9%, while the verbatim-replay baseline scored 76.3%. Replacing the internal reorganization module with a general-purpose Qwen2.5-7B model also lowered the ALFWorld score from 85.2% to 77.7%.

These results have direct implications for long-running customer-service, browser, and robotics agents: the memory layer cannot optimize only for recall and must also validate whether retrieved information applies to the current state. However, the comparison remains limited to two simulated environments, and some scores for closed models were obtained under specific prompting and interaction budgets, so they should not be interpreted as a general capability ranking. The paper also does not release code, checkpoints, training GPU hours, or measurements of the additional latency introduced by memory rewriting. Further engineering validation is needed to determine whether, with longer trajectories, irreversible tool operations, and contaminated memories, the reorganizer might rewrite incorrect experiences into guidance that is even more persuasive.

Sources

  1. MemHarness: Memory Is Reconstructed, Not Replayed
  2. ALFWorld: Aligning Text and Embodied Environments for Interactive Learning