Abstract
Existing retrieval-based methods have made significant strides in maintaining long-term conversations. However, these approaches face challenges in memory database management and accurate memory retrieval, hindering their efficacy in dynamic, real-world interactions. This study introduces a novel framework, COmpressive Memory-Enhanced Dialogue sYstems (COMEDY), which eschews traditional retrieval modules and memory databases. Instead, COMEDY adopts a “One-for-All” approach, utilizing a single language model to manage memory generation, compression, and response generation. Central to this framework is the concept of compressive memory, which integrates session-specific summaries, user-bot dynamics, and past events into a concise memory format. To support COMEDY, we collect the biggest Chinese long-term conversation dataset, Dolphin, derived from real user-chatbot interactions. Comparative evaluations demonstrate COMEDY’s superiority over traditional retrieval-based methods in producing more nuanced and human-like conversational experiences.
Introduction
Maintaining a "long-term" conversation—one that spans days or months—is a holy grail for chatbots. Currently, the industry standard relies on retrieval-based methods. These systems summarize past sessions, store them in a vector database, and use an embedding model to "fetch" relevant bits when a user speaks. However, this approach suffers from three major bottlenecks: modular fragility (where the system is only as strong as its weakest link), database bloat as conversations expand, and a lack of robustness in handling the colloquial, unpredictable nature of real-world human interactions.
The COMEDY Framework
To address these limitations, we propose COMEDY (COmpressive Memory-Enhanced Dialogue sYstems). This framework shifts the paradigm from "Retrieve-then-Generate" to a unified generative approach.
The "One-for-All" Approach
Instead of separate modules for summarization, retrieval, and generation, COMEDY utilizes a single Large Language Model (LLM) to handle the entire pipeline. This model extracts session-level memories, compresses them into a holistic "compressive memory," and generates the final response. This unified architecture reduces the "needle in a haystack" problem inherent in traditional retrieval.
Compressive Memory
Rather than storing every transcript, the model maintains a condensed "state" of the relationship. This compressive memory includes:
- User Profile: Detailed traits and preferences (e.g., a user's favorite food).
- Relationship Description: A description of how the user-bot dynamics are evolving.
- Event Records: A concise record of past interactions to maintain factual consistency.
The Dolphin Dataset
A key contribution of this work is Dolphin, the largest instruction-tuning dataset for long-term Chinese conversations. It consists of 100,000 samples derived from real-world interactions on the X Eva platform. Unlike synthetic datasets, Dolphin captures the linguistic nuances and "aimless chatter" characteristic of real human-AI relationships. The dataset supports three distinct tasks: session-level summarization, memory compression, and memory-grounded response generation.
Experimental Results
COMEDY was evaluated against several baselines, including retrieval-based LLaMA and ChatGPT configurations.
Human Evaluation and Nuance
In human rankings (Top@1), COMEDY-13B DPO outperformed all other models, including GPT-4 with retrieval (29.82% vs 22.83%). Qualitative analysis shows that while retrieval models often provide generic responses like "I am waiting for you," COMEDY can recall specific details—such as a user's favorite recipe for roasted chicken wings or their interest in archery—to create a more engaging and human-like experience.
Direct Preference Optimization (DPO)
To ensure the model remains grounded in its memory and avoids hallucinations, we employed Direct Preference Optimization (DPO). By training on pairs of responses (one memory-consistent and one contradictory), the model was "polarized" to prefer outputs that align with historical facts, effectively serving as a consistency engine.
Conclusion
COMEDY demonstrates that treating memory as a "compressed state" rather than a searchable library significantly enhances the coherence and memorability of long-term AI interactions. By eliminating external databases and unifying processing, the system reduces computational overhead while improving conversational quality. Future work will focus on real-time memory updates and maintaining high engagement over extremely long durations.
Summary updated