让不同模型共享记忆,提升多模型协作的推理效率
MemCollab: Cross-Model Memory Collaboration via Contrastive Trajectory Distillation

- 通过对比不同模型的推理轨迹,提取通用任务约束
- 在数学与代码生成任务上准确率提升,推理更快
- 适合异构大模型团队协同工作场景
大型语言模型代理越来越多地依赖记忆机制复用过往问题求解经验。然而,现有方法通常为单一代理构建记忆,并仅在相同基础模型间复用,导致知识与特定模型的推理风格紧密耦合。在异构部署中,当代理使用不同规模、架构或专长的基础模型时,一个关键问题是:能否让单一记忆系统在不同模型间共享?我们发现,直接跨模型传递记忆会降低性能,因为存储的记忆常混杂任务相关知识与模型特异性偏差。为此,我们提出 MemCollab,一种通过对比不同模型代理在同一任务上的推理轨迹来构建共享跨模型记忆的协作框架。该对比过程提炼出捕捉任务级不变性的抽象推理约束,同时抑制模型特异性伪影。我们还引入任务感知检索机制,根据任务类别条件化记忆访问,确保推理时仅检索相关约束。在数学推理与代码生成基准测试中,MemCollab 在多种代理配置下均持续提升准确率与推理效率,涵盖不同模型家族。结果表明,协作构建的跨模型记忆可作为异构大模型代理的共享推理资源。
原文摘要 · Abstract (English)
LLM agents increasingly rely on memory mechanisms to reuse knowledge from past problem-solving experiences. However, existing methods typically construct memory for a single agent and reuse it with the same underlying model, tightly coupling stored knowledge to model-specific reasoning styles. In heterogeneous deployments, where agents may be instantiated with backbone models of different sizes, architectures, or specializations, this raises a key question: can a single memory system be shared across agents with different backbone models? We find that naive cross-model memory transfer can degrade performance, because stored memories often entangle task-relevant knowledge with model-specific biases. To address this challenge, we propose MemCollab, a collaborative memory framework that builds shared cross-model memory by contrasting reasoning trajectories generated by different model-based agents on the same task. Through this contrastive process, MemCollab distills abstract reasoning constraints that capture shared task-level invariants while suppressing model-specific artifacts. We further introduce a task-aware retrieval mechanism that conditions memory access on task category, ensuring that only relevant constraints are retrieved at inference time. Experiments on mathematical reasoning and code generation benchmarks show that MemCollab consistently improves both accuracy and inference-time efficiency across diverse agents, including settings with different model families. These results demonstrate that collaboratively constructed cross-model memory can serve as a shared reasoning resource for heterogeneous LLM-based agents.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。