An agent's memory must remain useful as information changes across conversations. A new fact may replace an earlier value without making that value irrelevant to a later question. We present Temporal State Tracking Memory (TEM), a training-free framework for tracking these changes. TEM stores facts as versioned records linked to their sources. It retrieves relevant versions, places them in source order and labels historical records before passing the evidence to the answer model. Event memory and original dialogue turns provide details missing from structured facts. We evaluated TEM on 420 questions drawn from 600 sessions involving 60 personas. Across four open-weight models, key-entity hit rates reached 75.71-97.62% overall and 96.67-100.00% on the historical-residence subset. Adding historical labels to otherwise identical, source-ordered facts increased overall hit rates by 17.14-55.95 percentage points. The evidence was compact: 94-118 tokens per answer, or 48.75-56.73% less than session-aware retrieval-augmented generation (RAG). A further evaluation on 1,540 LoCoMo questions tested hybrid memory under a fixed evidence budget. TEM exceeded session-aware RAG with both backbones; conservative score differences were 7.92 and 10.58 percentage points. The results support preserving fact versions and exposing their temporal status to the generator when answering questions about repeatedly updated information.
Figures & tables
Figure 1: TEM framework. Fact versions are linked to source sessions. Retrieved facts appear in source order, with historical labels on superseded versions. Dashed connections supply event and original-text evidence.
Figure 2: Fact-version updates and evidence construction. a, Appending a new version updates the status of retained records. b, Retrieval selects relevant facts, which are then ordered by source and labelled if historical. Symbols v and s denote a fact version and its source session.
Backbone
Unmarked (%)
TEM (%)
Gain (pp)
Llama-3.1-8B
19.76
75.71
+55.95
Qwen3.5-4B
48.10
97.62
+49.52
Qwen3.5-9B
74.52
91.67
+17.14
gpt-oss-20b
55.24
96.67
+41.43
Table 1: Effect of historical labels on overall key-entity hit rate
Method
Llama-3.1-8B
Qwen3.5-4B
Qwen3.5-9B
gpt-oss-20b
Naive RAG
14.52
42.38
14.05
46.43
Session-aware RAG
56.67
57.62
79.76
95.24
Full context
49.76
95.48
87.38
66.43
Overwrite
43.33
29.76
41.43
34.76
Retain, unmarked
19.76
48.10
74.52
55.24
TEM-Status
75.71
97.62
91.67
96.67
Table 2: Overall key-entity hit rates across four backbones and six configurations (%)
Figure 3: Effects of version retention and historical labels. a, Historical-residence hit rates (60 questions). b, Overall gains over Unmarked (420 questions). pp denotes percentage points.
Method
Llama-3.1-8B
Qwen3.5-4B
Qwen3.5-9B
gpt-oss-20b
Naive RAG
0.00
0.00
0.00
5.00
Session-aware RAG
10.00
88.33
20.00
86.67
Full context
58.33
96.67
73.33
91.67
Overwrite
0.00
8.33
0.00
0.00
Retain, unmarked
41.67
65.00
81.67
76.67
TEM-Status
98.33
100.00
100.00
96.67
Table 3: Historical-residence retrieval after repeated updates (key-entity hit rate, %)
Backbone
Unmarked hits
TEM hits
Net difference
Llama-3.1-8B
83
318
+235
Qwen3.5-4B
202
410
+208
Qwen3.5-9B
313
385
+72
gpt-oss-20b
232
406
+174
Table 4: Overall hit counts with and without historical labels
Figure 4: Selected successful corrections across backbones. Arrows show source-session order; bold states give the reference values. Check marks and crosses indicate correct and incorrect answers. The control configuration is identified in each panel. Panel c marks omitted text with […].
Backbone
Other queries Unmarked / TEM
Gain (pp)
Pre-move residence Unmarked / TEM
Gain (pp)
Llama-3.1-8B
16.11 / 71.94
+55.83
41.67 / 98.33
+56.67
Qwen3.5-4B
45.28 / 97.22
+51.94
65.00 / 100.00
+35.00
Qwen3.5-9B
73.33 / 90.28
+16.94
81.67 / 100.00
+18.33
gpt-oss-20b
51.67 / 96.67
+45.00
76.67 / 96.67
+20.00
Table 5: Key-entity hit rates and label gains by query group
Figure 5: Answer-evidence length distributions, with 420 queries per configuration. Boxes show the interquartile range, centre lines the median, and whiskers the minimum and maximum.
Backbone
Session-aware RAG
Full context
TEM-Status
Saving (%)
Llama-3.1-8B
214.72
180.13
95.93
55.32
Qwen3.5-4B
229.36
199.52
99.25
56.73
Qwen3.5-9B
229.36
199.52
117.55
48.75
gpt-oss-20b
206.55
171.95
94.05
54.47
Table 6: Mean evidence length during answering
Backbone
Memory
Overall
Temporal
Multi-hop
Single-hop
Open-domain
Llama-3.1-8B
TEM-Hybrid-State
27.53–29.22
14.02–17.76
17.73–18.09
37.57–38.88
13.54–15.62
Llama-3.1-8B
TEM-Hybrid-Unmarked
27.40–28.96
14.33–17.45
14.89–15.25
38.17–39.48
13.54–15.62
Llama-3.1-8B
Session-aware RAG
17.92–19.61
8.72–11.84
12.06–12.77
23.90–25.33
13.54–15.62
Llama-3.1-8B
Long-context ref.
37.66–39.55
14.64–17.13
24.11–24.82
53.51–55.65
15.62–16.67
Qwen3.5-9B
TEM-Hybrid-State
35.84–37.53
38.63–42.06
22.70–23.05
41.38–42.81
16.67–18.75
Qwen3.5-9B
TEM-Hybrid-Unmarked
35.97–37.66
38.32–41.43
25.18–25.89
40.78–42.21
17.71–19.79
Table 7: Strict semantic scores on LoCoMo for two backbones (%)
Method
Generator
Benchmark
Metric
Overall
Temporal
Single-hop
A-MEM Xu et al. (2025)
GPT-4o-mini
LoCoMo
F1
—
45.85
44.65
MemoryOS Kang et al. (2025)
GPT-4o-mini
LoCoMo
F1
—
20.02
35.27
Mem0 Chhikara et al. (2025)
GPT-4o-mini
LoCoMo
J
66.88 ± 0.15
55.51 ± 0.34
67.13 ± 0.65
Mem0-graph Chhikara et al. (2025)
GPT-4o-mini
LoCoMo
J
68.44 ± 0.17
58.13 ± 0.44
65.71 ± 0.45
Zep Rasmussen et al. (2025)
GPT-4o-mini
LongMemEval-s
GPT-4o judge
63.80
54.10
—
Zep Rasmussen et al. (2025)
GPT-4o
LongMemEval-s
GPT-4o judge
71.20
62.40
—
Table 8: Published results and evaluation settings of representative memory methods
Large language model (LLM) agents increasingly operate over long interaction histories, where effective reasoning requires identifying and exploiting task-relevant evidence distributed across past observations and actions. However, useful information encoded in previously computed representations is often underutilized during subsequent generation. We propose TransMem, a lightweight inference-time parametric memory module that transforms sparse historical hidden states from a frozen LLM backbone into reusable memory representations. TransMem uses a lightweight gating network to dynamically apply the latent intervention to the current hidden states, without repeatedly encoding the preceding context. To learn transferable memory utilization rather than task-specific knowledge, we introduce evidence-conditioned self-distillation. A memory-augmented student processes the full context and matches the predictive distribution of an evidence-only teacher that shares the same frozen backbone. Experiments on LoCoMo, HotpotQA, and MemoryAgentBench demonstrate consistent improvements across different model architectures and scales. TransMem yields gains of 11.58--29.25 F1 on LoCoMo and 10.20--13.03 F1 on HotpotQA, while improving the average MemoryAgentBench accuracy from 29.54% to 40.00%. These results establish sparse historical hidden states as an effective and efficient memory substrate for long-context LLM agents. Our code is available at https://github.com/Haodong-Lei-Ray/TransMem.
Haodong Lei, Junming Liu, Yirong Chen +4
Southeast University, Nanjing, Jiangsu, China · Shanghai Artificial Intelligence Laboratory, Shanghai, China
Long-term memory is essential for language agents to maintain coherent and effective behavior over extended, multi-session interactions. Existing memory systems mainly use retrieval at read time, while write-time memory formation still relies on direct extraction or compression. However, when future information needs are unknown, compressing an entire interaction in one pass can overlook locally important details that may matter later. To this end, we introduce RIME, a retrieval-induced memory framework that shifts memory construction from monolithic compression toward evidence-centered integration. RIME uses generic self-questions to retrieve focused dialogue evidence and grounds memory formation in both the retrieved evidence and relevant historical memories, which are jointly reconciled into an evolving memory bank with temporal and provenance information. At inference time, compressed memory serves as the primary rather than the sole source of evidence: when it cannot support an answer, RIME retrieves relevant source dialogue together with its local context to recover information omitted during memory formation, without resorting to full-history processing. Extensive experiments on LoCoMo with Qwen3-235B-A22B and GPT-5.6 Sol show that RIME consistently achieves the best performance across all three quality metrics among the compared methods, while requiring substantially fewer query-time LLM tokens.
Long-term memory has been widely adopted in LLM-based agents to support persistent interaction and personalized assistance. Long-term multi-party interactions, however, accumulate substantially more detailed information, with decisions repeatedly updated and states evolving across participants and interaction stages. Temporal structure is therefore crucial for tracing such memories: relevant information often appears densely within short intervals, while transitions among different states are anchored by a strict temporal order. Existing temporally aware memory frameworks primarily store time as metadata or use temporal signals to guide retrieval over preconstructed memory structures, without using temporal structure to both recover locally concentrated evidence and reconstruct its complete event progression. To address these limitations, we propose T-Mem, a temporal-structure-based memory framework that preserves interactions and organizes query-relevant evidence through two temporal mechanisms. Temporal Evidence Discovery exploits the local concentration of related messages to recover overlooked evidence, while Temporal Memory Structuring models state transitions and supporting relations over time and compresses low-information spans within the resulting forest. Evidence Forest Linearization then serializes the structured evidence for answer generation. Experiments on two long-term multi-party memory benchmarks demonstrate that T-Mem consistently outperforms competitive memory frameworks across LLMs, parameter settings, domains, and query types.
Junyou Guo, Chongyang Tao, Yan He +2
School of Computer Science and Engineering, Beihang University, Beijing, China · Alibaba Group