对比长上下文大模型与事实记忆系统在持久对话中的表现与成本。
Beyond the Context Window: A Cost-Performance Analysis of Fact-Based Memory vs. Long-Context LLMs for Persistent Agents
- 用提取结构化事实的内存系统替代完整历史输入。
- 在10万词长上下文时,记忆系统10轮后更便宜。
- 适合对角色一致性要求高且需长期运行的对话应用。
持久对话AI系统面临选择:将完整对话历史输入长上下文大语言模型(LLM),或采用专用记忆系统提取并检索结构化事实。本文对比基于Mem0框架的事实记忆系统与长上下文LLM推理,在LongMemEval、LoCoMo和PersonaMemv2三个以记忆为核心的任务上评估准确率与累计API成本。长上下文GPT-5-mini在LongMemEval和LoCoMo上具备更高事实召回率,而记忆系统在PersonaMemv2上表现相当,因其依赖稳定、可扁平提取的事实属性。构建包含提示缓存的成本模型显示,长上下文推理每轮成本随上下文长度增长,而记忆系统读取成本在一次写入后基本固定。当上下文达10万token时,记忆系统约10轮后成本更低,且随着上下文增长,盈亏平衡点提前。该研究揭示了两种架构的准确率-成本权衡,并为生产部署提供明确选型依据。
原文摘要 · Abstract (English)
Persistent conversational AI systems face a choice between passing full conversation histories to a long-context large language model (LLM) and maintaining a dedicated memory system that extracts and retrieves structured facts. We compare a fact-based memory system built on the Mem0 framework against long-context LLM inference on three memory-centric benchmarks - LongMemEval, LoCoMo, and PersonaMemv2 - and evaluate both architectures on accuracy and cumulative API cost. Long-context GPT-5-mini achieves higher factual recall on LongMemEval and LoCoMo, while the memory system is competitive on PersonaMemv2, where persona consistency depends on stable, factual attributes suited to flat-typed extraction. We construct a cost model that incorporates prompt caching and show that the two architectures have structurally different cost profiles: long-context inference incurs a per-turn charge that grows with context length even under caching, while the memory system's per-turn read cost remains roughly fixed after a one-time write phase. At a context length of 100k tokens, the memory system becomes cheaper after approximately ten interaction turns, with the break-even point decreasing as context length grows. These results characterize the accuracy-cost trade-off between the two approaches and provide a concrete criterion for selecting between them in production deployments.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。