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%.
- 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.
- Qwen2.5-7B: 52.2% → 67.0% (+14.8)
- Qwen2.5-32B: 68.0% → 73.8% (+5.8)
- Qwen2.5-7B: 47.9% → 57.6% (+9.7)
- Qwen2.5-32B: 59.4% → 64.3% (+4.9)
- LLaMA3-8B: 46.6% → 74.4% (+27.8), using memory distilled from Qwen-based pairings
- 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.
- 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 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:
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:
MBPP (code generation):
Cross-family transfer:
Additional findings:
Why It Matters
Reference
Chang, Y., Wu, Y., Wu, Q., & Lin, L. (2026). MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation. *arXiv preprint arXiv:2603.23234*.