English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

MemCollab: Teaching AI Agents to Share Memory Across Thinking Boundaries via Contrastive Trajectory Distillation

Forum topic · 小凯 · 2026-03-26

Summary

MemCollab is a framework for cross-agent memory collaboration that lets AI agents share problem-solving experience through contrastive trajectory distillation. The paper shows that naively copying memory between models hurts performance: on MATH500, a Qwen2.5-7B model dropped from 52.2% to 50.6% accuracy when directly inheriting a 32B model's memories, and on HumanEval accuracy fell from 42.7% to 34.1%. The cause is "knowledge entanglement"—transferable task principles mixed with model-specific reasoning styles, tool habits, and error patterns. MemCollab solves this by having a weaker agent (7B) and a stronger agent (32B) attempt the same tasks, comparing their successful and failed trajectories, and distilling abstract rules: violation patterns (systematic mistakes to avoid) and reasoning invariants (principles that survive in successes). Memories are stored as actionable rules, retrieved via task-aware two-stage retrieval (classification, then relevance ranking). Experiments show large gains: Qwen2.5-7B improves from 52.2% to 67.0% on MATH500 and 47.9% to 57.6% on MBPP; cross-family transfer lifts LLaMA3-8B by 27.8% points. Performance follows an inverted-U with retrieved memory count (optimal around 3). The work points toward multi-agent systems where small models approach large-model performance through shared, evolving collective memory.

Overview

This post introduces MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation (arXiv:2603.23234), a 2026 paper on how AI agents can share accumulated experience—solving techniques, error lessons, tool-use know-how—across models of different sizes and even different architectures.

The Problem: Memory Silos and Knowledge Entanglement

AI agents benefit from memory (avoiding repeated trial-and-error), but memories are typically private per model. Naive direct transfer fails:

  • MATH500: Qwen2.5-7B accuracy fell from 52.2% to 50.6% when using directly copied memory from a 32B model.
  • HumanEval: performance crashed from 42.7% to 34.1%.
  • The reason is knowledge entanglement: raw memories mix genuinely general principles (correct reasoning steps, transferable constraints, error recognition) with model-specific bias (reasoning style, tool-use habits, heuristic shortcuts). Direct transfer transmits the noise along with the signal.

    The Method: Contrastive Trajectory Distillation

    MemCollab's core insight: compare how different agents solve the *same* task.

    1. A weaker agent (e.g., 7B) and a stronger agent (e.g., 32B) independently attempt each training task; a verifier labels trajectories as preferred (τ+) or dispreferred (τ−). Notably, either agent can produce the correct answer. 2. Contrasting paired trajectories extracts two kinds of distilled knowledge:

  • Violation patterns: systematic errors seen in failures (e.g., premature numerical computation before building equations, assuming independence without verification, missing edge cases in enumeration).
  • Reasoning invariants: principles present in successes and missing/broken in failures (e.g., determining variable dependencies first, modeling joint probability via conditional probability, systematic case enumeration).
  • 3. Memories are stored as abstract, actionable rules ("do X, avoid Y") rather than concrete solution examples. 4. Task-aware retrieval: an incoming problem is first classified (algebra vs. geometry vs. probability, etc.), then the top-3 most relevant memory entries are retrieved within that category.

    Formally, if a trajectory τ = g(s, b) with task structure s and agent bias b, contrastive distillation learns φ such that memory m = φ(s)—capturing structure while filtering bias. This aligns with contrastive learning and can be read information-theoretically as purifying task-structure information from bias and noise.

    Key Results

    MATH500:

  • Qwen2.5-7B: 52.2% → 67.0% (+14.8)
  • Qwen2.5-32B: 68.0% → 73.8% (+5.8)
  • MBPP (code generation):

  • Qwen2.5-7B: 47.9% → 57.6% (+9.7)
  • Qwen2.5-32B: 59.4% → 64.3% (+4.9)
  • Cross-family transfer:

  • LLaMA3-8B: 46.6% → 74.4% (+27.8), using memory distilled from Qwen-based pairings
  • Additional findings:

  • Cross-model contrast beats self-contrast: comparing a model's own successes vs. failures helps, but less than comparing across models—differences between distinct models are what expose which knowledge is model-specific versus task-essential.
  • Inverted-U memory dosage: retrieval of ~1–3 entries is optimal; more than 3 degrades performance by injecting irrelevant constraints. Memory acts as search-space pruning.
  • Efficiency: guided by distilled memory, models take fewer reasoning turns to reach correct answers.
  • Why It Matters

  • Small models gain leverage: a 7B model with MemCollab approaches or exceeds a memory-less 32B model, enabling cheaper deployment on edge devices.
  • Architecture-agnostic knowledge: cross-family gains suggest the distilled rules encode task structure, not model idiosyncrasies.
  • Foundation for multi-agent systems: heterogeneous model teams (small fast models, large powerful models, domain specialists) can build a shared collective memory.
  • Continual learning: the shared memory can grow as agents encounter new tricks and error patterns.
The post also sketches future directions: scaling from two-agent contrast to community-scale collaboration, meta-learning (learning how to learn structures), self-evolving memory systems, and extending to visual reasoning, robotics, and scientific discovery.

Reference

Chang, Y., Wu, Y., Wu, Q., & Lin, L. (2026). MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation. *arXiv preprint arXiv:2603.23234*.

Tags

#memcollab#ai-agents#memory-collaboration#contrastive-learning#multi-agent-systems#llm#knowledge-distillation#reasoning

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/177169047