MemCollab: How Cross-Agent Memory Collaboration Helps AI Share Knowledge (Part 1/3)
*Translated and edited from a Chinese forum post. Original paper: MemCollab: Cross-Agent Memory Collaboration via Contrastive Trajectory Distillation (March 2026).*
The Problem: Isolated Agent Memory
The post opens with a parable of a city where everyone keeps private notebooks, but nobody else can use them — an analogy for today's AI agents. Each agent accumulates its own memory of problem-solving strategies, mistakes, and tool-use tricks, but these cannot be shared.
Why does this matter?
- Redundant work: ten agents solving the same class of problem each rediscover the solution independently.
- Capability boundaries: can a large model (e.g., 32B) benefit from a small model's (7B) memory, or vice versa?
- Resource waste: real deployments mix small models (cheap, easy tasks) and large models (hard tasks); independent memory systems multiply cost.
- MATH500: 52.2% → 50.6%
- HumanEval: 42.7% → 34.1%
- Correct reasoning steps ✓ mixed with model-specific reasoning preferences ✗
- Transferable constraints ✓ mixed with model-specific heuristic shortcuts ✗
- Error-pattern recognition ✓ mixed with the model's own bad habits ✗
- Violation patterns: systematic errors seen in failures (e.g., "doing numerical computation before establishing the full set of equations", "assuming independence of correlated events", "missing boundary cases during enumeration").
- Reasoning invariants: principles present in successes and absent or broken in failures (e.g., "first determine dependency relations between variables", "model joint probability via conditional probability", "systematically enumerate all relevant cases").
Naive Memory Sharing Fails
The intuitive fix — copy memory between agents like a public library — backfires. Directly transferring a 32B model's memory to a 7B model *hurts* performance:
The reason mirrors human experience: every model has its own "personality" — reasoning style (geometric intuition vs. algebraic manipulation), tool-use habits, and characteristic mistakes. Transferred memories carry these personal imprints, which become noise for the recipient.
Knowledge Entanglement
The authors call this knowledge entanglement: in raw memory, transferable signal and model-specific preference are inseparable:
Copying memory transfers the whole tangled bundle — noise drowns the signal.
The Core Insight: Contrast
If two agents solve the same problem — one succeeds, one fails — comparing the trajectories reveals what actually matters: key steps that cannot be skipped, failure patterns to avoid, and verification habits. These reflect the task's structure, not any individual model's style.
The Method: Contrastive Trajectory Distillation
1. Two agents attempt each task: a weaker agent (Aw, e.g., 7B) and a stronger agent (As, e.g., 32B). A verifier labels trajectories as preferred (τ+) or dispreferred (τ−). Either agent can produce either outcome, making the method robust. 2. Extract differences, yielding two knowledge types:
Results
MATH500 (math reasoning):
| Model | No memory | MemCollab | Gain | |---|---|---|---| | Qwen2.5-7B | 52.2% | 67.0% | +14.8% | | Qwen2.5-32B | 68.0% | 73.8% | +5.8% |
MBPP (code generation):
| Model | No memory | MemCollab | Gain | |---|---|---|---| | Qwen2.5-7B | 47.9% | 57.6% | +9.7% | | Qwen2.5-32B | 59.4% | 64.3% | +4.9% |
Cross-family transfer (e.g., Qwen ↔ LLaMA pairs) also works:
| Model | No memory | Cross-family MemCollab | Gain | |---|---|---|---| | LLaMA3-8B | 46.6% | 74.4% | +27.8% |
This suggests the distilled knowledge is genuinely general, not tied to a specific architecture.
Self-Contrast Baseline
The post also mentions a comparison experiment: having a single model contrast its own correct and incorrect solutions instead of using two agents. Self-contrast memory still yields improvements — the full analysis continues in Part 2.
---
*This is Part 1 of a 3-part series on MemCollab.*