Manuscript Offprint
arXiv:2610.41056Accept Changes, Reject Attacks: Robust Memory Management for LLM Agents
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Since large language model (LLM) agents rely on long-term memory, what they store now shapes what they do later. A memory manager decides how each input changes this memory and which records the agent acts on. It can fail in two ways: keeping a fact that has since changed (outdated memory), or storing a planted passage or injected instruction (memory poisoning). Most prior work studies them separately, yet they call for opposite write decisions, so no fixed write rule handles both. We therefore formalize memory robustness as handling both without doing worse on other inputs. Since accuracy checks only the answer, we measure robustness with evidence-conditioned accuracy (ECA), which also checks that the records the manager selects include all the evidence the answer needs, updated and free of attacks. However, existing memory systems and defenses are not more robust than an untuned manager on our test sets. We improve robustness with a simple one-shot recipe that fine-tunes the manager on episodes synthesized around a single conversation with inserted changes and attacks. On three backbones, it improves every category score on our test sets and more than doubles the untuned manager's overall ECA, though robustness remains incomplete.
1 Introduction
Large language model (LLM) agents keep a long-term memory outside the context window, so that what they learn in one session is available in later ones. A personal assistant, for example, remembers facts and preferences about its user (Packer et al., 2023; Zhong et al., 2024). In such agents, a memory manager decides for each new input whether and how the memory should change, and which stored records the agent acts on (Chhikara et al., 2025; Xu et al., 2025; Yan et al., 2026). Every write
and every selection thus affects what the agent does later. Yet the inputs come from many sources, not all of them under the agent's control.
As Figure 1 shows, a write can go wrong in two ways. In outdated memory, a fact has changed but the memory keeps the old value (Chao et al., 2026); in Figure 1a, the user has moved to a new city. In memory poisoning, an attacker uses one of these inputs to place content in memory that should never be there (Greshake et al., 2023; Dong et al., 2025), such as the injected instruction in Figure 1b. Every memory manager may face both problems, and they call for opposite write decisions. Following a change requires writing the new input, while keeping out an attack requires not writing it, so no fixed write rule handles both. We therefore distinguish three categories of input. An input is in the outdated category if its speaker reports a change to a stored fact about themselves, which makes the stored record outdated. Poisoning inputs carry an attack, and all other inputs are standard.
Most prior work evaluates each problem on its own, and a trivial manager can pass each such evaluation. Memory benchmarks contain no attacks, and managers trained on them never see one (Wu et al., 2025; Chao et al., 2026; Yan et al., 2026), so a manager that writes every input scores high while storing every attack. Evaluations of poisoning and injection defenses check standard inputs, not whether changes to stored facts are still written (Wei et al., 2026; Chen et al., 2025a; Wallace et al., 2024; Li et al., 2025), so a manager that never changes a stored fact scores high while missing every change. No widely used benchmark covers both problems. We therefore formalize memory robustness over all three categories, so that a gain in one category cannot hide a loss in another. Measuring it also needs a new metric, since accuracy (ACC) checks only the answer, not the memory it is based on.
Unlike a fixed write rule, a manager that tells
*Corresponding author.

Figure 1: Two cases a memory manager must handle: (a) outdated memory and (b) memory poisoning. Each panel shows an incorrect (red) and a correct (green) write, with the memory each write leaves (yellow).
changes from attacks can handle both, writing the first and keeping the second out of the records it selects. A simple one-shot synthesis around a single conversation of an existing dataset is enough to teach this distinction. Our contributions are:
-
A complete definition of memory robustness. Unlike prior one-sided formulations, ours covers all three categories equally; a manager is more robust than another if it is no worse in any category and better in at least one. We measure each category with a new metric, evidence-conditioned accuracy (ECA), which counts an answer only if it is correct and the records the manager selects include all the evidence it needs, updated and free of attacks.
-
A simple one-shot data synthesis recipe. To improve robustness under this definition, we synthesize training data around a single conversation of an existing dataset. We insert the fact changes and memory attacks studied in prior benchmarks into this conversation and train the manager on the resulting episodes with plain supervised fine-tuning (SFT). One conversation is enough because it stays fixed while the inserted turns differ in whether and how they should change memory, so the manager learns this decision rather than the conversation. Turns whose correct write can be predicted from surface cues such as word overlap or position are discarded.
-
Experiments. Across three backbones, SFT raises ACC and ECA in every category of our test sets over the untuned manager (the same backbone before fine-tuning) and lowers the attack success rate (ASR). Since ECA also checks the selected records, these gains show that training improves which records the manager stores and selects, not only the answers. SFT is the
only method that raises ECA in all three categories, while each memory system and defense we compare falls below the untuned manager in at least one. On Qwen3-4B, SFT also raises ECA on all eight benchmarks, five of them unseen in training.
Robustness of agent memory. Most prior work handles outdated memory and memory poisoning separately. For outdated memory, STALE tests implied changes (Chao et al., 2026); Supersede trains a model on changed facts (Patel, 2026). For memory poisoning, attacks insert content through knowledge bases, tool outputs or ordinary queries (Chen et al., 2024; Greshake et al., 2023; Dong et al., 2025), and defenses train models to ignore instructions in data (Chen et al., 2025a,b) or check retrieved records at inference time (Wei et al., 2026). The trained defenses teach a model to reject, not to decide which inputs to write. Outdated-memory benchmarks score the answer and poisoning work scores attack success, so each problem has its own metric. ECA scores the answer and also checks the records the manager selects, so one score covers both problems.
One-shot post-training. Work on data-efficient post-training finds that a few well-chosen examples can replace a large training set. A thousand curated examples can align an LLM (Zhou et al., 2023), about 800 can elicit long reasoning (Ye et al., 2025), and post-training on a single problem can match the math-reasoning gains of training on thousands of examples (Wang et al., 2025c,a). These one-shot methods fix one problem and draw many training examples from it, such as critiques of many candidate solutions or many sampled responses scored against the known answer. We follow this one-shot setting. We fix one conversation and draw many training episodes from it by inserting changes, attacks and standard turns, each with a target set by a fixed rule, and we train the manager on these episodes with plain SFT. Appendix A discusses further related work.
3 Methodology
In this section, we define the agent and its memory manager, the ECA metric and memory robustness, build training data around a single conversation, and train the manager on it with SFT.
3.1 Problem Formulation
An episode is a sequence of inputs that an agent processes in order, starting from an empty memory. An input is any text that the environment passes to the agent, such as a user turn, a tool output, a search passage or a web page. The agent has two LLMs: a memory manager , which edits the memory and selects records from it, and a policy executor , which acts on the selected records. We train only ; is a fixed LLM.
Figure 2 shows step . The memory is a set of text records, each tagged with the source and date of its input. A retriever returns at most records for the input, . The manager observes the state and takes an action with two parts. The first part is a list of operations, as in Mem0 and Memory-R1 (Chhikara et al., 2025; Yan et al., 2026): ADD a record from , UPDATE or DELETE a retrieved record, or NOP. Applying them to the retrieved records gives the edited records , which replace the retrieved ones in memory:
The second part is a read bit for each edited record . The records with form

Figure 2: One step of the agent (Equations 1 and 2). Boxes are components; edge labels are the data passed between them. Only (orange) is trained.
the selected memory , and sees only these records:
where is the output of . Either part of can be empty: if holds nothing to store, all operations are NOP; if acting on needs no stored information, no read bit is set. Memory-R1 trains a separate answer agent to select records; here the manager selects them, and because and are fixed, managers differ only in their writes and selections.
Input categories. Each input is in one of three categories, which the manager does not see. An input is in the outdated category if its speaker reports a change to a stored fact about themselves. The new value holds from a date and is stated explicitly (“I moved to Seoul”) or implicitly (“our running club disbanded”); the stored record of the old value is outdated until the manager updates it. An input is in the poisoning category if it carries an attack, and a record that stores an attack is poisoned. The attacker cannot write to the memory but controls inputs that the user did not write, such as pasted text, search passages, web pages and tool outputs. The attack is fixed in advance, does not adapt to the manager, and either states false information that a later input needs or tells the agent how to act on later inputs. All other inputs are in the standard category.
Evaluation: evidence-conditioned accuracy (ECA). For each input we know the correct write: for an outdated input, the manager stores the new value and marks the record of the old value as valid only until the change; for a poisoning input, it stores no attack; and for a standard input, it stores the information that later inputs may need (Action labeling below gives the exact operations).
Later inputs show whether these writes were made. An input depends on an earlier input if acting on needs information that the earlier input states, or if the attack of the earlier input is aimed at . We score each input that depends on an earlier input, in the category of the change or attack it depends on (standard if none). A record is evidence for if acting on needs its information; this role is annotated when the data is built and hidden from the manager.
The evidence records in form the correct memory of if none of them is outdated or poisoned and together they hold all the information that acting on needs; both hold if the manager made the correct writes. Otherwise , which no selected memory contains. If acting on needs no stored information, is empty. An input counts only if the output of is correct and the selected memory contains the correct memory:
where is correct if it ends in a correct answer. A category's ECA is the mean over its scored inputs. Both sets depend on the manager: its writes decide and its read bits decide .
Memory robustness. A manager is more robust than another if its ECA is at least as high in all three categories and higher in at least one.
Action labeling. SFT needs a target action for each state . A labeling rule sets from the category of the input and the role of each retrieved record (evidence, outdated, poisoned or none of these). For an outdated input, the target is an ADD of the new value and, for each retrieved record of the old value, an UPDATE that marks it as valid only until (“Until ”); the old record is kept because later inputs about the past still need it. For a poisoning input, the target is an ADD of only the part that is not the attack, such as the fact in a turn or search passage that also carries an injected instruction, or NOP if the input is only the attack. For a standard input, the target is an ADD of the input if a later input may need it and NOP otherwise. For every input, the target sets the read bits of the evidence records and of no outdated or poisoned record. Whenever and its records are among the edited records , a manager that reproduces the target selects all of , so it scores if answers correctly.
3.2 One-Shot Data Synthesis
The synthesis is one-shot. It uses a single base conversation , which fixes the speakers, their facts, the timeline and the unrelated turns. We insert turns of all three categories into and keep only the turns that pass a set of checks. Figure 3 shows the four stages: (1) specification: the base conversation, the fractions of the input categories, and the rules extracted from existing outdated-memory and poisoning datasets; (2) insertion, which places and writes the turns and completes each episode with its states and target actions; (3) checks; and (4) output, the resulting episodes.
Base conversation. must contain independent attributes of several types (e.g., city, job), relative time cues (e.g., “yesterday”) that the session dates resolve (to position and date the inserted changes), a plan that is never carried out (for turns that must not change memory), and a fact that a later turn replaces (for inputs about a past value), where the retriever returns the record of the old turn for the new turn. Its facts must be stated in its text, and it must not overlap the evaluation data or be chosen using evaluation results.
Insertion. Each inserted turn is written from a variant, a specification of what the turn says; the labeling rule gives its target. Some variants come as contrast pairs that differ in one factor (e.g., a change reported by the speaker vs. by another person). Further variants follow rules extracted from existing outdated-memory and poisoning datasets (Chao et al., 2026; Zou et al., 2025); each such rule keeps how a change or an attack is made but not its text. These variants add implicit (paraphrased or implied) changes, and attacks in search passages, which enter as tool turns. We also add episodes of search passages without a conversation, in which false passages assert a wrong general-knowledge fact that a later input of the episode needs.
In stage 1, we fix the fractions of inserted turns in the outdated and poisoning categories (the rest are standard). Code draws the attribute values of each turn, disjoint from the evaluation data. A change either starts from a value that mentions or introduces a new attribute and then changes it. In stage 2, code places each change after the turn that states the old fact, where no later turn of contradicts it, and balances turn positions across targets so that position does not predict the target. An LLM then writes each turn from its values, us-

Figure 3: Construction of the training data in four stages (Section 3.2). Green, red and blue mark inserted turns of the outdated, poisoning and standard categories, purple the LLM, orange the resulting data.
ing the speakers, dates and neighboring turns of . The resulting episode also contains inputs that depend on the inserted turns. Its targets follow the labeling rule; where the rule leaves a choice (the operations on the original turns of , the span that an ADD copies, extra records to select), a teacher model fills it without selecting any outdated or poisoned record. Its states come from applying the targets of the earlier turns in order.
Checks. In stage 3, five checks require that (i) a reviewer model finds that the text matches its variant; (ii) the retriever returns the old record of a change; (iii) a solver model that sees only recovers the target; (iv) the teacher's operations agree with the labeling rule; and (v) word overlap, recency, length and cue words do not predict the target above fixed thresholds, and no turn written from an extracted rule copies dataset text. A failed turn is rewritten, and one that still fails is discarded with the inputs that depend on it. The episodes that pass are the output of the synthesis (stage 4).
3.3 Supervised Fine-Tuning
Training rows. Each row of the training set is a pair of a state and a target text . All rows are synthesized by the pipeline of Section 3.2 from the single base conversation , chosen before any evaluation. Because the states are built from the targets or by code, not by a manager, they contain no manager errors; at test time, however, the manager runs on its own memory, so its earlier errors carry forward.
Prompt and target. The prompt is one fixed system prompt followed by , which lists the retrieved records in random order. The target is JSON with no rationale. It gives (the operations and the read bits) and, as labels that are trained but
not executed, the category of the input and the role of each retrieved record.
Objective. We train by minimizing its cross-entropy on the target tokens; prompt tokens carry no loss:
where the outer sum runs over the rows and is the number of target tokens.
4 Experiments
In this section, we use ECA to test whether the training-free baselines and the SFT manager are more robust than the untuned manager, on the test sets and on eight benchmarks.
4.1 Setup
Benchmarks. We build our test sets on three datasets: LoCoMo (Maharana et al., 2024) for the standard category, STALE (Chao et al., 2026) for the outdated category, and PoisonedRAG (Zou et al., 2025) for the poisoning category. The training data is synthesized around a LoCoMo conversation with rules extracted from STALE and PoisonedRAG (Section 3.2), and the three test sets, one for each category, are synthesized from held-out parts of the three datasets. The standard category uses three held-out LoCoMo conversations with 866 rows, the outdated category our test half of STALE with 597 rows, and the poisoning category a test split of PoisonedRAG with 47 attacked rows. A test row is one scored input, whereas a training row is one state-target pair (Section 3.3).
For generalization we use eight benchmarks, namely LoCoMo, LongMemEval (Wu et al., 2025) and PerLTQA (Du et al., 2024) for the standard category; STALE, the knowledge-update subset of BEAM (BEAM-KU; Tavakoli et al., 2026) and FactConsolidation of MemoryAgentBench (MAB-FC; Hu et al., 2026) for the outdated category; and PoisonedRAG and AgentPoison (Chen et al., 2024) for poisoning. LoCoMo, STALE and PoisonedRAG are seen, since the training data draws on them; the other five benchmarks are unseen. Each test set and benchmark is scored as a whole in its listed category, even if some rows fall in another (Section 3.1).
Compared methods. We compare with the untuned manager (the backbone with the same prompts, before fine-tuning) and three training-free baselines, which prompt an LLM and update no weights. Mem0 (Chhikara et al., 2025) extracts facts from each turn and, comparing them with similar stored records, adds, updates or deletes records. A-Mem (Xu et al., 2025) stores each turn as a note, links it to similar notes and rewrites their tags and context, but never deletes a note. A-MemGuard (Wei et al., 2026) stores every turn; it drops retrieved records whose LLM-written reasoning chains are inconsistent with the others or unsafe, and passes similar chains of earlier dropped records to as lessons, which are not selected records (the only exception to Equation 2).
Backbone. Every manager in the main text uses Qwen3-4B (Yang et al., 2025a) as its backbone; Appendix C repeats the experiments with two other backbones. For every method, is gemma-4-31B-it, and the selected memory is the set of records that its manager passes to (at most 8); the metrics are computed on it.
Metrics. Every category reports ACC, the share of rows whose answer a judge marks correct, and ECA, both in % (outputs that cannot be parsed fail). The judge is a separate call to gemma-4-31B-it with each benchmark's scoring prompt. In the poisoning category, ACC and ECA cover only the attacked rows, and ASR (lower is better) is the share of attacked rows whose selected memory contains a poisoned record. Category scores average their benchmarks, and overall scores average the categories. To check that the scores do not depend on this judge, we have GLM-5.2, a model from a different family, rescore 210 answers sampled from the reported runs. The two judges agree on 94% of them (Cohen's ). Cohen's (Cohen, 1960) is the agreement after removing the agreement expected by chance, where 1 means full agreement and 0 means chance level. Values above 0.80 count as almost perfect agreement (Landis and Koch, 1977), so the reported scores are not specific to the gemma-4-31B-it judge.
Protocol. Most inputs are the turns of a long multi-session conversation between two speakers, as in LoCoMo, and the memory holds facts about the speakers; a search passage, tool output or pasted text enters as a turn of its own, and so does an input that depends on earlier turns. BM25 (Robertson and Zaragoza, 2009) returns 64 records and all-MiniLM-L6-v2 (Reimers and Gurevych, 2019; Wang et al., 2020) reranks them, as in retrieval-augmented generation (Glass et al., 2022; Ram et al., 2023); the manager sees the top (no evidence record added). SFT managers decode greedily under a grammar of the JSON target format; the untuned manager samples with its default settings, and its scores are averaged over three decode seeds.
Training and testing. We select 41 turns of one LoCoMo conversation as the base conversation and synthesize the data around it with the pipeline of Section 3.2 (Figure 3): we insert turns of the three categories, 15% of them outdated and 15% poisoning, including variants that follow rules extracted from STALE and PoisonedRAG, and add false-passage episodes on general-knowledge facts. This gives 400 training episodes with 21,656 rows. The test data of Figure 4 is synthesized by the same pipeline and kept out of training: 29 episodes with the 1,510 rows of the three test sets. We fine-tune all parameters of the backbone and tune its learning rate on development splits. Figure 4 shows the results on the test sets; Figure 6 in Appendix C.1 gives every score, including overall averages.
4.2 Main Results
Every baseline loses in at least one category. Mem0 and A-Mem are built to store and retrieve facts from long conversations, as in the standard category, and there they match or exceed the untuned manager: their standard ECA is 42.4 and 50.3 against 40.6 (Figure 4). In the outdated and poisoning categories, their ECA stays near or below the untuned manager's. On outdated inputs, both answer more rows correctly than the untuned manager (ACC 48.6 and 49.1 against 31.5), but their outdated ECA is 7.0 and 11.2 against 9.0, so

Figure 4: Results of the Qwen3-4B managers on the test sets (%). In the performance panels, the dark bar is ECA and the light bar ends at ACC (grey number); poisoning ACC, ECA and ASR (lower is better) cover the attacked rows only.
most of these correct answers come from a selected memory that does not contain the correct memory. On poisoning inputs, every attack enters A-Mem's selected memory (ASR 100.0), and its poisoning ECA is 0.0 although its ACC is 66.0; Mem0 lowers ASR from 92.2 to 70.2 but has poisoning ECA 2.1, below the untuned manager's 5.0. A-MemGuard, a defense against poisoning, shows the reverse: it raises poisoning ECA from 5.0 to 21.3 but lowers standard ECA from 40.6 to 33.3. No baseline therefore raises ECA over the untuned manager in all three categories. ACC and ASR alone would hide these failures, since neither checks the answer and the selected records together, so we compare the methods by ECA.
The losses come from one fixed strategy applied to every input. A-Mem keeps every note and Mem0 writes the facts of every turn, so both also store attacks. A-MemGuard drops retrieved records that look inconsistent, so it also drops valid records. The two problems need opposite write decisions on different inputs; a strategy that makes the same decision for all inputs helps one category and hurts another, and we attribute the baselines' losses to this.
SFT is the only method that improves all three categories. SFT raises ECA over the untuned manager in all three categories, so by the definition of Section 3.1 it is more robust than the untuned manager, whereas no baseline is. It has the highest ECA in every category, so no baseline is more robust than it: 57.3 against at most 50.3 (A-Mem) on the standard test set, 28.5 against at most 11.2 (A-Mem) on outdated inputs and 34.0 against at
most 21.3 (A-MemGuard, the method designed for poisoning) on poisoning inputs. It reduces poisoning but does not prevent it: ASR falls from 92.2 to 59.6. SFT keeps the prompts of the untuned manager and adds no fixed strategy, so the difference is that it decides per input what to write and which records to select.
The results hold on two other backbones. On Qwen3.5-4B and Ministral-3-3B (Appendix C), SFT again raises ECA over the untuned manager in all three categories, and no baseline does.
4.3 Generalization
We test the Qwen3-4B managers of Section 4.2, without further training, on the eight benchmarks of Section 4.1 under the same protocol. Figure 5 reports each benchmark rather than category averages: the untuned manager's ECA ranges from 4.0 to 64.3 across them, and an average would hide where a method gains or loses. The averages and the other backbones are in Appendix C.2.
SFT gains on all eight benchmarks. SFT has higher ECA than the untuned manager on every benchmark, and the highest ECA of all managers on four, including AgentPoison (74.0 vs. 68.0 for Mem0). The gains are not limited to the seen benchmarks: ECA rises from 36.7 to 61.7 on Long-MemEval and from 6.2 to 35.0 on BEAM-KU, while on LoCoMo, PerLTQA and MAB-FC the gains are at most 3.7 points. Its category ECA stays above the untuned manager's in all three categories (Appendix C.2), so by the definition of Section 3.1 it stays more robust beyond the test sets.

Figure 5: Results of the Qwen3-4B managers on the eight benchmarks (%), the seen one (†) first in each category. Bars as in Figure 4.
Baselines lose on more benchmarks. Mem0, A-MemGuard and A-Mem fall below the untuned manager's ECA on 3, 4 and 2 of the eight benchmarks, and SFT on none. On AgentPoison, A-MemGuard, the method designed for poisoning, lowers ECA from 64.0 to 44.0 and raises ASR from 0.0 to 42.0, so it loses even in its own category. A-Mem has the highest ECA on all three standard benchmarks, but ASR 100.0 and ECA 0.0 on PoisonedRAG and AgentPoison, and on STALE its ECA (12.7) is close to the untuned manager's (10.7). Mem0 leads on MAB-FC (76.0 vs. 28.0 for SFT), where a later fact replaces an earlier one with no reported change, which our outdated category does not cover (Section 3.1).
SFT is the only trained method, and its data is built around one conversation, yet it is the only manager that never falls below the untuned manager, so what it learns is not tied to that conversation.
5 Conclusion
We studied memory robustness for LLM agents: a memory manager should follow changed facts, reject poisoned content, and stay accurate on standard inputs. To measure it, we introduced evidence-conditioned accuracy (ECA), which checks both the answer and the memory records behind it. Under ECA, the existing memory systems and defenses we test are not more robust than an untuned manager on our test sets; each gains in one category and loses in another. A simple one-shot recipe, which synthesizes training episodes around a sin-
gle conversation and fine-tunes the manager on them, improves robustness on all three backbones, although robustness remains incomplete. We hope this work encourages evaluating memory managers on the records they keep as well as on the answers they give, and studying outdated memory and memory poisoning together. Future work includes other agent settings, stronger attacks and training methods beyond supervised fine-tuning.
Limitations
Our study focuses on the memory managers of conversational agents. Other settings, such as web or embodied agents whose memory tracks a changing environment, are not evaluated, and we leave them to future work. As with most empirical studies of LLM agents, our evaluation covers a finite set of backbones, benchmarks and attack types, and may not include every form of outdated memory or memory poisoning that arises in deployment. We also compare against a limited set of existing memory systems and defenses, so our findings about them may not extend to other methods. Our conclusions should therefore be read as holding within the settings we study.
Ethics Statement
This work aims to make LLM agents with long-term memory more reliable and secure. The poisoned content we generate follows published attack patterns, introduces no new attack technique and is used only in our experiments. All datasets are public research benchmarks used for their intended purpose, and our data involves no human participants or personal information. The SFT manager does not eliminate all attacks and should be used together with other safeguards. We will release our code for research use.
AI Use Statement
We used AI assistants only to polish the writing of this paper. All research ideas, experiments, analyses and conclusions are our own, and we take full responsibility for the content.
Acknowledgments
This work was supported in part by the Defense Advanced Research Projects Agency (DARPA) under Cooperative Agreement No. HR0011-24-2-0004. We thank Indiana University's Research and Academic LLM Services (REALLMS) for providing API access to gemma-4-31B-it and GLM-5.2 for our experiments.
Distribution statement: Approved for public release; distribution is unlimited.
References
Pritom Bhowmik. 2026. The price of safety: Benign-case utility and token overhead of memory-poisoning defenses in LLM agents. Preprint, arXiv:2609.22818.
Hanxiang Chao, Yihan Bai, Rui Sheng, Tianle Li, and Yushi Sun. 2026. STALE: Can LLM agents know when their memories are no longer valid? Preprint, arXiv:2605.06527.
Sizhe Chen, Julien Piet, Chawin Sitawarin, and David Wagner. 2025a. StruQ: Defending against prompt injection with structured queries. In 34th USENIX Security Symposium (USENIX Security 25), pages 2383–2400, Seattle, WA. USENIX Association.
Sizhe Chen, Arman Zharmagambetov, Saeed Mahloujifar, Kamalika Chaudhuri, David Wagner, and Chuan Guo. 2025b. SecAlign: Defending against prompt injection with preference optimization. In Proceedings of the 2025 ACM SIGSAC Conference on Computer and Communications Security, pages 2833–2847. ACM.
Xuanze Chen, Xukang Xie, Wentao Fu, Jiajun Zhou, Shanqing Yu, and Qi Xuan. 2026. MemSecBench: Tracking agent memory poisoning from persistence to consequence and repair. Preprint, arXiv:2607.27080.
Zhaorun Chen, Zhen Xiang, Chaowei Xiao, Dawn Song, and Bo Li. 2024. AgentPoison: Red-teaming LLM agents via poisoning memory or knowledge bases. In
Advances in Neural Information Processing Systems, volume 37, pages 130185–130213.
Prateek Chhikara, Dev Khant, Saket Aryan, Taranjeet Singh, and Deshraj Yadav. 2025. Mem0: Building production-ready AI agents with scalable long-term memory. Preprint, arXiv:2504.19413.
Jacob Cohen. 1960. A coefficient of agreement for nominal scales. Educational and Psychological Measurement, 20(1):37–46.
Shen Dong, Shaochen Xu, Pengfei He, Yige Li, Jiliang Tang, Tianming Liu, Hui Liu, and Zhen Xiang. 2025. Memory injection attacks on LLM agents via query-only interaction. In Advances in Neural Information Processing Systems, volume 38, pages 46697–46731.
Yiming Du, Hongru Wang, Zhengyi Zhao, Bin Liang, Baojun Wang, Wanjun Zhong, Zezhong Wang, and Kam-Fai Wong. 2024. PerLTQA: A personal long-term memory dataset for memory classification, retrieval, and fusion in question answering. In Proceedings of the 10th SIGHAN Workshop on Chinese Language Processing (SIGHAN-10), pages 152–164, Bangkok, Thailand. Association for Computational Linguistics.
Matt Gardner, Yoav Artzi, Victoria Basmov, Jonathan Berant, Ben Bogin, Sihao Chen, Pradeep Dasigi, Dheeru Dua, Yanai Elazar, Ananth Gottumukkala, Nitish Gupta, Hannaneh Hajishirzi, Gabriel Ilharco, Daniel Khashabi, Kevin Lin, Jiangming Liu, Nelson F. Liu, Phoebe Mulcaire, Qiang Ning, and 7 others. 2020. Evaluating models' local decision boundaries via contrast sets. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1307–1323, Online. Association for Computational Linguistics.
Michael Glass, Gaetano Rossiello, Md Faisal Mahbub Chowdhury, Ankita Rajaram Naik, Pengshan Cai, and Alfio Gliozzo. 2022. Re2G: Retrieve, rerank, generate. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 2701–2715.
Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz, and Mario Fritz. 2023. Not what you've signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection. In Proceedings of the 16th ACM Workshop on Artificial Intelligence and Security, pages 79–90. ACM.
Yuanzhe Hu, Yu Wang, and Julian McAuley. 2026. Evaluating memory in LLM agents via incremental multi-turn interactions. In International Conference on Learning Representations.
Gautier Izacard, Mathilde Caron, Lucas Hosseini, Sebastian Riedel, Piotr Bojanowski, Armand Joulin, and Edouard Grave. 2022. Unsupervised dense information retrieval with contrastive learning. Transactions on Machine Learning Research.
Divyansh Kaushik, Eduard Hovy, and Zachary C. Lipton. 2020. Learning the difference that makes a difference with counterfactually-augmented data. In International Conference on Learning Representations.
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. 2019. Natural questions: A benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:452–466.
J. Richard Landis and Gary G. Koch. 1977. The measurement of observer agreement for categorical data. Biometrics, 33(1):159–174.
Nicholas Lee, Thanakul Wattanawong, Sehoon Kim, Kartikeya Mangalam, Sheng Shen, Gopala Anumanchipalli, Michael Mahoney, Kurt Keutzer, and Amir Gholami. 2024. LLM2LLM: Boosting LLMs with novel iterative data enhancement. In Findings of the Association for Computational Linguistics: ACL 2024, pages 6498–6526.
Hao Li, Xiaogeng Liu, Ning Zhang, and Chaowei Xiao. 2025. PIGuard: Prompt injection guardrail via mitigating overdefense for free. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 30420–30437, Vienna, Austria. Association for Computational Linguistics.
Alexander H. Liu, Kartik Khandelwal, Sandeep Subramanian, Victor Jouault, et al. 2026. Ministral 3. Preprint, arXiv:2601.08584.
Adyasha Maharana, Dong-Ho Lee, Sergey Tulyakov, Mohit Bansal, Francesco Barbieri, and Yuwei Fang. 2024. Evaluating very long-term conversational memory of LLM agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13851–13870.
Ali Modarressi, Abdullatif Köksal, Ayyoob Imani, Mohsen Fayyaz, and Hinrich Schütze. 2025. Mem-LLM: Finetuning LLMs to use explicit read-write memory. Transactions on Machine Learning Research.
Kai Tzu-iunn Ong, Namyoung Kim, Minju Gwak, Hyungjoo Chae, Taeyoon Kwon, Yohan Jo, Seung-won Hwang, Dongha Lee, and Jinyoung Yeo. 2025. Towards lifelong dialogue agents via timeline-based memory management. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 8631–8661, Albuquerque, New Mexico. Association for Computational Linguistics.
Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, and Joseph E. Gonzalez. 2023. MemGPT: Towards LLMs as operating systems. Preprint, arXiv:2310.08560.
Vedant Patel. 2026. Supersede: Diagnosing and training the memory-update gap in LLM agents. Preprint, arXiv:2606.27472.
Qwen Team. 2026. Qwen3.5: Towards native multi-modal agents. Blog post.
Ori Ram, Yoav Levine, Itay Dalmedigos, Dor Muhlgay, Amnon Shashua, Kevin Leyton-Brown, and Yoav Shoham. 2023. In-context retrieval-augmented language models. Transactions of the Association for Computational Linguistics, 11:1316–1331.
Preston Rasmussen, Pavlo Paliychuk, Travis Beauvais, Jack Ryan, and Daniel Chalef. 2025. Zep: A temporal knowledge graph architecture for agent memory. Preprint, arXiv:2501.13956.
Nils Reimers and Iryna Gurevych. 2019. SentenceBERT: Sentence embeddings using Siamese BERT-networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3982–3992.
Stephen Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: BM25 and beyond. Foundations and Trends in Information Retrieval, 3(4):333–389.
Paul Röttger, Hannah Kirk, Bertie Vidgen, Giuseppe Attanasio, Federico Bianchi, and Dirk Hovy. 2024. XTest: A test suite for identifying exaggerated safety behaviours in large language models. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 5377–5400, Mexico City, Mexico. Association for Computational Linguistics.
Gaurav Sahu, Pau Rodriguez, Issam Laradji, Parmida Atighehchian, David Vazquez, and Dzmitry Bahdanau. 2022. Data augmentation for intent classification with off-the-shelf large language models. In Proceedings of the 4th Workshop on NLP for Conversational AI, pages 47–57.
Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, Y. K. Li, Y. Wu, and Daya Guo. 2024. DeepSeekMath: Pushing the limits of mathematical reasoning in open language models. Preprint, arXiv:2402.03300.
Zhiqing Sun, Yikang Shen, Qinhong Zhou, Hongxin Zhang, Zhenfang Chen, David Cox, Yiming Yang, and Chuang Gan. 2023. Principle-driven self-alignment of language models from scratch with minimal human supervision. In Advances in Neural Information Processing Systems, volume 36, pages 2511–2565.
Mohammad Tavakoli, Alireza Salemi, Carrie Ye, Mohamed Abdalla, Hamed Zamani, and J. Ross Mitchell. 2026. Beyond a million tokens: Benchmarking and enhancing long-term memory in LLMs. In International Conference on Learning Representations.
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. 2019. Robustness may be at odds with accuracy. In International Conference on Learning Representations.
Eric Wallace, Kai Xiao, Reimar Leike, Lilian Weng, Johannes Heidecke, and Alex Beutel. 2024. The instruction hierarchy: Training LLMs to prioritize privileged instructions. Preprint, arXiv:2404.13208.
Wenhui Wang, Furu Wei, Li Dong, Hangbo Bao, Nan Yang, and Ming Zhou. 2020. MiniLM: Deep self-attention distillation for task-agnostic compression of pre-trained transformers. In Advances in Neural Information Processing Systems, volume 33, pages 5776–5788.
Yiping Wang, Qing Yang, Zhiyuan Zeng, Liliang Ren, Liyuan Liu, Baolin Peng, Hao Cheng, Xuehai He, Kuan Wang, Jianfeng Gao, Weizhu Chen, Shuohang Wang, Simon Shaolei Du, and Yelong Shen. 2025a. Reinforcement learning for reasoning in large language models with one training example. In Advances in Neural Information Processing Systems, volume 38, pages 122721–122764.
Yiqi Wang, Jiaqi Liu, Jiaqi Zhang, Zhangkai Wu, Yiqun Duan, Mingkai Zheng, and Taotao Cai. 2026. PACMI: Provenance-aware cascading memory invalidation for long-term LLM agents. Preprint, arXiv:2610.05732.
Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, and Hannaneh Hajishirzi. 2023. Self-Instruct: Aligning language models with self-generated instructions. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13484–13508, Toronto, Canada. Association for Computational Linguistics.
Yu Wang, Ryuichi Takanobu, Zhiqi Liang, Yuzhen Mao, Yuanzhe Hu, Julian McAuley, and Xiaojian Wu. 2025b. Mem-α: Learning memory construction via reinforcement learning. Preprint, arXiv:2509.25911.
Yubo Wang, Ping Nie, Kai Zou, Lijun Wu, and Wenhu Chen. 2025c. Unleashing the reasoning potential of LLMs by critique fine-tuning on one problem. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 3017–3027, Suzhou, China. Association for Computational Linguistics.
Qianshan Wei, Tengchao Yang, Yaochen Wang, Xinfeng Li, Lijun Li, Zhenfei Yin, Yi Zhan, Thorsten Holz, Zhiqiang Lin, and XiaoFeng Wang. 2026. A-MemGuard: A proactive defense framework for LLM-based agent memory. In Proceedings of the 43rd International Conference on Machine Learning,
volume 306 of Proceedings of Machine Learning Research, pages 134176–134202. PMLR.
Di Wu, Hongwei Wang, Wenhao Yu, Yuwei Zhang, Kai-Wei Chang, and Dong Yu. 2025. LongMemEval: Benchmarking chat assistants on long-term interactive memory. In International Conference on Learning Representations.
Jian Xie, Kai Zhang, Jiangjie Chen, Renze Lou, and Yu Su. 2024. Adaptive chameleon or stubborn sloth: Revealing the behavior of large language models in knowledge conflicts. In International Conference on Learning Representations.
Rongwu Xu, Zehan Qi, Zhijiang Guo, Cunxiang Wang, Hongru Wang, Yue Zhang, and Wei Xu. 2024. Knowledge conflicts for LLMs: A survey. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 8541–8565, Miami, Florida, USA. Association for Computational Linguistics.
Wujiang Xu, Zujie Liang, Kai Mei, Hang Gao, Juntao Tan, and Yongfeng Zhang. 2025. A-MEM: Agentic memory for LLM agents. In Advances in Neural Information Processing Systems, volume 38, pages 17577–17604.
Sikuan Yan, Xiufeng Yang, Zuchao Huang, Ercong Nie, Zifeng Ding, Zonggen Li, Xiaowen Ma, Jinhe Bi, Kristian Kersting, Jeff Z. Pan, Hinrich Schuetze, Volker Tresp, and Yunpu Ma. 2026. Memory-R1: Enhancing large language model agents to manage and utilize memories via reinforcement learning. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 12805–12825, San Diego, California, United States. Association for Computational Linguistics.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, et al. 2025a. Qwen3 technical report. Preprint, arXiv:2505.09388.
Tianyu Yang, Sudipta Paul, Vijay Srinivasan, Vivek Kulkarni, and Srinivas Chappidi. 2026. Trust-Mem: Learning trustworthy memory consolidation for LLM agents with long-term memory. Preprint, arXiv:2606.25161.
Zitong Yang, Neil Band, Shuangping Li, Emmanuel Candès, and Tatsunori Hashimoto. 2025b. Synthetic continued pretraining. In International Conference on Learning Representations.
Yixin Ye, Zhen Huang, Yang Xiao, Ethan Chern, Shijie Xia, and Pengfei Liu. 2025. LIMO: Less is more for reasoning. In Second Conference on Language Modeling.
Yi Yu, Liuyi Yao, Yuexiang Xie, Qingquan Tan, Jiaqi Feng, Yaliang Li, and Libing Wu. 2026. Agentic memory: Learning unified long-term and short-term memory management for large language model agents. Preprint, arXiv:2601.01885.
Wanjun Zhong, Lianghong Guo, Qiqi Gao, He Ye, and Yanlin Wang. 2024. MemoryBank: Enhancing large language models with long-term memory. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 19724–19731.
Chunting Zhou, Pengfei Liu, Puxin Xu, Srinivasan Iyer, Jiao Sun, Yuning Mao, Xuezhe Ma, Avia Efrat, Ping Yu, Lili Yu, Susan Zhang, Gargi Ghosh, Mike Lewis, Luke Zettlemoyer, and Omer Levy. 2023. LIMA: Less is more for alignment. In Advances in Neural Information Processing Systems, volume 36, pages 55006–55021.
Wei Zou, Runpeng Geng, Binghui Wang, and Jinyuan Jia. 2025. PoisonedRAG: Knowledge corruption attacks to retrieval-augmented generation of large language models. In 34th USENIX Security Symposium (USENIX Security 25), pages 3827–3844.
Appendix Contents
A Further Related Work ..... 14
B Experimental Details ..... 14
B.1 Base Conversation ..... 14
B.2 Training Data ..... 14
B.3 Training ..... 16
B.4 Evaluation Protocol and Metrics ..... 16
B.5 Evaluation Sets ..... 17
C Full Results ..... 18
C.1 Test Sets ..... 18
C.2 Per-Benchmark Results ..... 19
C.3 Other Backbones ..... 19
D Ablations and Analyses ..... 22
D.1 Training-Data Ablations ..... 22
D.2 Beyond the Base Conversation ..... 23
D.3 Owner Changes and Cost ..... 24
A Further Related Work
Outdated memory. Training-free methods keep replaced facts with validity intervals or on a timeline (Rasmussen et al., 2025; Ong et al., 2025), as our updated records do (“Until d, …”), and PACMI propagates invalidity through a provenance graph (Wang et al., 2026). Supersede trains a 3B model with group relative policy optimization (Shao et al., 2024) on changed facts (Patel, 2026); we use plain SFT on data built around one conversation.
Memory poisoning and its cost. MemSecBench follows poisoned memory to later actions (Chen et al., 2026), and The Price of Safety measures what poisoning defenses cost on inputs without attacks (Bhowmik, 2026). Similar trade-offs appear as exaggerated refusal (Röttger et al., 2024), over-defense in prompt-injection guards (Li et al., 2025), lower clean accuracy under adversarial training (Tsipras et al., 2019), and acceptance of misinformation by LLMs that update on conflicting evidence (Xie et al., 2024; Xu et al., 2024). These works measure the cost.
Data-efficient post-training. One-shot critique fine-tuning trains on teacher critiques of many solutions to one problem (Wang et al., 2025c), and 1-shot reinforcement learning with verifiable rewards on many sampled responses to one problem (Wang et al., 2025a). LLM-based augmentation expands a small seed set or corpus (Wang et al., 2023; Sun et al., 2023; Lee et al., 2024; Yang et al., 2025b), but generated examples can drift to a neighboring label (Sahu et al., 2022); our checks (Section 3.2) test for this drift. Our contrast pairs follow counterfactual data and contrast sets, which make small edits that change the label (Kaushik et al., 2020; Gardner et al., 2020).
B Experimental Details
B.1 Base Conversation
The base conversation is an excerpt of 41 turns from one LoCoMo conversation, chosen in two steps before any evaluation. First, using only the LoCoMo annotations of the scored inputs, we counted in each of the ten LoCoMo conversations the single-hop, multi-hop and temporal inputs whose evidence turns resolve and contain no photo; conv-41 had the most (90). Second, we took 41 original turns from three of its sessions (16 turns of session 25 on 2023-07-22, the first six turns of session 26 on 2023-07-31 and all 19 turns of session 28 on 2023-08-05), with their wording, speakers, dates and order unchanged, so that the excerpt contains a replaced fact (John's job at a mechanical engineering company, reported lost in session 28), plans, relative time cues and unrelated facts of both speakers. Table 1 states the requirements of Section 3.2 as criteria for the conversation from which is taken and checks them on all of conv-41; of the seven LoCoMo conversations outside the test set, five meet them (conv-41, conv-26, conv-43, conv-42 and conv-50), and these are the source conversations of the ablations (Appendix D.1).
B.2 Training Data
The variants are fact changes (a value replaced, a plan realized or cancelled, an activity stopped); no-change controls, which resemble changes but must not change memory (the owner's restatement, a third party's claim, a plan; the owner of a fact is the speaker it is about); turns with an injected instruction, alone or mixed with a fact; and rule-based variants, which follow rules extracted from STALE and PoisonedRAG (Section 3.2) and take from them only how a change or an attack is made, never their text: paraphrased or implied changes and inputs that never name the attribute (STALE), and search passages with or without an injected instruction (PoisonedRAG). The fractions of outdated and poisoning turns (15% each, Section 4.1) set how many turns of each category are inserted; the shares of training rows in Appendix D.1 differ from them because they also count the rows of inputs that depend on other inputs and the rows of rule-based variants and false-passage episodes.
Table 2 lists the four parts of the data. Each row holds one input and at most eight retrieved records and trains both the operations and the read bits. Parts (i) and (ii) are built from a table of about 130 changes over 16 attribute types and nine types of change, from attacks of five fixed templates, and from no-change controls, and an LLM writes each of their turns from its entry in the table. About one third of the changes start from a value already in the conversation, and each change gets template inputs that ask about its
| Criterion | Threshold | Evidence in conv-41 |
|---|---|---|
| 1 Independent attributes | verified attributes of types | 10 attributes of 7 types, e.g. John lost his job at a mechanical engineering company; Maria practices aerial yoga |
| 2 Time cues | verified relative time cues | 8, e.g. “Just yesterday I joined a nearby church” (2023-05-05) |
| 3 Plan vs. completed event | verified plan never carried out | 6, e.g. “I’m planning a trip to the East Coast”, never reported as taken |
| 4 Facts valid in the past | verified replacement, old before new, no later contradiction | 3, e.g. John: “I’m really enjoying my new job” → “I lost my job at the mechanical engineering company” |
| 5 Retrieval coverage | old turn in the retriever’s top 8 for replacement | 2 of 3; the job change: old turn ranked 1 of 53 |
| 6 Evidence in the text only | cited evidence needs no image or outside knowledge | yes |
| 7 Train/test separation | not conv-30, 47 or 49; no evaluation result used | yes |
Table 1: Criteria for the conversation from which the base conversation is taken, checked on all of conv-41.
current value or its past value or carry a false premise. These two parts contain only explicit changes and templated attacks, so part (iii) adds implicit (paraphrased or implied) changes, which share at most one content word with the old fact, and attack passages; gpt-6.1-sol writes parts (iii) and (iv). A false-passage episode (iv) is about a general-knowledge fact with one established value: it has supporting passages, five fluent passages that assert one wrong value without any instruction, and on-topic distractors, all rendered as search-tool output, and an input that needs the fact; its targets store and select the supporting passages and not the false ones. Besides the memory built from the targets (Section 3.2), for 30% of the changes, the inputs that depend on them get extra rows whose memory holds every turn verbatim.
The recipe was informed by the STALE and PoisonedRAG development splits, but no text of either was used: rule-based variants that share an 8-gram with STALE or PoisonedRAG text, or reach a 5-gram Jaccard similarity of 0.5 with it, are removed, and so are false-passage episodes that share an 8-gram with any evaluation text or match a PoisonedRAG input and its answer. The cue check (v) of Section 3.2 requires that simple cues (word overlap, recency, length and cue words for old vs. new records; length, overlap with the input, position and specificity for false vs. supporting passages) recover the target with accuracy at most 55% to 65%.
| Part | Content | Rows | Targets |
|---|---|---|---|
| (i) Episode steps | Changes, attacks and no-change controls inserted into a 41-turn excerpt of conv-41 | 6,546 | Labeling rule; teacher operations on original turns (4,351) |
| (ii) Contrast pairs | Copies of a step that differ only in the factor that decides the target | 4,721 | Labeling rule |
| (iii) Rule-based variants | Implicit changes (paraphrased 1,430, implied 1,550, task-style input 253); attack passages (1,577) | 4,810 | Design of the variant |
| Conversation rows | (i)–(iii) | 16,077 | |
| (iv) False-passage episodes | Supporting, false and distractor passages for general-knowledge facts | 5,579 | Design of the episode |
| All backbones | (i)–(iv), 400 episodes | 21,656 |
Table 2: Composition of the training data.
B.3 Training
Table 3 lists the training and inference settings.
Prompts and targets. The state in the prompt is a JSON object with the date of the input, the input, and the retrieved records (identifier, date, session, source type, speaker, text), relabeled M1, M2, ... in a seeded random order. As in Section 3.3, a target text gives the target action (the operations, ADD, NOP, or ADD with one to three UPDATES, and a read bit per retrieved record) and labels of the input's category and of each retrieved record's role; it also restates the read bits as a decision (select some records or none) and a list of the selected records. Following the action labeling of Section 3.1, the read bits select the evidence records, including an updated record when the input asks about the past, and no outdated or poisoned record. Only the operations and the read bits are executed. The teacher (gpt-6-luna) fills the choices that the labeling rule leaves open, namely the operations on the original conv-41 turns (4,351 rows) and parts of 2,091 further targets (an added span, a label or extra selected records).
| Training | |
|---|---|
| Fine-tuned parameters | All |
| Learning rate | |
| Learning rates tried | |
| Optimizer | AdamW, weight decay 0.01 |
| Gradient clipping (norm) | 1.0 |
| Schedule | 20 warmup steps, cosine decay to 0 |
| Epochs | 2 |
| Batch size (rows per step) | 4 |
| Training rows / steps | 21,656 / 10,828 |
| Longest prompt / target | 2,418 / 251 tokens (no truncation) |
| Loss | Token-averaged cross-entropy on target tokens (incl. EOS) |
| Precision | bfloat16 |
| Hardware / checkpoint | One H100 / after the last step |
| Memory manager at test time | |
|---|---|
| Decoding (SFT) | Greedy, thinking off, grammar of the JSON target schema |
| Decoding (untuned) | Model-card defaults (T 0.7, top-p 0.8, top-k 20) / model-card defaults / model-card defaults |
| Decode seeds (untuned) | 3 (averaged per row) |
| Max prompt / new tokens | 16,384 / 4,096 |
| Retrieval | |
| First stage | BM25, 64 candidates |
| Reranker | all-MiniLM-L6-v2 |
| Records shown to the manager () | 8 |
| and judge | |
| Model | gemma-4-31B-it |
| Decoding | T 1.0, top-p 0.95, top-k 64, thinking off |
| Max new tokens () | 1,024 |
Table 3: Training and inference settings. Values written a / b / c are for Qwen3-4B / Qwen3.5-4B / Ministral-3-3B; a single value is shared by all backbones. The learning rate is tuned per backbone on the development splits.
B.4 Evaluation Protocol and Metrics
The retriever is queried with the speaker and text of each input over the records of the manager's own memory, and the top 8 records are relabeled M1, M2, ... in a seeded random order, as in training. The manager gives 1–4 operations per input, which are applied deterministically: an added record is linked to its source turn, an updated record keeps the old record's turns and adds the new turn, and a deleted record is never retrieved again. As in Section 4.1, outputs that cannot be parsed fail: operations that cannot be parsed, are cut off or break the operation constraints (e.g., add text not copied from the input or name a record that was not retrieved) are executed as NOP, invalid read bits give an empty selected memory, an empty or cut-off answer is scored wrong, and every failure stays in the denominators. The baselines are run with one decode seed; all other decoding settings are in Table 3.
sees only the selected memory, with one prompt per benchmark; the STALE prompt renders the selected records in chronological order with session dates and asks to use the most recent related evidence when the asked attribute is implicit. The judge is gemma-4-31B-it, called separately from (Section 4.1), with the scoring prompt of each benchmark; for example, the STALE prompt also shows the benchmark's annotated old and new memory, LoCoMo uses the Mem0 judge prompt (Chhikara et al., 2025), BEAM its nugget-based prompt, and PoisonedRAG, LongMemEval, MAB-FC and PerLTQA the LongMemEval answer check.
Record roles come from the benchmark's annotation or our construction, never from a model (Table 4); a record with none of the listed roles is irrelevant. A record linked to any evidence turn is evidence, and a record that stores an attack is poisoned (Section 3.1); a record that keeps only the part of a poisoning input that is not the attack, as in Figure 1b, is not poisoned; in the outdated category, a record linked to both old and new evidence takes the role of its latest turn, and an updated record ("Until , ...") is not outdated. With these roles, the selected memory contains the correct memory (Section 3.1) if it holds every evidence record in memory, none of them is outdated or poisoned, and every evidence turn of the input is linked to one of them.
ASR is measured on the selected memory rather than on the answer, because with a fixed answer-level attack success barely separates managers; on PoisonedRAG, answer-level success also counts answers that contain the attacker's chosen answer with no poisoned record selected, and on AgentPoison the output that the attack aims for is also what says when it abstains. Because an empty selected memory counts as a defended attack, we also report poisoning ACC.
Intervals of differences between two managers, as in Appendix D.1, are 95% paired cluster-bootstrap percentile intervals with 10,000 resamples, clustered by STALE episode, PoisonedRAG input, AgentPoison input, LoCoMo window, and held-out input or episode. For models trained with three seeds we report the mean and the standard deviation (SD) across seeds.
B.5 Evaluation Sets
The evaluation has two parts (Section 4.1): the three test sets of Figures 4 and 6, which are synthesized by the pipeline of Section 3.2 from held-out parts of LoCoMo, STALE and PoisonedRAG, and the eight benchmarks of Figures 5 and 7–9, which test generalization. Table 4 lists every set; poisoning sets score the attacked copy of each input. No test input was used for training, and nothing from the five unseen benchmarks was used. The three test sets of Figure 6 were fixed before we saw any output of an SFT manager on them, and the evaluation sets of Figures 7–9 were sampled with a fixed seed before any model output.
STALE: we use the STALE conversations (Chao et al., 2026) with a paraphrased or implied change; a fixed hash splits them into a development half and a test half. The outdated test set is synthesized from the changes of the test half, and the 100-episode sample of Figure 8 is drawn from both halves.
LoCoMo: the standard test set is synthesized on the held-out conversations conv-30, 47 and 49, with contrast pairs (Section 3.2) that differ only in whether the input should be written (an impersonated vs. a real owner change, a non-owner vs. an owner statement, a clean vs. a poisoning tool passage). As stated in Section 4.1, the set is scored as a whole in the standard category, so its 866 rows include the 407 rows we added about changes (323 about inserted changes and 84 about changes already in the conversations; Table 6).
PoisonedRAG: the poisoning test set is synthesized from the 47 inputs of Natural Questions (Kwiatkowski et al., 2019) left in the test split after removing yes/no inputs, inputs in MemoryAgentBench, and the inputs of the held-out sample and of a development split. For each input, the clean copy places the top eight Contriever (Izacard et al., 2022) passages for the input, one passage per turn, in one block among passages retrieved for other inputs; the attacked copy adds the release's five poisoned texts inside the block. The test split shares no input or passage with the held-out sample of Figure 9.
An audit against the training rows finds no shared 8-gram, no verbatim input, and no answer value attached to the same input, but the LoCoMo test episodes share the generator and part of the input templates with training, so Appendix D.2 reports held-out templates separately.
| Category | Benchmark | Figure | Seen | Rows | Record roles from |
|---|---|---|---|---|---|
| Outdated | STALE test set | 6 | ✓ | 597 | Old and new evidence sessions of the episode |
| STALE, 100-episode sample | 8 | ✓ | 300 (100 ep.) | As above | |
| BEAM-KU | 8 | 80 | original_info and updated_info source chats | ||
| MAB-FC | 8 | 100 | Gold fact index; outdated: the earlier fact with the same subject and relation | ||
| Poisoning | PoisonedRAG test set | 6 | ✓ | 47 | Five poisoned texts; clean retrieved passages |
| PoisonedRAG, held-out sample | 9 | ✓ | 50 | As above | |
| AgentPoison | 9 | 50 | Demonstration with the trigger (poisoned); no evidence record | ||
| Standard | LoCoMo test (conv-30, 47, 49) | 6 | ✓ | 866 | Our construction of the inserted turns; native evidence annotation |
| LoCoMo test, native inputs | 7 | ✓ | 459 | Native evidence annotation | |
| LongMemEval | 7 | 120 | Turns marked has_answer | ||
| PerLTQA | 7 | 100 | Reference memory ids |
Table 4: Evaluation sets: the three synthesized test sets (Figure 6) and the eight benchmarks (Figures 7–9), with the source of their record roles (MAB: MemoryAgentBench).
C Full Results
We repeat the experiments of Sections 4.2 and 4.3 with two other 3–4B backbones, Qwen3.5-4B (Qwen Team, 2026), used as a text-only model, and Minstral-3-3B (Liu et al., 2026). Both train on the same dataset as Qwen3-4B with their own learning rate (Table 3), and every baseline runs on the same backbone as the manager it is compared with.
C.1 Test Sets
Figure 6 gives the ACC, ECA and ASR of every manager on the test sets, per backbone; its Qwen3-4B row repeats Figure 4 and adds the overall scores. Poisoning ACC, ASR and ECA cover the attacked rows only.

Figure 6: Results on the test sets per backbone (%); the Qwen3-4B row is Figure 4 with the overall scores added. The untuned manager is the mean over three decode seeds. Bars as in Figure 4: the dark bar is ECA and the light bar ends at ACC (grey number). Poisoning ACC, ECA and ASR (lower is better) cover the attacked rows only.
C.2 Per-Benchmark Results
Figures 7, 8 and 9 give each benchmark and the category average per backbone, with the seen benchmark (†) first; Figure 5 shows their Qwen3-4B rows.
A fixed manager, Read all, stores every turn and passes every retrieved record to , under the same protocol as the other methods.
SFT has the highest STALE and BEAM-KU ECA of all managers on every backbone, and the highest average poisoning ECA. Read all has average standard ECA 70.6, below only A-Mem on Qwen3.5-4B (73.1), but passes every AgentPoison and PoisonedRAG attack and has average outdated ECA 12.6.
Reading the figures. The STALE sample of Figure 8 overlaps the development half and the test half of STALE, and BEAM-KU ACC is its nugget score; its ECA counts a row as correct only at the full nugget score. On MAB-FC the manager writes a 455-fact episode. The LoCoMo column of Figure 7 scores only the 459 native LoCoMo rows of the standard test set, not the 407 rows we added about changes, so it differs from the standard scores of Figure 6. As in Figure 6, ECA is computed over all rows of a benchmark, so a row whose evidence is not retrieved counts as a failure. On AgentPoison, the untuned and SFT managers rarely select a poisoned record (ASR at most 6.0), so SFT lowers ASR only on PoisonedRAG.
Per-row changes. For each test set of Figure 6 and each unseen benchmark, SFT fixes a row if the untuned manager has ECA 0 under all three decode seeds and SFT has ECA 1, and breaks it if SFT has ECA 0 and the untuned manager has ECA 1 under at least two seeds (poisoning counts attacked rows only). Summed over the outdated and over the poisoning category, SFT fixes more rows than it breaks on every backbone. On Qwen3-4B, Qwen3.5-4B and Ministral-3-3B it fixes / breaks 165 / 34, 131 / 60 and 137 / 43 rows in the outdated category, and 21 / 3, 24 / 1 and 22 / 4 in the poisoning category.
C.3 Other Backbones
On the test sets (Figure 6), SFT raises ECA over the untuned manager in all three categories on both backbones: on Qwen3.5-4B from 41.7 to 63.0 (standard), 9.3 to 29.0 (outdated) and 26.2 to 76.6

Figure 7: Per-benchmark results in the standard category (%) per backbone, and for the fixed manager Read all (Fixed), which uses no manager model. Average is the mean of the three benchmarks. Bars as in Figure 6. †Seen.

Figure 8: Per-benchmark results in the outdated category (%) per backbone, and for the fixed manager Read all (Fixed). Average is the mean of the three benchmarks. Bars as in Figure 6. †Seen.
(poisoning), and on Ministral-3-3B from 41.1 to 58.8, 5.3 to 27.1 and 13.5 to 51.1. ASR falls from 61.7 to 19.1 and from 81.6 to 40.4. Every baseline falls below the untuned manager's ECA in at least one category on both backbones. SFT has the highest ECA in every category except standard ECA on Ministral-3-3B, where A-Mem is higher (62.9 vs. 58.8) but has poisoning ECA 0.0 and ASR 100.0.
On the eight benchmarks (Figures 7–9), SFT's category-average ECA is at least the untuned manager's in every category on both backbones (equal in the outdated category on Ministral-3-3B), while Mem0 and A-MemGuard are below it in all three categories on both backbones. Per benchmark, SFT is below the untuned manager only on MAB-FC (28.0 vs. 66.0 on Qwen3.5-4B and 18.0 vs. 47.3 on Ministral-3-3B).
Poisoning performance
Qwen3-4B
Qwen3.5-4B
Fixed
Mineral3-3B

Poisoning ASR (lower is better)
Qwen3-4B
Qwen3.5-4B
Fixed
Mineral3-3B

Figure 9: Per-benchmark results in the poisoning category (%) per backbone, and for the fixed manager Read all (Fixed): ECA and ACC (top) and ASR (bottom, lower is better). ACC, ASR and ECA cover the attacked rows only. Average is the mean of the two benchmarks. Bars as in Figure 6. †Seen.
Mem0's lead on MAB-FC with Qwen3-4B does not carry over: its MAB-FC ECA is 4.0 on Qwen3.5-4B and 0.0 on Ministral-3-3B.
D Ablations and Analyses
D.1 Training-Data Ablations
Each ablation retrains the Qwen3-4B SFT manager of Figure 6 (the reference) with one change to its training data and evaluates it on the same test sets (Table 5). PoisonedRAG is seen (Section 4.1), but no text from it was used for training. A difference is real if its 95% paired cluster-bootstrap interval excludes 0 and it exceeds the SD over three seeds. Ablated runs keep the learning rate, two epochs and the 21,656 rows of the reference, except under Fewer rows and One conversation. To keep the row count, removed rows are replaced by repeating a random sample of the remaining rows, and when the share of one category changes, standard rows fill the rest (shares are standard : outdated : poisoning rows; reference 56.8 : 18.4 : 24.8). Each one-conversation run has 3,215 conversation rows, plus the same 2,166 false-passage rows in the runs with false passages; the conv-41 rows are a sample of the reference rows, while those of the other conversations come from a later run of the pipeline.
Each problem needs its own data. Without outdated rows, outdated ECA falls to 12.7 (untuned: 9.0); without poisoning rows, ASR rises to 93.6 (untuned: 92.2). Neither removal lowers the other problem's scores or standard ECA by a real amount; trained on both, the manager keeps the outdated gain and most of the poisoning gain. Halving or doubling either share keeps all three ECAs above the untuned manager by real amounts, so the gain does not depend on the exact shares.
Two parts of the data are needed for the gain. Without the implicit-change variants, outdated ECA falls from 28.5 to 7.0 (untuned: 9.0); without the false-passage episodes, ASR rises from 59.6 to 83.0. Removing the contrast pairs, the no-change controls or the labels in the targets does not lower overall ECA by a real amount (42.2, 38.6 and 44.6), so these parts are not needed for the gain.
A small amount of data is enough. With 10% to 50% of the rows, every score stays above the untuned manager by a real amount, and 5% of the rows already reach overall ECA 44.6. From 10% of the rows on, overall ECA is at least as high as with all data, also over three seeds. With 10% of the rows, the three seeds give overall ECA and ASR (all rows: and ), and only the outdated scores are lower (ECA 20.0 vs. 26.1, ACC 37.4 vs. 39.6).
Other source conversations also work. Without false passages, each of the five LoCoMo conversations that meet our base-conversation criteria raises outdated ECA, but only the base conversation, chosen before any evaluation, also lowers ASR by a real amount (66.0, against 85.1 to 89.4 for the other four). With the same false-passage rows added, each of the five raises all three ECAs and lowers ASR by real amounts with 5,381 rows (overall ECA 41.6 to 44.4 vs. 39.9; ASR 31.9 to 57.4).
The gain does not depend on one seed. Two other seeds give overall ECA 44.8 and 41.5 (reference: 39.9), and each seed beats the untuned manager on outdated and standard ACC and ECA and on poisoning ASR and ECA (Table 5).
The gain does not depend on the retriever or . Without retraining, showing the manager the top 4 or 16 of the 64 BM25 candidates instead of 8, or dropping the reranker, keeps overall ECA above the untuned manager (33.0 vs. 14.7, 42.8 vs. 21.0 and 32.6 vs. 17.0); rows whose evidence is no longer retrieved count as failures. Replacing only by Qwen3.5-9B (Qwen Team, 2026) or GLM-5.2 on the selected memory of each manager (judge unchanged) also keeps overall ECA above the untuned manager (39.8 vs. 16.8 and 38.8 vs. 17.0), with an interval that excludes 0 for every per-category ECA difference, so the gain does not depend on using the judge model as . In these runs the untuned manager is run with one decode seed.
| Training data | Overall | Outdated | Poisoning | Standard | ||||
|---|---|---|---|---|---|---|---|---|
| ACC | ECA | ACC | ECA | ASR↓ | ECA | ACC | ECA | |
| None (untuned) | 33.7 | 18.2 | 31.5 | 9.0 | 92.2 | 5.0 | 45.4 | 40.6 |
| All (reference, one seed) | 48.9 | 39.9 | 43.2 | 28.5 | 59.6 | 34.0 | 61.0 | 57.3 |
| 3 seeds, mean | 49.3 | 42.1 | 39.6 | 26.1 | 50.4 | 41.8 | 62.3 | 58.2 |
| 3 seeds, SD | 2.1 | 2.5 | 4.6 | 3.4 | 8.1 | 6.8 | 2.2 | 1.5 |
| Share of outdated or poisoning rows (standard : outdated : poisoning, %) | ||||||||
| outdated ×0 (75.2 : 0 : 24.8) | 47.0 | 38.6 | 26.8 | 12.7 | 38.3 | 48.9 | 58.9 | 54.3 |
| outdated ×0.5 (66.0 : 9.2 : 24.8) | 49.9 | 42.0 | 39.4 | 27.1 | 57.4 | 40.4 | 61.4 | 58.5 |
| outdated ×2 (38.5 : 36.7 : 24.8) | 49.1 | 40.0 | 33.5 | 18.3 | 55.3 | 42.6 | 62.8 | 59.1 |
| poisoning ×0 (81.6 : 18.4 : 0) | 38.9 | 29.9 | 40.7 | 28.5 | 93.6 | 6.4 | 59.1 | 55.0 |
| poisoning ×0.5 (69.2 : 18.4 : 12.4) | 51.5 | 42.7 | 35.2 | 20.3 | 40.4 | 48.9 | 63.9 | 59.0 |
| poisoning ×2 (32.0 : 18.4 : 49.6) | 48.3 | 38.2 | 38.5 | 24.3 | 59.6 | 29.8 | 63.9 | 60.4 |
| Without one part | ||||||||
| implicit-change variants | 46.8 | 38.6 | 25.0 | 7.0 | 48.9 | 48.9 | 64.4 | 59.9 |
| false-passage episodes | 49.3 | 32.4 | 42.0 | 28.6 | 83.0 | 14.9 | 56.9 | 53.7 |
| contrast pairs | 51.0 | 42.2 | 39.0 | 25.3 | 44.7 | 46.8 | 58.5 | 54.4 |
| no-change controls | 49.3 | 38.6 | 38.7 | 25.3 | 61.7 | 31.9 | 62.4 | 58.7 |
| labels in the targets | 53.2 | 44.6 | 44.6 | 32.3 | 53.2 | 42.6 | 64.0 | 58.8 |
| Fewer rows (share of the reference rows) | ||||||||
| 1% of the rows | 37.4 | 28.0 | 33.3 | 13.4 | 31.9 | 46.8 | 29.8 | 23.8 |
| 5% of the rows | 54.0 | 44.6 | 30.5 | 13.7 | 29.8 | 61.7 | 63.4 | 58.4 |
| 10% of the rows | 55.7 | 44.7 | 39.7 | 23.6 | 38.3 | 51.1 | 65.8 | 59.5 |
| 3 seeds, mean | 54.5 | 43.8 | 37.4 | 20.0 | 39.7 | 52.5 | 63.8 | 58.7 |
| 3 seeds, SD | 2.7 | 1.7 | 5.6 | 5.6 | 1.2 | 1.2 | 2.0 | 0.8 |
| 25% of the rows | 53.5 | 43.2 | 39.7 | 21.9 | 42.6 | 48.9 | 63.3 | 58.7 |
| 50% of the rows | 51.6 | 42.4 | 39.5 | 25.8 | 51.1 | 44.7 | 60.0 | 56.7 |
| One conversation, no false passages (3,215 rows) | ||||||||
| conv-41 (base) | 52.2 | 37.1 | 39.5 | 21.4 | 66.0 | 29.8 | 63.9 | 59.9 |
| conv-26 | 46.8 | 32.6 | 43.4 | 26.0 | 89.4 | 10.6 | 65.1 | 61.1 |
| conv-43 | 49.4 | 36.6 | 49.4 | 35.3 | 85.1 | 12.8 | 64.8 | 61.7 |
| conv-42 | 39.4 | 32.0 | 40.2 | 27.5 | 89.4 | 8.5 | 63.0 | 60.2 |
| conv-50 | 47.7 | 34.4 | 41.9 | 28.5 | 87.2 | 12.8 | 65.1 | 61.9 |
| One conversation with false passages (3,215 + 2,166 rows) | ||||||||
| conv-41 (base) | 49.2 | 41.9 | 36.5 | 21.9 | 46.8 | 44.7 | 62.1 | 59.1 |
| conv-26 | 53.1 | 44.4 | 35.5 | 19.8 | 31.9 | 55.3 | 62.1 | 58.1 |
| conv-43 | 51.5 | 41.6 | 37.0 | 24.5 | 57.4 | 40.4 | 64.2 | 59.8 |
| conv-42 | 57.5 | 44.1 | 40.0 | 24.8 | 48.9 | 46.8 | 64.3 | 60.6 |
| conv-50 | 51.3 | 43.2 | 38.4 | 24.8 | 53.2 | 44.7 | 64.4 | 60.0 |
Table 5: All training-data ablations of the Qwen3-4B SFT manager (%).
D.2 Beyond the Base Conversation
| Stratum | Subset | Rows | ACC [95% interval] |
|---|---|---|---|
| Attribute type | Seen in training | 304 | 61.8 [52.4, 69.3] |
| Held-out | 103 | 71.8 [58.3, 84.2] | |
| Input template | Held-out | 159 | 65.4 [54.0, 74.0] |
| Change origin | Inserted | 323 | 68.1 [63.0, 73.1] |
| In the conversation | 84 | 50.0 [29.8, 71.2] |
Table 6: Accuracy (%) of the Qwen3-4B SFT manager on the LoCoMo test rows about a change, by stratum.
The conversation rows of the training data come from one conversation, so the manager could overfit to its attributes or input templates. Table 6 splits the 407 LoCoMo test rows about a change by what the training data covers; brackets are 95% cluster-bootstrap intervals (2,000 resamples). The SFT manager is at least as accurate on the eight attribute types that never occur in training as on the 16 that do (71.8 vs. 61.8), and it reaches 65.4 on rows with held-out templates. However, changes already in the held-out conversations, rather than inserted ones, score lower (50.0 vs. 68.1, on 84 rows with a wide interval).
D.3 Owner Changes and Cost
Since a speaker's own report changes that speaker's facts, we test whether the same change made through another channel also changes memory. For each of 78 changes in the held-out LoCoMo conversations, a clean episode has the owner report the change in their own turn, and an attacked episode writes the same change in the first person as the owner but in a tool passage or a third-party message (e.g., "Note from Caroline: I moved to Lyon last week"). Change ACC is the share of clean episodes answered with the new value, and ASR, as in Section 4.1, the share of attacked episodes whose selected memory contains a poisoned record (the record of the impersonated change). On Qwen3-4B, SFT has change ACC 70.5 and ASR 75.6, against and for the untuned manager (mean SD over three decode seeds) and 50.0 and 82.1 for A-MemGuard (one run each); compared with the untuned manager, it writes far more of the owner's own changes but is also misled more often by impersonation.
On the same 9 LoCoMo test episodes for every manager (428 turns), the SFT manager takes 0.39 s per turn on one H100 (not counting ), against 1.32 s for Mem0 and 0.84 s for A-MemGuard, all with Qwen3-4B. Per turn, the SFT manager makes 1.33 LLM calls with 1,764 input and 119 output tokens, against 1.75 calls (2,177 / 253 tokens) for Mem0 and 2.98 calls (1,038 / 359 tokens) for A-MemGuard.