LLM agents with persistent memory store information as flat factual records, providing little context for temporal reasoning, change tracking, or cross-session aggregation. Inspired by the drawing effect [3], we introduce dual-trace memory encoding. In this method, each stored fact is paired with a concrete scene trace, a narrative reconstruction of the moment and context in which the information was learned. The agent is forced to commit to specific contextual details during encoding, creating richer, more distinctive memory traces. Using the LongMemEval-S benchmark (4,575 sessions, 100 recall questions), we compare dual-trace encoding against a fact-only control with matched coverage and format over 99 shared questions. Dual-trace achieves 73.7% overall accuracy versus 53.5%, a +20.2 percentage point (pp) gain (95% CI: [+12.1, +29.3], bootstrap p < 0.0001). Gains concentrate in temporal reasoning (+40pp), knowledge-update tracking (+25pp), and multi-session aggregation (+30pp), with no benefit for single-session retrieval, consistent with encoding specificity theory [8]. Token analysis shows dual-trace encoding achieves this gain at no additional cost. We additionally sketch an architectural design for adapting dual-trace encoding to coding agents, with preliminary pilot validation.
翻译:具备持久记忆的大语言模型代理以平面事实记录存储信息,这使得时间推理、变化追踪及跨会话聚合缺乏上下文。受绘画效应启发[3],我们提出双迹记忆编码方法。在该方法中,每个存储事实均与具体场景轨迹(即重构信息习得时刻与情境的叙事性描述)配对。代理在编码过程中被迫确定特定的上下文细节,从而生成更丰富、更具区分性的记忆痕迹。基于LongMemEval-S基准测试(含4575个会话、100个回忆问题),我们在99个共享问题上比较了双迹编码与覆盖范围及格式匹配的纯事实对照组的性能。双迹编码的整体准确率达73.7%,对照为53.5%,提升20.2个百分点(95%置信区间:[+12.1, +29.3],bootstrap检验p<0.0001)。性能提升集中于时间推理(+40个百分点)、知识更新追踪(+25个百分点)及多会话聚合(+30个百分点),而在单会话检索中无显著优势,这与编码特异性理论[8]一致。词元分析表明,双迹编码实现此增益而未增加额外成本。我们进一步勾勒了适配编程代理的双迹编码架构设计方案,并完成初步试点验证。