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

MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation

Forum topic · 小凯 · 2026-03-26

Summary

MemCollab is a 2026 arXiv paper (arXiv:2603.23234) proposing a method that lets AI agents share memory across model boundaries. The authors show that naively copying memory between agents hurts performance: on MATH500, a Qwen2.5-7B model dropped from 52.2% to 50.6% accuracy when given memories directly transferred from a 32B model, and on HumanEval performance fell from 42.7% to 34.1%. The problem is knowledge entanglement - useful, task-general principles are mixed with model-specific reasoning styles, tool habits, and error patterns. MemCollab pairs a weaker and a stronger agent on each task, verifies their answers, and contrastively distills success-failure trajectory pairs into abstract rules (violation patterns and reasoning invariants) rather than stored examples. A two-stage, task-aware retrieval pipeline classifies new problems and fetches the top-3 relevant memories. Experiments show substantial gains: Qwen2.5-7B improves from 52.2% to 67.0% on MATH500 and from 47.9% to 57.6% on MBPP; cross-family transfer lifts LLaMA3-8B from 46.6% to 74.4%. Memory count shows an inverted-U effect with a sweet spot around 3 entries. The work suggests a path toward collaborative multi-agent systems where smaller models approach larger-model performance through shared, distilled memory.

MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation

*An explainer (originally written in Feynman-style Chinese for zhichai.net) of the arXiv paper "MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation" (arXiv:2603.23234).*

The problem: AI memory is locked in silos

LLM-based agents accumulate memory - solution techniques, error lessons, tool tips - from past experience. Today each agent keeps its own memory. This causes:

  • Redundant work: ten agents solving the same problem type each repeat trial-and-error independently.
  • Capability boundaries: can a small model's (7B) memory help a large model (32B), or vice versa?
  • Resource waste: real deployments use small models for cheap tasks and large models for hard ones; each building memory separately is expensive.
  • Naive sharing makes things worse

    Directly copying memory between agents degrades performance:

    | Task | Baseline (7B) | With directly transferred 32B memory | |------|---------------|---------------------------------------| | MATH500 | 52.2% | 50.6% | | HumanEval | 42.7% | 34.1% |

    The cause is knowledge entanglement: generic solution principles are entangled with model-specific reasoning styles, tool-usage habits, and idiosyncratic failure modes. Transferring memory wholesale transfers these "personal imprints" as noise.

    Core idea: contrast across agents

    Just as comparing one correct and one incorrect solution to the *same* problem reveals the decisive factors, MemCollab compares trajectories from two agents:

  • A weaker agent (Aw), e.g., a 7B model, and a stronger agent (As), e.g., a 32B model, each attempt every task.
  • A verifier labels trajectories as preferred (τ+) or dispreferred (τ−) - either agent can produce either outcome.
  • Formally, a trajectory τ = g(s, b), where s is task structure (shared across agents) and b is agent bias (agent-specific). Contrastive distillation learns a memory m = φ(s) that captures what persists in success and is missing/broken in failure:

  • Violation patterns: systematic errors seen in failures (e.g., premature numeric computation before forming equations; assuming independence without verification).
  • Reasoning invariants: principles preserved in successes (e.g., establish variable dependencies first; systematically enumerate cases).
  • Memories are stored as operational rules ("do X, avoid Y"), not example solutions, making them abstract, actionable, and transferable.

    Task-aware retrieval

    A two-stage pipeline: (1) classify the new problem (algebra, geometry, probability, etc.); (2) rank and retrieve the top-3 relevant memories within that category, avoiding interference from irrelevant rules.

    Results

    | Setting | No memory | With MemCollab | Gain | |---------|-----------|----------------|------| | Qwen2.5-7B, MATH500 | 52.2% | 67.0% | +14.8% | | Qwen2.5-32B, MATH500 | 68.0% | 73.8% | +5.8% | | Qwen2.5-7B, MBPP | 47.9% | 57.6% | +9.7% | | Qwen2.5-32B, MBPP | 59.4% | 64.3% | +4.9% | | LLaMA3-8B, cross-family | 46.6% | 74.4% | +27.8% |

    Additional findings:

  • Cross-model contrast beats self-contrast: a model comparing its own successes and failures helps, but far less than comparing across models - perspective differences are what filter out model-specific bias.
  • Efficiency: fewer reasoning rounds are needed since known dead-end paths are pruned.
  • Inverted-U memory curve: performance improves with 1-3 retrieved memories, then declines beyond ~3, as excessive constraints add noise. Memory acts as search-space pruning.
  • Why it works

  • Contrastive learning view: positive/negative trajectory pairs expose discriminative, task-level features while canceling shared task structure and isolating differing biases.
  • Information view: memory distillation maximizes I(task structure) while minimizing I(model bias) and noise.
  • Cognitive science echo: experts rely on structured mental models (problem type, core concepts, common pitfalls) rather than memorized steps.
  • Broader significance

  • Small models get a leg up: with MemCollab, a 7B model can approach or exceed a memory-less 32B model - cheaper, more efficient deployments.
  • Multi-agent systems: heterogeneous model teams can build a shared collective memory rather than isolated islands.
  • Continual learning: shared memory can grow as agents discover new techniques and failure modes.
  • Future directions: scaling beyond two agents, meta-learning (learning how to learn problem structure), self-evolving memory, and cross-modal applications (vision, robotics, 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

#ai-agents#memory-sharing#multi-agent-systems#contrastive-learning#llm-reasoning#knowledge-distillation#arxiv-paper

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/177169049