NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TASK Memory: Beyond Text-Only Memory with Activation Steering and Knowledge Editing against Memory Hallucination

Jinkun Zhao, Wenjun WuarXiv 2026

TL;DR

Giving an LLM a sticky note with the right fact doesn’t guarantee it will give you the right answer. Even when retrieval works flawlessly, models constantly suffer from a tug-of-war between their frozen internal weights and external prompt notes—either stubbornly ignoring the note or wildly applying it to the wrong topics. TASK Memory fixes this by upgrading memories from passive text strings into active, three-part objects that dynamically arbitrate when and how the model listens to its context, without retraining the base model.

What Problem Does This Paper Address?

When LLM agents hallucinate, we usually blame the retriever or faulty memory extraction. This paper investigates what happens when storage and retrieval succeed—the exact right note sits in the prompt—yet the model still gets the answer wrong. The authors call these use-time memory hallucinations, driven by a clash between pre-trained parametric knowledge and external context.

They identify three distinct failure modes:

  1. Memory-ignoring (Type I): Stubborn weights win. You tell the model X changed jobs, ask where X works, and the model blurts out X’s old job (up to 46% of queries).
  2. Memory-misapplying (Type II): Over-eager context wins. The note about X’s new job is in the prompt, you ask where Y works, and the model assigns X’s job to Y (up to 24%, jumping to 49% if you naively combine RAG with weight editing).
  3. Version confusion (Type III): When facts are updated and old notes remain stored, the model outputs the outdated version 53% of the time.

Comparison of standard RAG memory hallucinations versus TASK memory's gated architecture. (Note: Let's look at the full diagram below)

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 holds Text content, a Knowledge edit ∆Wm whose key ˆum serves as the in-model address, and a pair of Activation-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 shows T, loads E and adds v+, so the model adopts the memory; an unrelated query leaves T and E off and adds v−, so the model keeps its own answer.

Because Type I and Type II pull in opposite directions, global fixes fail: pushing a model to "trust the prompt more" cures Type I while worsening Type II.

Methods

Instead of storing mere text, TASK bundles every memory into a three-part object (Text + Activation Steering + Knowledge editing) governed by a single in-model address:

  • T (Text): A standard, inspectable text note. Crucially, this is the only place actual factual content lives.
  • E (Knowledge Edit & Address): Using ROME-style closed-form updates (which treat MLP layers as key-value stores), TASK computes a removable, low-rank weight patch keyed to the subject's internal representation. This subject key doubles as the memory's address. (For free-form dialogue where clear subjects lack, it uses a mean-pooled semantic state of self-generated questions).
  • S (Activation Steering): A pair of lightweight vectors injected into the residual stream at decision tokens. One vector ($v^+$) nudges the model to adopt the note; the other ($v^-$) tells it to restrain itself and stick to its own weights.

At read time, BM25 fetches candidate memories, and a single partial forward pass checks their addresses against the query. One shared gate decides everything simultaneously: if the address fires, the text T is shown, patch E is loaded, and $v^+$ is added. If it doesn't fire, T and E stay off and $v^-$ is applied. When a fact is revised, the model judges whether a new observation updates an active record; if so, the old T, E, and S are retired together—no manual fact IDs needed.

Datasets

No new datasets are introduced, though the authors construct specific provided-evidence, scaling-library (up to 3,000 memories), and continual-revision evaluation protocols using existing benchmarks:

  • Structured counterfactuals & QA: CounterFact and zsRE (single facts, scaling libraries, and revisions).
  • Multi-hop reasoning: MQuAKE-CF-3k (chaining updated facts with internal knowledge).
  • Free-form dialogue & agent tasks: LoCoMo, LongMemEval, and AppWorld.
  • Calibration: Wikitext (~$7 \times 10^5$ tokens used once to estimate layer covariance for addressing).

Key Insights and Ideas

  • Steering is a controller, not a hard drive: Without the text note, the steering vectors answer just 1.7% of queries—identical to the unmodified model. Steering carries zero factual content; it purely arbitrates trust.
  • Specificity lives in the gate, not the vector: Decomposing the steering vectors reveals that an average "shared" adopt/restrain direction across 300 memories works nearly as well as bespoke per-memory vectors (0.909 vs. 0.919 composite)—provided each memory keeps its own address gate. Global steering fails because it lacks per-memory gating.
  • Clean division of labor: For single facts, the weight patch E's actual weight change adds nothing over T + S; its sole value there is providing the address key! However, E becomes essential on multi-hop questions, where the model must chain an updated fact internally without the bridge entity appearing in the prompt.
Conflict analysis across five open models showing Type I parametric override and Type II neighbour misuse.

Key Results

Tested under a pre-registered, test-once protocol across five frozen models (Qwen3-8B/14B, Llama-3.1-8B, Phi-4, Gemma-3-27B):

  • Crushing Dual Hallucinations: TASK drops Type I memory-ignoring rates from 4.9–46.3% down to $\le$1.5% across all ten model-dataset pairs. On Qwen3-8B (CounterFact), neighbour misuse drops from 39.2% to 7.5% (+10.8 percentage points in composite score).
  • Scaling Libraries: With 300 memories, TASK beats BM25 RAG by +16.4 pp on CounterFact and +16.2 pp on zsRE by filtering out distractor notes. This lead holds at 3,000 memories (0.926 vs. 0.731).
  • Revisions & Multi-hop: Automatic supersession boosts accuracy on revised facts by 48.7–54.7 pp without fact IDs. On MQuAKE, adding E boosts multi-hop accuracy by +7.5 pp over text alone.
  • Cross-Model Generality: 21 of 23 cross-model comparisons are statistically significant, beating recent context-steering baselines (KSD, ContextFocus, CAST) in 9 of 10 cells.

Limitations and Future Work

  • Write-time compute: Compiling a memory takes ~25 seconds for steering training and ~4 seconds for editing on one GPU. Future work could slash this cost by using a single shared steering direction behind cheap per-memory gates.
  • Diminishing returns on compliant models & free-form chat: Models that already follow context well (like Qwen3-14B) see modest gains (+2.2 pp), and TASK slightly trails text-only on Gemma-3-27B zsRE. On free-form dialogue (LoCoMo), gains are small and trail behind full-context prompting.
  • Imperfect revision judges: The LLM-based update judge misses 14% of true updates on Qwen3-8B and over-supersedes 34% of sibling facts in dense libraries on Llama-3.1-8B.
  • Garbage in, gospel out: Making an agent reliably adopt its notes also makes it reliably adopt false or malicious notes, requiring verified upstream memory writers.

Summary updated

BibTeX
@misc{zhao2026task,
  author = {Jinkun Zhao and Wenjun Wu},
  title = {{TASK Memory: Beyond Text-Only Memory with Activation Steering and Knowledge Editing against Memory Hallucination}},
  year = {2026},
  eprint = {2611.34762},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.34762},
}
Figure