As LLM-based assistants become persistent and personalized, they must extract and retain useful information from past conversations as memory. However, the types of information worth remembering vary considerably across tasks. We formalize the heterogeneous memory extraction task and introduce BEHEMOTH, a benchmark that repurposes 18 existing datasets spanning personalization, problem-solving, and agentic tasks, using a downstream utility-driven metric for systematic evaluation. Our empirical analysis confirms that no single static extraction prompt dominates across all task categories, and that existing self-evolving prompt optimization frameworks, originally designed for homogeneous distributions, degrade when training tasks are heterogeneous. To address this, we propose CluE, a cluster-based self-evolving strategy that groups training examples into clusters by extraction scenarios, analyzes each cluster independently, and synthesizes cross-cluster insights to update the extraction prompt. Experiments on BEHEMOTH show that CluE generalizes effectively across heterogeneous tasks (+9.04% relative gain), consistently outperforming prior self-evolving frameworks.
Figures & tables
Figure 1: Illustration of heterogeneous memory extraction. A general-purpose assistant LLMg encounters diverse previous conversations spanning technical debugging, math problem-solving, and personal preferences, from which an extraction model LLMe must produce different types of memory (e.g., reusable insights, solution steps, personal facts). LLMg then leverages these memories to improve responses in new conversations. How well these responses address user needs can then serve as a utility-driven signal for evaluating extraction quality.
Figure 2: Dataset Composition of BEHEMOTH.
Personalization
Problem-Solving
Agentic
Overall
MA
RG
MA
RG
MA
RG
MA
RG
No Memory
34.15
–
46.52
–
30.36
–
37.84
–
Simple
58.76
0
48.76
0
32.46
0
46.00
0
Mem0
73.31
+ 29.96
45.97
− 3.70
31.62
+ 0.44
48.48
+ 5.79
ReasoningBank
50.67
− 10.78
50.72
+ 6.90
32.12
+ 2.49
44.51
+ 0.45
OpenMemory
57.39
− 1.04
50.47
+ 5.59
34.93
+ 8.57
47.14
+ 4.74
Table 1: Static prompt evaluation on in-distribution test sets. MA : Macro Accuracy (%); RG : Relative Gain (%) over Simple . Best and second best MA are highlighted; best RG in bold . Overall aggregates across all datasets.
Figure 3: Overview of our method CluE in one evolution round.
Personalization
Problem-Solving
Agentic
Overall
MA
RG
MA
RG
MA
RG
MA
RG
No Memory
34.15
–
46.52
–
30.36
–
37.84
–
Simple
58.76
0
48.76
0
32.46
0
46.00
0
GEPA
56.59
− 2.16
50.05
+ 2.86
37.23
+ 14.08
47.52
+ 5.06
ACE
53.73
− 4.38
51.04
+ 8.04
33.49
+ 4.93
45.91
+ 3.56
MemEvolve
63.67
+ 10.76
49.49
+ 1.17
30.92
− 3.25
47.08
+ 2.11
Table 2: Evaluation of self-evolving frameworks starting from the Simple prompt on in-distribution test sets. RG denotes the Relative Gain (%) over Simple .
LME
GPQA-D
ToolBench
No Memory
20.45
45.62 ±3.12
23.33
Simple
46.02
47.14 ±4.15
25.30
GEPA
35.06
50.00 ±0.82
24.09
ACE
29.71
46.13 ±0.86
26.82
MemEvolve
56.82
47.98 ±1.09
26.67
CluE
63.07
48.48 ±1.80
26.67
Table 3: Evaluation on the out-of-distribution test sets of BEHEMOTH.
Personalization
Problem-Solving
Agentic
Overall
MA
RG
MA
RG
MA
RG
MA
RG
No Memory
34.15
–
46.52
–
30.36
–
37.84
–
Survey
62.05
0
49.86
0
33.58
0
47.69
0
GEPA †
62.05
0
49.86
0
33.58
0
47.69
0
ACE
54.80
− 10.48
50.06
+ 0.75
34.41
+ 3.69
46.11
− 1.44
MemEvolve
62.88
− 0.31
51.22
+ 2.51
31.34
− 4.85
47.70
− 0.74
Table 4: Evaluation of self-evolving frameworks starting from the Survey prompt on in-distribution test sets. RG denotes the Relative Gain (%) over Survey . † GEPA did not find a better prompt.
Game of 24
AlfWorld
Single-Step
Continual
Single-Step
Continual
No Memory
26.67±3.86
35.42±5.03
30.41±2.71
63.74±0.41
Simple
\pagecolor[HTML]DFE9E227.92±3.86
29.58±3.12
\pagecolor[HTML]DFE9E247.66±2.19
\pagecolor[HTML]DFE9E264.91±5.01
MemEvolve
27.50±2.70
\pagecolor[HTML]DFE9E243.33±3.58
40.64±0.41
62.57±2.30
CluE
\pagecolor[HTML]AEC8B537.08±2.12
\pagecolor[HTML]AEC8B550.83±7.52
\pagecolor[HTML]AEC8B555.85±3.23
\pagecolor[HTML]AEC8B567.25±2.98
Table 5: Single-step vs. continual memory extraction on Game of 24 and AlfWorld. The No Memory baselines differ between settings because the two settings evaluate on different example pools; see Appendix A.3 for details.
Figure 4: Structural comparison of the best prompts evolved by each framework from the Simple seed. Common sections (task description, input/output format) are omitted; only the distinctive components are shown. CluE produces a structured memory taxonomy with per-category definitions and guidelines alongside domain-agnostic general guidelines. GEPA embeds a large amount of domain-specific content (e.g., AlfWorld examples) directly into its rules. MemEvolve lacks a memory taxonomy and instead introduces a penalty clause that prohibits specific extraction patterns.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Dataset
# Train
# Test
R
Memory Work
Personalization
MemBench-High ( Tan et al., 2025 )
20
200
Acc.
MemBench ( Tan et al., 2025 )
MemBench-Low ( Tan et al., 2025 )
20
80
Acc.
MemBench ( Tan et al., 2025 )
PersonaMem-v2 ( Jiang et al., 2025 )
20
272
Acc.
PersonaMem-v2 ( Jiang et al., 2025 )
PrefEval ( Zhao et al., 2025 )
20
200
Acc.
PrefEval ( Zhao et al., 2025 )
LongMemEval ( Wu et al., 2025 )
–
176
LLM Judge
LongMemEval ( Wu et al., 2025 )
Appendix
Table 6: Datasets used in BEHEMOTH, grouped by task category. R denotes the reward function: Acc. = accuracy, EM = exact match, Rule = rule-based verification, SR = success rate, Pass@1 = code execution pass rate, SoPR = solvable pass rate (LLM judge), LLM Judge = LLM-as-judge evaluation. Memory Work indicates the prior work that uses each dataset for memory evaluation.
Personalization
Problem-Solving
Agentic
Overall
MA
RG
MA
RG
MA
RG
MA
RG
No Memory
34.15
–
46.52
–
30.36
–
37.84
–
Simple
65.86
0
50.19
0
38.46
0
50.46
0
GEPA
68.59
+ 5.64
52.91
+ 7.71
33.77
− 9.99
50.71
+ 0.93
ACE
66.65
− 0.43
48.43
− 1.98
34.45
− 8.88
48.63
− 3.93
MemEvolve
65.46
− 0.93
51.05
+ 2.37
36.84
− 2.89
50.15
− 0.29
Appendix
Table 7: Evaluation of Gemini-3-Flash as the extraction backend from the Simple prompt. RG denotes the Relative Gain (%) over Simple .
Wall Time
Optimization LLM Calls
Eval Calls
GEPA
∼ 7.4h
46
1,645
ACE
∼ 12.4h
610
1,120
MemEvolve
∼ 5.0h
30
1,150
CluE
∼ 5.5h
221
1,150
Appendix
Table 8: Efficiency comparison of self-evolving frameworks.
Dataset
No Memory
Simple
GEPA
ACE
MemEvolve
CluE
Personalization
MemBench-High
20.50
87.50
83.00
77.00
87.00
87.00
MemBench-Low
55.00 ±1.77
60.83 ±1.18
59.58 ±1.56
58.33 ±3.12
64.58 ±2.12
63.75 ±1.02
PersonaMem
19.12
21.69
22.79
26.10
26.10
24.63
PrefEval
42.00
65.00
61.00
53.50
77.00
87.50
Problem-Solving
Appendix
Table 9: Per-dataset accuracy (%) on in-distribution test sets for Qwen3-32B evolving from Simple . Subscripts denote standard deviations over three runs.
Dataset
No Memory
Survey
GEPA*
ACE
MemEvolve
CluE
Personalization
MemBench-High
20.50
87.00
87.00
82.00
85.50
86.00
MemBench-Low
55.00 ±1.77
64.58 ±6.24
64.58 ±6.24
57.08 ±1.18
67.08 ±2.36
80.83 ±3.12
PersonaMem
19.12
24.63
24.63
24.63
22.43
26.84
PrefEval
42.00
72.00
72.00
55.50
76.50
89.00
Problem-Solving
Appendix
Table 10: Per-dataset accuracy (%) on in-distribution test sets for Qwen3-32B evolving from Survey .
Dataset
No Memory
Simple
GEPA
ACE
MemEvolve
CluE
Personalization
MemBench-High
20.50
84.50
84.00
86.50
84.50
87.00
MemBench-Low
55.00 ±1.77
52.50 ±4.45
60.00 ±1.02
57.08 ±1.56
52.50 ±2.70
60.42 ±2.57
PersonaMem
19.12
34.93
37.87
30.51
33.82
37.13
PrefEval
42.00
91.50
92.50
92.50
91.00
94.00
Problem-Solving
Appendix
Table 11: Per-dataset accuracy (%) on in-distribution test sets for Gemini-3-Flash evolving from Simple .
Memory management is vital for LLM agents in long-term and personalized interactions. Most previous work studies how to retrieve and use memory, but pays less attention to how memory is extracted. We find two main limitations in existing methods. First, extraction is "ahead-of-time": the agent saves information before it knows future tasks. A single summary prompt often mixes details, events, and relations, so useful information is lost. Second, extraction is usually one-off. Without verification, errors and hallucinations may stay in memory for a long time. To address these limitations, we propose ProMem, a proactive memory extraction framework. It separates details, events, and relations, and uses different extraction strategies for each type. It also checks completeness to recover missed events and verifies facts at the atomic level to reduce hallucinations. Experiments show that ProMem improves memory completeness and QA accuracy, while keeping a good balance between quality and token cost.
Chengyuan Yang, Zequn Sun, Wei Wei +1
State Key Laboratory for Novel Software Technology, Nanjing University, China · National Institute of Healthcare Data Science, Nanjing University, China
Long-term memory is essential for LLM agents that operate across multiple sessions, yet existing memory systems treat retrieval infrastructure as fixed: stored content evolves while scoring functions, fusion strategies, and answer-generation policies remain frozen at deployment. We argue that truly adaptive memory requires co-evolution at two levels: the stored knowledge and the retrieval mechanism that queries it. We present EvolveMem, a self-evolving memory architecture that exposes its full retrieval configuration as a structured action space optimized by an LLM-powered diagnosis module. In each evolution round, the module reads per-question failure logs, identifies root causes, and proposes targeted configuration adjustments; a guarded meta-analyzer applies them with automatic revert-on-regression and explore-on-stagnation safeguards. This closed-loop self-evolution realizes an AutoResearch process: the system autonomously conducts iterative research cycles on its own architecture, replacing manual configuration tuning. Starting from a minimal baseline, the process converges autonomously, discovering effective retrieval strategies including entirely new configuration dimensions not present in the original action space. On LoCoMo, EvolveMem outperforms the strongest baseline by 25.7% relative and achieves a 78.0% relative improvement over the minimal baseline. On MemBench, EvolveMem exceeds the strongest baseline by 18.9% relative. Evolved configurations transfer across benchmarks with positive rather than catastrophic transfer, indicating that the self-evolution process captures universal retrieval principles rather than benchmark-specific heuristics. Code is available at https://github.com/aiming-lab/SimpleMem.
Automatic prompt optimization is a promising approach for adapting large language models (LLMs) to downstream tasks, yet existing methods typically search for a specific prompt specialized to a fixed task. This paradigm limits generalization across heterogeneous queries and prevents models from accumulating reusable prompting knowledge over time. In this paper, we propose MemAPO, a memory-driven framework that reconceptualizes prompt optimization as generalizable and self-evolving experience accumulation. MemAPO maintains a dual-memory mechanism that distills successful reasoning trajectories into reusable strategy templates while organizing incorrect generations into structured error patterns that capture recurrent failure modes. Given a new prompt, the framework retrieves both relevant strategies and failure patterns to compose prompts that promote effective reasoning while discouraging known mistakes. Through iterative self-reflection and memory editing, MemAPO continuously updates its memory, enabling prompt optimization to improve over time rather than restarting from scratch for each task. Experiments on diverse benchmarks show that MemAPO consistently outperforms representative prompt optimization baselines while substantially reducing optimization cost.
Guanbao Liang, Yuanchen Bei, Sheng Zhou +5
Zhejiang University · University of Illinois Urbana-Champaign · Alibaba Group