Overview
This forum post introduces MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation (Chang, Wu, Wu, & Lin, 2026, arXiv:2603.23234), a method for letting AI agents share learned memories across models of different sizes and even different architectures.
Key points
- The problem: AI agents accumulate private memories (solving strategies, error lessons, tool tips), but these are siloed. Directly copying memories between agents *hurts* performance:
- Qwen2.5-7B on MATH500: 52.2% → 50.6% after naive transfer from a 32B model
- Qwen2.5-7B on HumanEval: 42.7% → 34.1%
- Knowledge entanglement: stored trajectories entangle transferable task structure (correct reasoning, constraints, error recognition) with model-specific biases (reasoning style, tool habits, heuristic shortcuts). Naive transfer moves the noise along with the signal.
- *Violation patterns* — systematic errors seen in failures (e.g., premature numerical computation, assuming independence without verification, missing boundary cases)
- *Reasoning invariants* — principles present in successes and absent/broken in failures (e.g., map variable dependencies first, model joint probability via conditionals, enumerate all cases) 3. Rules, not examples: memory stores actionable abstract rules ("do X, avoid Y") rather than concrete solutions, making them abstract, actionable, and transferable. 4. Task-aware retrieval: a new problem is first classified (algebra, geometry, probability, etc.), then only the top-3 most relevant memories from that category are retrieved.
- Cross-model contrast beats self-contrast: a single model comparing its own successes and failures helps less, because another model's differing perspective is what exposes what is model-specific versus task-essential.
- Efficiency: with memory guidance, models avoid known dead ends and need fewer reasoning rounds.
- Inverted-U memory curve: retrieving 1–3 memories helps most; beyond 3, irrelevant constraints add noise and performance declines.
- Small models stand on giants' shoulders: a 7B model with MemCollab can approach or exceed a memory-less 32B model, cutting cost, energy, and hardware requirements.
- Multi-agent systems: heterogeneous model teams can build a shared collective memory rather than remaining isolated islands.
- Continual learning: the shared memory can grow over time as agents contribute new strategies and error warnings.
- Future directions: scaling beyond two agents, meta-learning (learning how to identify problem structure), self-evolving memory, and extension to vision, robotics, and scientific discovery.
The MemCollab method
1. Contrastive trajectory distillation: a weak agent (e.g., 7B) and a strong agent (e.g., 32B) each attempt the same task; a verifier labels trajectories as preferred (τ+) or dispreferred (τ−). 2. Distilling differences: comparing the two trajectories extracts:
Results
| Benchmark | Model | No memory | With MemCollab | Gain | |---|---|---|---|---| | MATH500 | Qwen2.5-7B | 52.2% | 67.0% | +14.8% | | MATH500 | Qwen2.5-32B | 68.0% | 73.8% | +5.8% | | MBPP | Qwen2.5-7B | 47.9% | 57.6% | +9.7% | | MBPP | Qwen2.5-32B | 59.4% | 64.3% | +4.9% | | Cross-family | LLaMA3-8B | 46.6% | 74.4% | +27.8% |
Why it works
The post frames a trajectory as τ = g(s, b), where *s* is task structure (shared across agents) and *b* is agent bias (agent-specific). Contrasting outcomes on the same task isolates factors attributable to *b*, letting memory m = φ(s) encode structure only—an instance of contrastive learning, and, in information-theoretic terms, a purification step that maximizes retained task information while discarding bias and noise.
Broader implications
Reference
Chang, Y., Wu, Y., Wu, Q., & Lin, L. (2026). MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation. *arXiv preprint arXiv:2603.23234*.