Drawing on Memory: Dual-Trace Encoding Improves Cross-Session Recall in LLM Agents
Summary: arXiv:2604.12948v1 Announce Type: new
Abstract: 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, 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, which consists of 4,575 sessions and 100 recall questions, we compare dual-trace encoding against a fact-only control with matched coverage and format over 99 shared questions. The results show that dual-trace achieves 73.7% overall accuracy, compared to 53.5% for the control, resulting in a notable +20.2 percentage point gain (95% CI: [+12.1, +29.3], bootstrap p < 0.0001).
The gains from dual-trace encoding are particularly significant in the following areas:
- Temporal reasoning: a +40 percentage point increase
- Knowledge-update tracking: a +25 percentage point increase
- Multi-session aggregation: a +30 percentage point increase
Interestingly, there is no observed benefit for single-session retrieval, which aligns with the principles of encoding specificity theory. Token analysis indicates that dual-trace encoding achieves these improvements without incurring any additional cost.
Furthermore, we propose an architectural design for adapting dual-trace encoding to coding agents, accompanied by preliminary pilot validation. This innovation aims to enhance the functionality and efficiency of LLM agents in various applications, such as natural language processing, data retrieval, and information synthesis.
As the field of artificial intelligence continues to evolve, the implications of dual-trace encoding could revolutionize how LLM agents store and recall information. By integrating contextual details into memory traces, agents can potentially offer more nuanced and accurate responses, making them more effective in real-world applications.
In conclusion, dual-trace encoding represents a significant advancement in memory architecture for LLM agents. The ability to enrich memory with contextual narratives not only improves recall accuracy but also enhances the overall performance of AI systems in complex tasks. Future research should focus on refining this approach and exploring its applications across diverse domains.
