---
title: 'MOOM: Dual-Branch Memory for Long Dialogues'
url: https://www.emergentmind.com/topics/moom
type: topic
---

# MOOM: Dual-Branch Memory for Long Dialogues

Searching arXiv for the papers relevant to “MOOM” to ground the article in the cited literature.
Searching arXiv for “MOOM memory ultra-long role-playing dialogues” and related terms.
MOOM denotes a dual-branch memory plugin for ultra-long human–robot role-playing dialogues that treats such dialogues as stories co-created by users and LLM agents. It models **plot development** and **character portrayal** as the core storytelling elements, implements them as a **Narrative Summarization Branch (NSB)** and a **Persona Construction Branch (PCB)**, and couples both branches to a forgetting mechanism inspired by **competition-inhibition** memory theory in order to maintain coherent long-horizon interaction with controllable memory capacity [2509.11860].

## 1. Task formulation and conceptual basis

MOOM addresses long-term memory extraction for ultra-long human–robot role-playing dialogues. A dialogue dataset is written as \(D = (d_1, d_2, \dots, d_t)\), where each turn \(d_t = \{c_t, u_t\}\) contains the chatbot’s response \(c_t\) and the user’s utterance \(u_t\). The memory extraction task is to use the full dialogue history \(D\) up to time \(t\) to extract a memory set \(M = \{m_1, m_2, \dots, m_{t-1}\}\), where each \(m_i\) captures user-related information, including plot developments and persona traits, that is needed for coherent role-playing in future turns.

The framework is designed around three simultaneous requirements: **content completeness**, **low latency**, and **controllable capacity**. The underlying motivation is that naïve memory handling becomes problematic in ultra-long settings. Feeding the entire history into the context window each turn is infeasible for dialogues that exceed 600 turns, while appending arbitrary extracted memories without deletion or compression causes uncontrolled memory growth. The reported consequences are context window overflow, increased GPU memory and latency, and degraded retrieval quality due to large, noisy memory pools. The paper gives the concrete example that vanilla Qwen1.5-7B needs approximately 32GB for an 8k window, whereas MOOM works with approximately 16GB.

The system’s conceptual framing is explicitly literary. Drawing on classical literary theory, the design treats **plot** and **characters** as the core elements of stories. In this formulation, role-playing dialogue generates a plot consisting of conflicts, resolutions, and turning points, while the participants enact characters, including the user persona and the LLM’s role persona. This leads to a structured decomposition of memory into narrative and persona components, rather than topic segmentation or purely similarity-based clustering. A common misconception is that long-context capability alone solves long-horizon dialogue coherence; the reported comparisons instead indicate that prompt-time access to more text does not by itself guarantee better memory organization, retrieval precision, or bounded memory growth [2509.11860].

## 2. Dual-branch architecture

MOOM is positioned as a memory plugin between dialogue history and response generation. As conversation proceeds, each new turn is logged as raw history and passed to NSB and PCB. NSB periodically packages and summarizes dialogue segments into multi-level plot summaries; PCB periodically extracts persona snapshots and merges them into a persistent persona sketch. A retrieval module together with the forgetting mechanism maintains a bounded memory pool \(M\). For each new query, MOOM retrieves relevant memories using a BGE reranker and supplies those snippets to the main LLM without including full dialogue history.

| Component | Primary function | Output form |
|---|---|---|
| NSB | Hierarchical plot summarization across multiple time scales | \(I^{(1)}\), \(S^{(2)}\), \(S^{(3)}\) |
| PCB | Dynamic persona extraction and fusion | Structured key–value persona sketch |
| Retrieval + forgetting | Bounded memory maintenance | Relevant memory subset for prompting |

The **Narrative Summarization Branch** operates by packaging raw turns and then compressing them hierarchically. When the number of turns reaches threshold \(\theta_1\), they are grouped into a first-level unit,
\[
I_j^{(1)} = \{ d_{(j-1)\theta_1+1}, d_{(j-1)\theta_1+2}, \dots, d_{j\theta_1} \}, \quad j \in \mathbb{N}_+ .
\]
The implementation choice is \(\theta_1 = 6\), so each \(I_j^{(1)}\) contains 6 turns, or 3 user–agent rounds. For higher levels, when the number of segments \(S^{(m)}\) reaches \(\theta_m\), MOOM aggregates them through LLM summarization,
\[
S_l^{(m+1)} = \mathrm{LLM}\left( \{ S_{(l-1)\theta_m+1}^{(m)}, \dots, S_{l\theta_m}^{(m)} \} \right), \quad l \in \mathbb{N}_+ .
\]
In practice, \(\theta_2 = 5\) and \(\theta_3 = 5\), yielding two summarization stages: raw \(I^{(1)}\) to \(S^{(2)}\) for local key events, and \(S^{(2)}\) to \(S^{(3)}\) for high-level storyline summaries centered on central conflicts and turning points. The resulting hierarchy \(\{ I^{(1)}, S^{(2)}, S^{(3)} \}\) provides long-term plot memory.

The **Persona Construction Branch** maintains a key–value persona profile. The keys include static attributes such as `Name`, `Age`, and `Profession`; preferences such as `Favorite foods`, `Disliked animals`, and `Hobbies`; trajectory and history fields such as `Recent activities` and `Important events`; and more complex relational or psychological traits. These keys are organized into categories with distinct update policies: **replace keys**, **append keys / expandable attributes**, **trajectory keys**, **contradictory keys**, and **complex keys**.

Persona snapshots are extracted at specified intervals by prompting an LLM to produce a dictionary mapping persona keys to values found in recent dialogue. The paper describes one instantiation in which GPT-4 generates training labels and a Qwen2-7B model is fine-tuned to perform persona extraction more cheaply than repeated GPT-4 calls. Snapshot fusion uses three strategies: rule-based merging for replace, append, and trajectory keys; embedding-based merging for contradictory keys using BGE similarity; and LLM-based merging for complex keys that require semantic integration. The reported ablation establishes complementarity between branches: NSB-only achieves MemScore 2.603 and QA precision 0.693, PCB-only achieves MemScore 2.468 and QA precision 0.752, and the full system achieves MemScore 3.170 and QA precision 0.832 [2509.11860].

## 3. Memory representation, retrieval, and forgetting

MOOM’s memory pool combines narrative summaries from NSB and persona key–value entries from PCB. Narrative summaries \(S^{(2)}\) and \(S^{(3)}\) are event-centric and temporally structured; persona entries encode user traits, preferences, and history in a more semantic form. Each memory item is a short text snippet associated with metadata: creation round \(b\), retrieval history \(R_c\), and an importance score \(S\).

Update rules differ by branch. In NSB, every turn is appended as raw history, raw turns are packaged into \(I_j^{(1)}\) when \(\theta_1\) is met, and higher-level summaries are created whenever the segment count reaches the corresponding \(\theta_m\). Summaries \(S^{(2)}\) and \(S^{(3)}\) are inserted into the memory pool with metadata. In PCB, persona snapshots are extracted at persona intervals, merged into the current persona sketch, and the changed or newly added key–value entries are inserted or updated in \(M\).

Retrieval is context-dependent. For a retrieval context \(c\), MOOM first uses the BGE reranker to compute similarity between \(c\) and each memory item \(m \in M\), then retrieves the top \(2k\) memories by semantic relevance. Among these \(2k\) candidates, the top \(k\) form the relevant set \(\mathbb{R}_c\), the next \(k\) form the interfering set \(\mathbb{N}_c\), and the remaining memory items are the unactivated set \(\mathbb{U}_c\). Only \(\mathbb{R}_c\), up to 9 items because \(k = 9\), is inserted into the prompt context together with the current query.

The forgetting mechanism is grounded in interference theory and inhibitory control. Each memory item’s importance score evolves according to
\[
S = \alpha \frac{1}{\exp\left(\gamma (r_c - b)\right) + (1 - \epsilon)}
    + \beta \sum_{r \in R_c} \frac{1}{r_c - r + \epsilon},
\]
where \(r_c\) is the current round, \(b\) is the creation round, \(R_c\) is the set of past retrieval rounds, and \(\epsilon\) avoids division by zero. The first term is temporal decay; the second is retrieval reinforcement. The reported parameter setting is \(\alpha = 0.1\), \(\beta = 0.9\), \(\gamma = 1\), which gives retrieval reinforcement dominance over temporal decay. After top-\(2k\) retrieval, the relevant memories record \(r_c\) into their retrieval histories, while the interfering memories have their scores halved. Retention and pruning then enforce bounded capacity, with capacities such as 3k, 6k, and 10k items used in the experiments.

This mechanism is intended to realize competition and inhibition operationally: repeatedly useful memories are strengthened, near-relevant but currently distracting memories are suppressed, and low-utility memories are gradually pruned. The reported empirical result is that, at equal capacity such as 6k items, competition-inhibition surpasses Ebbinghaus-curve decay and simple capacity control on BERTScore, M3E, ROUGE, and QA precision, and that a limited-capacity configuration can outperform unbounded memory because noisy entries are suppressed [2509.11860].

## 4. ZH-4O dataset and evaluation methodology

ZH-4O is a Chinese ultra-long role-playing dialogue dataset designed specifically for memory evaluation. It contains **28 dialogue sessions** with an average of **600 turns** per dialogue. The dialogues are human–LLM interactions rather than purely synthetic conversations: annotators role-play with a persona-configured chatbot under minimal constraints besides ethics and legality, and the dialogues include substantial Chinese cultural content such as cuisine and celebrities.

The dataset includes **1,115 memory annotations** across the 28 dialogues. Annotators first skimmed the dialogues and then read them sentence by sentence to extract notable information and tag its turn index. Each dialogue was annotated by two annotators, and a third annotator resolved discrepancies and merged similar points. Many annotations follow SVO structures, but annotators were not constrained to SVO tagging.

ZH-4O also includes a probing setup with **1,068 multiple-choice questions** created from the robot’s perspective. Each question is associated with a specific memory point and has four options, one correct and three distractors. In addition, a **universal probe table** contains 30 structured probes, each defined by an information-containing snippet \(P\), a later information-retrieval snippet \(Q\), and a reference answer \(A\). The multiple-choice questions are used for QA precision, while the probe table supports LLM-scored QA similarity on a 0–5 scale.

Evaluation emphasizes how well extracted memories reflect human annotations. The reported metrics are: **BERTScore precision**, computed by matching each label to its best memory item; **M3E embedding similarity**, computed with the same matching scheme; **ROUGE precision** using ROUGE-2 and ROUGE-L; **MemScore**, which uses Qwen2.5-72B to rate semantic fidelity of memory items on a 0–5 scale after BERTScore matching; **QA Precision**, computed over the 1,068 probe questions; and **LLM QA similarity**, computed from answers to the universal probe table and then rated on a 0–5 scale. Relative to prior datasets, ZH-4O differs by combining ultra-long realistic human–LLM role-playing, rich memory annotations, probe QA structure, and a Chinese focus [2509.11860].

## 5. Empirical performance and comparative results

On ZH-4O, MOOM is compared with Mem0, MemoChat, and MemoryBank across multiple LLM sizes. The reported **MOOM-7B fine-tuned** configuration, using Qwen1.5-14B for plot summarization and a fine-tuned Qwen2-7B for persona extraction, achieves BERTScore **0.8018**, M3E **0.9017**, ROUGE-2 **0.2806**, ROUGE-L **0.4834**, MemScore **3.170**, and QA precision **0.832**. The **MOOM-72B** configuration achieves BERTScore **0.8071**, M3E **0.9149**, ROUGE-2 **0.3341**, ROUGE-L **0.5153**, MemScore **3.317**, and QA precision **0.840**. For comparison, the reported **Mem0-72B** scores are BERTScore **0.7108**, MemScore **0.519**, and QA precision **0.612**; **MemoChat-72B** has MemScore **2.303** and QA precision **0.693**; and **MemoryBank-72B** has MemScore **1.780** and QA precision **0.692**.

The long-context comparison further distinguishes memory organization from sheer context-window size. In Table 6, MOOM uses a **1k context window** with **9 retrieved memory items only**. For 7B models, QA precision is **0.607** for vanilla Qwen1.5-7B, **0.570** for InfLLM-7B, **0.730** for HippoRAG2-7B, **0.793** for MOOM-7B, and **0.781** for Qwen2.5-1M-7B. For 14B models, the reported values are **0.687** for vanilla Qwen1.5-14B, **0.827** for MOOM-14B, and **0.852** for Qwen2.5-1M-14B. This suggests that short-context retrieval with structured memory can be competitive with, and in some cases better than, feeding extensive history.

The probe-table QA evaluation in Table 11 reports an LLM-scored QA similarity of **1.521** for MOOM, compared with **0.951** for Mem0, **1.212** for MemoChat, and **0.942** for MemoryBank. The paper attributes part of this difference to MOOM’s concise memory snippets, whereas MemoryBank’s large, verbose entries appear to hurt response generation.

Ablations isolate the role of architectural choices. The dual-branch ablation shows that combining NSB and PCB substantially improves both intrinsic memory quality and downstream QA. The PCB merging ablation indicates that, under unconstrained memory, MemScore rises from **2.843** with rule-based merging only to **3.172** when embedding-based merging is added, while adding LLM-based merging gives **3.170**, a minor additional gain. Under constrained capacity of **50 items**, the same progression is **1.189**, **1.205**, and **1.405**, indicating that LLM-based merging becomes more important when capacity is tight.

MOOM also generalizes beyond Chinese evaluation. On the English LoCoMo dataset, **MOOM-72B** achieves BERTScore **0.7088**, ROUGE-2 **0.2925**, ROUGE-L **0.4288**, and MemScore **3.288**, all reported as the best values in Table 13. The **MOOM-14B** variant also outperforms Mem0, MemoChat, and MemoryBank on that benchmark. The framework also reduces LLM-call overhead: for the same LLM, the time consumption ratio **MOOM : Mem0 : MemoChat : MemoryBank** is reported as approximately **1 : 2.5 : 3 : 1.5**, and on H800, processing **20 rounds** or approximately **40 turns** with MOOM-7B takes approximately **8 seconds** [2509.11860].

## 6. Implementation, limitations, and broader significance

MOOM is primarily a framework that orchestrates LLM calls, rule-based merging, and embedding-based retrieval. NSB summarization uses prompts with general-purpose LLMs such as Qwen1.5-14B, Qwen2.5-32B, and Qwen2.5-72B, without task-specific fine-tuning. PCB persona extraction can use a fine-tuned Qwen2-7B model distilled from GPT-4 outputs. The fine-tuning pipeline described in the paper collects approximately **100 user dialogues**, segments them into **10-turn slices** for a total of **10,000 slices**, uses GPT-4 to generate persona summaries for each slice, cleans and refines the snapshots, and fine-tunes Qwen2-7B with **batch size 64**, **learning rate \(1 \times 10^{-5}\)**, and **800 steps**.

Several limitations are explicitly identified. The annotation pool for ZH-4O consists of **10 Chinese annotators**, all highly educated, with no collected demographic diversity or personal background metadata, which may bias memory annotations. ZH-4O is entirely Chinese, although MOOM is also evaluated on English LoCoMo. The fine-tuned persona extraction model uses GPT-4-generated labels, so GPT-4 biases may influence persona modeling. The dataset is text-only and limited to two-party human–AI dialogue, leaving multi-party and multimodal role-playing outside the reported scope.

The paper also outlines directions for future work: multilingual expansion of ZH-4O, multimodal and multi-agent dialogue settings, refinement of plot and persona abstractions through graph-based narrative structures or richer personality taxonomies, more advanced forgetting and retrieval with adaptive parameters or learned controllers, and practical deployment in systems such as customer support, tutoring, and social companions. A plausible implication is that MOOM’s central contribution lies less in any single retrieval heuristic than in the integration of literary structure, hybrid symbolic-neural memory updating, and bounded-memory competition-inhibition into a unified operational design. In the paper’s own high-level summary, this shifts dialogue memory management from ad hoc similarity-based heuristics toward a more theory-inspired framework for coherent, efficient, long-term role-playing [2509.11860].

Source: https://www.emergentmind.com/topics/moom