Paper commentary
TASK Memory: Beyond Text-Only Memory with Activation Steering and Knowledge Editing against Memory Hallucination
TASK memory combines text notes with in-model steering to stop memory hallucinations
- Problem Agents that retrieve a correct text note still answer from stale weights or apply the note to the wrong entities.
- Method TASK memory keeps notes as plain text and adds a removable knowledge edit as an address. Two steering vectors decide, query by query, whether the model adopts the note.
- Results On CounterFact, neighbour misuse fell from 39.2% to 7.5% when steering was added to text memory.

Figure 1 : Memory hallucination: the memory is correct, the answer is not. (a)Text-only memory or RAG puts the retrieved note into the prompt and leaves the rest to the frozen model, where the note in the context conflicts with the stale fact in the weights. On a question about the memory, the weights win and the model answers with the stale fact (Type I, memory-ignoring). On a question about another entity, the note wins and the model assigns the memory to the wrong entity (Type II, memory-misapplying). Across our five models these rates reach 46% and 24%, and Type II reaches 49% when retrieval is combined with weight editing.(b)TASK memory goes beyond text-only memory. Each memory object holdsText content, aKnowledge edit ∆Wm whose key ˆum serves as the in-model address, and a pair ofActivation-Steering vectors (v+, v−) that carry no content. For a query x, the address response rm(x) is compared with the threshold τm. A relevant query showsT, loadsEand adds v+, so the model adopts the memory; an unrelated query leavesTandEoff and addsv −, so the model keeps its own answer.
Original paper · CC BY 4.0 · Jinkun Zhao, Wenjun Wu · TASK Memory: Beyond Text-Only Memory with Activation Steering and Knowledge Editing against Memory Hallucination · Original paper figure · Converted the paper's own image file from its arXiv HTML version to PNG.Why a correct note still fails
Agents store what they learn as text notes and retrieve them into the prompt when a related question comes up. A note can be correct and still lose, because the frozen model already holds parametric knowledge about the same entities. The authors call the resulting errors use-time memory hallucinations, since the fault lies in how the model reads the memory rather than in what was stored.
The first failure, memory-ignoring hallucination, appears when the weights hold a stale fact. On queries whose stale fact sits in the weights, text memory is adopted 14.8 to 28.6 percentage points less often.
The second failure, memory-misapplying hallucination, runs the other way: the note's answer leaks onto neighbour entities that share the relation. On CounterFact this leak reaches 5.3 to 24.3% of neighbour cases, compared to less than 1% without memory. Adding a weight edit to the note pushes this rate to as much as 49%. The third failure, version confusion, shows up when both versions of a revised fact stay in the store, and then 53% of answers assert the superseded value on Qwen3-8B with BM25 RAG.
Existing remedies each address at most one side of this conflict. Pushing the model uniformly toward the context trades memory-ignoring for memory-misapplying, and an ungated evidence direction lowered the composite to 0.780, compared to 0.811 for text memory alone.
The key idea: decide per memory, per query
The core move is to keep the content in plain text and let two in-model carriers control when that text is used. A removable knowledge edit supplies an address, and a pair of steering vectors chooses between adopting the note and keeping the model's own answer. Because one signal decides the gate, the retriever, the editor and the steering rule can't drift apart on the same query.
The steering vectors deliberately store nothing. Without the text note they answer 1.7% of CounterFact queries, the same as the unmodified model, so they change how the note is used rather than what the model knows. Prior work reports that facts stored as steering alone reach at most 15% clean use, which is why the design keeps content in text.
Knowledge editing and MemT-1.0 instead write new content into weights or into a trained state. Moving storage into the weights changes where the content lives, but it leaves the arbitration between memory and parametric knowledge unresolved. TASK writes into the model only a removable controller that applies to a single memory.
How a memory is written and read
A visible observation, with a subject, a relation prompt and a new object, is compiled into one memory object. The object holds a text record, an address key at one MLP layer, a closed-form patch keyed on that address, and two steering vectors trained on the frozen model. Each object is bound to the model hash, its scope and its version.
The address is the average MLP down-projection input at the last subject token, taken over several writer contexts. For Qwen3-8B the edit layer is layer 6. The response is \\(r_m(x)=\\max_t \\hat u_m^\\top k_t(x)\\), and the gate is \\(g_m(x)=\\mathbb{1}[r_m(x)\\ge\\tau_m]\\). The threshold \\(\\tau_m\\) sits midway between the lowest response on the memory's own contexts and the highest response on hard negatives that share the relation.
The edit follows ROME: a rank-one, closed-form update satisfies \\(\\Delta W_m k_m=\\delta_m\\), so the subject key maps to the new object. The patch is stored as low-rank factors, applied through a hook as \\(W+BA\\), and can be unloaded bit-exactly. Training uses an adopt term, a cross-entropy on contexts with the note present, and a restrain term, a KL divergence on hard negatives where the gate is off.
Both vectors start at zero and train for 40 Adam steps, while the model weights stay frozen.
The shared gate then decides whether a note is shown, whether its patch is loaded and which steering vector is added, so the three interventions stay consistent. Multi-hop questions use only the adopt vector, because the bridge entity isn't in the question.
A new observation is matched against the top two active records. The agent's own frozen model labels it UPDATE or DIFFERENT. On UPDATE the old text, edit and steering vectors leave the active set together, and no fact IDs are involved.
Does steering fix both failures on CounterFact?
The first test gives one memory per world on CounterFact with Qwen3-8B, and the note sits in context for related and unrelated queries. Adding steering to text memory lifted paraphrase adoption from 88.2% to 96.7% and cut neighbour misuse from 39.2% to 7.5%.
An ungated global evidence vector pushed misuse up to 43.5%, and its composite fell below that of text memory alone. Random vectors of matched norm and vectors at the wrong layer left behaviour almost unchanged. The authors read this pattern as evidence that the gain comes from a per-memory decision rather than a general push toward context.
Reversion, the Type I rate, fell from 4.9 to 46.3% under text memory to 0 to 1.5% under TASK, significantly in all ten model-dataset cells. On Llama-3.1-8B CounterFact it dropped from 46.3% to 0%, a change of -46.3 percentage points. Misuse on known neighbours dropped from between 5.3 and 24.3% to between 1.2 and 7.4%, and the drop is significant on four of five models.
The shared direction alone scored 0.909, close to the full 0.919, with a difference of 0.99 percentage points and a CI of -1.07 to 3.00. Most of the effect is therefore a reusable adopt-or-restrain direction, and the per-memory gate supplies the specificity.
Reading from a growing library
With 300 memories BM25 retrieval brought in distractor notes for many unrelated queries, and locality fell to 64.9%. Verifying candidates with the in-model address raised locality to 96.9%. Adding steering on top lifted the composite by 16.4 percentage points on CounterFact over BM25 RAG, and by 16.2 percentage points on zsRE.
A single joint patch over all memories, kept always on, dropped locality to 51.3%. Per-memory patches gated by the address kept locality at about 95%. On single facts the edit's value comes from its address rather than from its weight change.
Address-verified text with steering stayed at 0.926, with locality above 91%.
Automatic supersession, which uses the address and the agent's own judge and no fact IDs, lowered the stale-version rate of address-verified text with steering from 54.7% to 10.0% on Qwen3-8B. The authors also found that the old steering vectors must be retired too, because otherwise the adopt vectors of both versions fire.
Composing updated facts
Multi-hop questions chain an updated fact through what the model already knows, so the weight carrier matters here. Text memory scored 69.0% on MQuAKE-CF-3k, and adding the edit raised it to 76.8%. TASK with the adopt vector scored 76.5%, a gain of 7.5 percentage points with a CI of 3.3 to 11.8.
The authors trace this gain to the edit rather than to the steering. Reversion to the old answer halved, from 6.5% to 3.0%. Paired steering, which also applies the restrain vector, lowered accuracy to 62.2%, because the restrain vector suppresses notes that are needed.
Under the same requests, the subject-keyed closed-form edit scored 0.866 on its own, compared to 0.756 for ROME in EasyEdit. The authors say steering also improves each of the three EasyEdit editors when stacked on top. With steering added, the authors' edit scored 0.891 on zsRE.
Generality across models and baselines
The same frozen protocol ran on five models, and 21 of 23 cross-model comparisons were significantly positive. The gain was largest where the model resisted its context most: Llama-3.1-8B rose from a CounterFact composite of 0.518 to 0.948. Qwen3-14B already followed context well, at 0.923, and gained 2.2 percentage points.
Against context-use baselines, TASK significantly beat KSD, ContextFocus and CAST in 9 of 10 model-dataset cells. The one exception was Gemma-3-27B on zsRE, where TASK raised paraphrase accuracy but also increased locality damage. IKE ties with TASK or wins on zsRE for models of 14B and above, while on CounterFact TASK leads by 2.7 to 39.4 percentage points.
Limitations
The gains shrink where a model already follows its context: Qwen3-14B gains 2.2 percentage points on CounterFact. On Gemma-3-27B zsRE, TASK is not better than text memory, at -4.61 percentage points with a CI of -10.25 to 0.01.
Revision depends on supersession, and the automatic judge misses 14% of true updates on Qwen3-8B.
On AppWorld the local 8B agent rarely completes tasks, and steering improves only the partial test-pass rate, by 2.2 percentage points, which isn't significant.
Paper info
- Authors
- Jinkun Zhao, Wenjun Wu
- Venue
- arXiv · Preprint
- First published
- 2026-11-25
- Added
- 2026-11-27
- Updated
- 2026-11-25
- Version
- v1
- arXiv
- 2611.34762
- Category
- cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
LLM agents increasingly rely on external memory, yet they still hallucinate about what they remember. Often the correct memory is retrieved and placed in the prompt, but the answer contradicts it or the memory is applied to the wrong question. We call these use-time memory hallucinations. Across five open models, we find that they arise from the conflict between parametric knowledge and external memory and take three forms: memory-ignoring, where the model returns to a stale fact in its weights (up to 46% of queries); memory-misapplying, where it attributes the memory to unrelated entities (up to 24%, and 49% when retrieval is combined with weight editing); and version confusion, where 53% of answers about revised facts assert the superseded value when both versions remain stored. We propose TASK memory, which goes beyond text-only memory by combining a Text note with Activation Steering and Knowledge editing that share one in-model address. The text holds the content. A removable knowledge edit supplies the address through its subject key and supports multi-hop composition. A pair of steering vectors decides, query by query, whether the model adopts the memory or keeps its own answer; the vectors store no content and control how the text memory is used. On frozen models under a pre-registered, test-once protocol, TASK reduces memory-ignoring hallucinations to at most 1.5% in all ten model-dataset cells and cuts neighbour misuse from 39.2% to 7.5% (+10.8 pp composite on CounterFact). It improves a 300-memory library over BM25 RAG by 16.4 pp, an advantage that holds at 3,000 memories, resolves fact revisions without fact IDs, and adds 7.5 pp of multi-hop accuracy on MQuAKE. 21 of 23 cross-model comparisons (8B-27B, four families) are significant, and TASK beats three recent context-steering methods in 9 of 10 model-dataset cells.
Quote from the paper
Jinkun Zhao, Wenjun Wu (2026). TASK Memory: Beyond Text-Only Memory with Activation Steering and Knowledge Editing against Memory Hallucination. arXiv:2611.34762v1. https://arxiv.org/abs/2611.34762v1
BibTeX
@misc{zhao2026task,
title = {{TASK Memory: Beyond Text-Only Memory with Activation Steering and Knowledge Editing against Memory Hallucination}},
author = {Jinkun Zhao and Wenjun Wu},
year = {2026},
eprint = {2611.34762},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.34762v1}
}