Papers
Topics
Authors
Recent
Search
2000 character limit reached

MemCollab: Collaborative Memory Framework

Updated 31 March 2026
  • MemCollab is a collaborative memory framework that shares agent-invariant reasoning constraints across heterogeneous LLM-based agents using contrastive distillation.
  • It builds a shared, agent-agnostic memory that enhances accuracy and efficiency in tasks like mathematical reasoning and code generation.
  • The framework employs a task-aware retrieval mechanism that filters out agent-specific biases and reduces reasoning steps during inference.

MemCollab is a collaborative memory framework designed to facilitate cross-agent knowledge sharing among heterogeneous LLM-based agents. Unlike conventional agent-specific memory systems, MemCollab constructs a shared, agent-agnostic memory by applying contrastive distillation to reasoning trajectories produced by diverse agents over the same tasks. This shared memory encodes abstract reasoning constraints—specifically, task-level invariants that generalize across different models—while filtering out agent-specific idiosyncrasies. At inference, a task-aware retrieval mechanism selects and integrates the most relevant memory entries to condition agent reasoning, resulting in improved accuracy and efficiency across mathematical reasoning and code generation tasks. Empirical evaluation demonstrates consistent gains in performance and inference efficiency, including in cross-model-family deployments, thereby substantiating the utility of MemCollab as a universal reasoning resource for LLM-based agents (Chang et al., 24 Mar 2026).

1. Components and Architecture

MemCollab comprises three principal components: (1) a heterogeneous agent pool A={Ai}i=1N\mathcal{A} = \{A_i\}_{i=1}^N, where each agent AiA_i corresponds to a distinct LLM and reasoning paradigm; (2) a shared memory bank M\mathcal{M}, populated with distilled agent-agnostic constraints derived via contrastive analysis; and (3) a task-aware retrieval interface that filters and ranks memory entries contingent on the current query's task category.

The high-level workflow entails, during training: (1) independent generation of reasoning trajectories τi(x)\tau_i^{(x)} by all agents on each task xx; (2) contrastive distillation of shared invariants from these trajectories, forming memory entries {mk(x)}\{m_k^{(x)}\} aggregated into M\mathcal{M}. At test time, given a query qq, the retrieval mechanism classifies qq into a task category, retrieves the most relevant entries MqM\mathcal{M}_q \subset \mathcal{M}, and conditions the agent's solution on AiA_i0.

xx3

2. Formalization and Objective

Let AiA_i1 be the set of agents and AiA_i2 the training tasks. Each agent AiA_i3 produces a reasoning trajectory on task AiA_i4 given by AiA_i5. Memory entries AiA_i6 encode pairs AiA_i7, capturing essential constraints and anti-patterns.

The principal objective is to build a shared memory AiA_i8 that:

  1. Encapsulates task-relevant, agent-invariant knowledge;
  2. Suppresses agent-specific biases;
  3. Remains usable by any AiA_i9 to enhance both accuracy and inference-time efficiency.

3. Contrastive Trajectory Distillation

Each trajectory M\mathcal{M}0 is embedded via an agent-specific encoder M\mathcal{M}1, composed with a projection head M\mathcal{M}2 to yield M\mathcal{M}3 per trajectory step M\mathcal{M}4.

Contrastive learning is applied: positive pairs M\mathcal{M}5 for agents M\mathcal{M}6 on matching steps, negatives from unrelated or erroneous trajectories. The InfoNCE loss is: M\mathcal{M}7 where M\mathcal{M}8 denotes cosine similarity and M\mathcal{M}9 is the temperature. Minimization of τi(x)\tau_i^{(x)}0 aligns agent-invariant features, yielding distilled invariants for τi(x)\tau_i^{(x)}1.

4. Memory Bank Construction and Indexing

Memory is stored as a key-value set: τi(x)\tau_i^{(x)}2 where τi(x)\tau_i^{(x)}3 is an embedding derived from invariant summarization, and τi(x)\tau_i^{(x)}4 is a natural language specification (e.g., “enforce <invariant>; avoid <pattern>”).

Each entry is further labeled by task category τi(x)\tau_i^{(x)}5 for main and subcategory identification. An inverted index enables efficient retrieval by τi(x)\tau_i^{(x)}6, and within each category, τi(x)\tau_i^{(x)}7 are indexed for approximate nearest-neighbor search (e.g., FAISS).

5. Task-Aware Memory Retrieval

A classifier τi(x)\tau_i^{(x)}8 assigns each query to its task category and subcategory. Retrieval uses the key τi(x)\tau_i^{(x)}9 and scores each memory record xx0 via: xx1 Retrieval selects the top-xx2 scoring entries, which are prepended or interleaved into the agent’s input (prompt), thus strongly biasing the agent's decoding toward enforcing distilled invariants while avoiding forbidden patterns.

6. Training and Inference Protocol

Memory Construction

Pseudocode: xx4

Inference and Retrieval

Pseudocode: xx5

7. Empirical Evaluation and Observed Performance

Experiments were conducted on mathematical reasoning (MATH500, GSM8K) and code generation (MBPP, HumanEval) benchmarks. Key performance metrics included accuracy / pass@1 and mean number of reasoning turns.

Key results:

  • The Qwen-2.5-7B model's accuracy increased from 52.2% to 67.0% on MATH500 and from 47.9% to 57.6% on MBPP, outperforming both baseline and naïve cross-agent memory transfer approaches.
  • Larger models (Qwen-2.5-32B) achieved absolute improvements of +3–5% on all tasks.
  • Memory distilled from cross-architecture (LLaMA3-8B ↔ Qwen-32B) agent pairs yielded comparable or superior results compared to within-family pairs, confirming effective agent-agnostic constraint extraction.
  • Average reasoning turns decreased (e.g., from 2.7 to 2.2 on MATH500), evidencing improved inference efficiency.

These results substantiate MemCollab's efficacy in constructing collaborative, agent-invariant memory that enhances both the problem-solving capability and efficiency of heterogeneous agent ensembles (Chang et al., 24 Mar 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to MemCollab Framework.