TASK Memory: Beyond Text-Only Memory with Activation Steering and Knowledge Editing against Memory Hallucination
Organizations: SKLCCSE, Institute of Artificial Intelligence Beihang University, Beijing, China · Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing Beihang University, Beijing, China
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.
Figures & tables
| Paradigm | Memory content | Written into the model | Base-model training | Arbitration with parametric knowledge | Per-memory removal |
|---|---|---|---|---|---|
| Text memory / RAG [ 22 , 8 , 54 ] | text | nothing | none | left to the model | delete record |
| Knowledge editing [ 32 , 33 , 11 ] | weights | fact (weight delta) | none | edit replaces parametric fact | partly (side memories) |
| Context-faithfulness steering [ 2 , 29 , 42 ] | text | one global direction / decoding rule | none | always favour context | – |
| Parametric RAG [ 43 ] | text + generated LoRA | document content | hypernetwork | left to the model | drop adapter |
| MemT-1.0 [ 31 ] | trained native memory state | history content | 34B-token memory training | imitate full-context backbone | no (fixed-size state) |
| TASK (ours) | text (+ local patch) | address + adopt/restrain policy | none (frozen) | per query, address-gated / | yes (versioned, unloadable) |
| Benchmark | TASK configuration | Baseline | TASK | Baseline | [95% CI] | |
| RQ1 | CounterFact (300 worlds) | T + S | T | 0.919 | 0.811 | +10.80 [7.80, 14.16] ∗ |
| zsRE (300 worlds) | T + S | T | 0.892 | 0.835 | +5.65 [1.20, 10.20] ∗ | |
| LoCoMo (1,230 q.) | retrieved T + S | retrieved T | 0.342 | 0.328 | +1.38 [0.21, 2.75] ∗ | |
| RQ2 | CounterFact library (300) | address-verified T + gated E + S | BM25 RAG | 0.946 | 0.782 | +16.36 [12.99, 20.31] ∗ |
| zsRE library (300) | address-verified T + gated E + S | BM25 RAG | 0.965 | 0.803 | +16.23 [11.29, 22.11] ∗ | |
| LoCoMo | semantic-address T + S | BM25 RAG | 0.342 | 0.308 | +3.41 [0.07, 7.05] ∗ |
| CounterFact (300) | zsRE (300) | |||||||||
| Method | Para. | Canon. | Loc. | Misuse | Comp. | Para. | Canon. | Loc. | Misuse | Comp. |
| No memory | 1.8 | 0.7 | 100.0 | 1.7 | 0.015 | 1.7 | 1.3 | 100.0 | 0.0 | 0.022 |
| T (text memory) | 88.2 | 91.7 | 67.8 | 39.2 | 0.811 | 91.7 | 92.7 | 70.4 | 5.7 | 0.835 |
| T + global evidence vector (ungated) | 88.2 | 93.3 | 60.9 | 43.5 | 0.780 | 93.0 | 95.0 | 66.7 | 8.3 | 0.827 |
| T + random vector (norm-matched) | 88.3 | 91.0 | 69.1 | 38.8 | 0.816 | 92.7 | 92.3 | 70.4 | 5.0 | 0.837 |
| T + vector at wrong layer | 88.3 | 91.7 | 68.7 | 39.2 | 0.816 | 91.7 | 92.7 | 68.5 | 5.7 | 0.827 |
| Model | CF: T | CF: T+S | CF | CF lib. | zsRE | zsRE lib. | MQuAKE |
|---|---|---|---|---|---|---|---|
| Qwen3-8B | 0.811 | 0.919 | +10.80 ∗ | +16.36 ∗ | +5.65 ∗ | +16.23 ∗ | +7.50 ∗ |
| Llama-3.1-8B | 0.518 | 0.948 | +43.02 ∗ | +49.37 ∗ | +28.04 ∗ | +41.40 ∗ | +33.83 ∗ |
| Qwen3-14B | 0.923 | 0.945 | +2.19 ∗ | +6.05 ∗ | +7.90 ∗ | +11.60 ∗ | +1.17 |
| Phi-4 (14B) | 0.756 | 0.956 | +19.97 ∗ | +12.99 ∗ | +8.20 ∗ | +20.12 ∗ | +36.00 ∗ |
| Gemma-3-27B | 0.849 | 0.888 | +3.92 ∗ | +17.65 ∗ | 4.61 | n/a | n/a |
| Model dataset | IKE | CAD | CAA | KSD | ContextFocus | CAST |
| Method | Qwen3-8B judge | Qwen3-14B judge | GLM-5.3 judge | Input tokens |
| BM25 top-5 facts (T) | 30.8 | 28.5 | 33.6 | 299 |
| Semantic-address T | 32.8 | 30.3 | 34.6 | 298 |
| Semantic-address T + S ( TASK ) | 34.2 | 31.0 | 39.3 | 298 |
| Mem0, top-5 | 17.9 | 16.1 | 19.5 | 257 |
| Mem0, top-30 | 26.1 | 24.2 | 30.4 | 1,226 |
| A-Mem, token-matched to ours | 28.6 | 27.1 | 30.7 | 294 |
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Parametric override (paraphrase queries) | Memory override (base-correct neighbours) | |||||||||
| Data | Model | T gap (pp) | Rev. T | Rev. T+S | Mis. base | Mis. T | Mis. T+E | Mis. T+S | T+S T (pp) | |
| CF | Qwen3-8B | 205/600 | -1.7 [-7.3, 4.4] | 9.3 | 0.5 | 0.9 | 24.3 | 40.4 | 4.8 | -19.6 [-25.8, -13.9] ∗ |
| CF | Llama-3.1-8B | 231/600 | +16.4 [8.1, 25.0] ∗ | 46.3 | 0.0 | 0.0 | 20.2 | 49.0 | 1.2 | -18.9 [-24.9, -13.5] ∗ |
| CF | Qwen3-14B | 223/600 | +0.9 [-2.4, 4.6] | 4.9 | 0.0 | 0.4 | 5.3 | 11.8 | 4.9 | -0.4 [-3.5, 2.8] |
| CF | Phi-4 | 257/600 | +14.8 [7.2, 22.4] ∗ | 29.6 | 0.4 | 0.7 | 9.3 | 19.0 | 1.9 | -7.5 [-11.3, -4.2] ∗ |
| CF | Gemma-3-27B | 236/600 | +0.7 [-4.8, 6.6] | 11.0 | 1.3 | 0.8 | 14.3 | 10.7 | 7.4 | -7.0 [-11.4, -2.6] ∗ |
| Data | Model | Rev. T+S T |
|---|---|---|
| CF | Qwen3-8B | -8.8 [-13.8, -4.3] ∗ |
| CF | Llama-3.1-8B | -46.3 [-53.5, -39.1] ∗ |
| CF | Qwen3-14B | -4.9 [-8.2, -2.2] ∗ |
| CF | Phi-4 | -29.2 [-35.7, -23.0] ∗ |
| CF | Gemma-3-27B | -9.7 [-14.9, -5.1] ∗ |
| zsRE | Qwen3-8B | -18.5 [-29.2, -8.5] ∗ |
| Carrier / setting | Memories | Seconds / memory | Forward passes / memory |
|---|---|---|---|
| E (closed-form patch), CounterFact | 300 | 4.0 | 18.8 |
| S (paired vectors), CounterFact | 300 | 25.0 | 86 |
| S , CounterFact | 300 | 25.0 | 86 |
| S (semantic address), LoCoMo | 1,749 | 25.0 | 86 |
| Model method | No sup. | No sup.: stale | Oracle | Auto | Auto: stale | Auto: unrevised |
|---|---|---|---|---|---|---|
| Qwen3-8B address-verified T | 0.333 | 0.533 | 0.860 | 0.793 | 0.087 | 0.893 |
| Qwen3-8B address-verified T + S | 0.340 | 0.547 | 0.933 | 0.827 | 0.100 | 0.940 |
| Qwen3-8B address-verified T + gated E + S | 0.420 | 0.473 | 0.940 | 0.893 | 0.053 | 0.953 |
| Llama-3.1-8B address-verified T | 0.700 | 0.133 | 0.593 | 0.593 | 0.000 | 0.453 |
| Llama-3.1-8B address-verified T + S | 0.413 | 0.480 | 0.960 | 0.960 | 0.000 | 0.967 |
| Llama-3.1-8B address-verified T + gated E + S | 0.380 | 0.500 | 0.953 | 0.953 | 0.000 | 0.967 |
| Comparison | Qwen3-8B | Llama-3.1-8B |
|---|---|---|
| Addr. T+S addr. T | +7.02 [4.84, 9.38] ∗ | +27.55 [23.81, 31.41] ∗ |
| Addr. T+gated E addr. T | +7.22 [4.90, 9.71] ∗ | +19.61 [15.48, 23.74] ∗ |
| Addr. T BM25 T (text only) | 1.86 [-3.44, -0.31] ∗ | 4.95 [-7.34, -2.48] ∗ |
| Addr. T+gated E+S addr. T+S | +0.10 [-1.12, 1.24] | 1.44 [-2.97, 0.10] |
| S S | +0.93 [-0.10, 1.93] | 0.93 [-2.63, 0.83] |
| Ungated joint E (accuracy) | 0.015 | 0.013 |
| Variant | Para. | Canon. | Loc. | Comp. (full S variant, pp) |
|---|---|---|---|---|
| T | 88.2 | 91.7 | 67.8 | 0.811 (+10.80 ∗ ) |
| T + full S | 96.7 | 99.3 | 81.7 | 0.919 |
| T + shared direction only | 93.3 | 97.0 | 83.5 | 0.909 (+0.99 [-1.07, 3.00] ) |
| T + memory-specific residual only | 95.0 | 99.0 | 71.3 | 0.866 (+5.32 ∗ ) |
| Setting | Split | Metric | (pp) [95% CI] |
|---|---|---|---|
| CounterFact, Qwen3-8B | test | composite | +1.55 [-1.41, 4.22] |
| CounterFact, Qwen3-8B, writer seeds 17 / 29 / 41 | dev | composite | +0.84 / 1.05 / +2.76 ∗ |
| CounterFact, Mistral-7B | dev | composite | +1.16 [-3.56, 6.20] |
| CounterFact library, address-verified + gated E | test | composite | +0.01 [-0.51, 0.52] |
| CounterFact library, BM25 + E | test | composite | 5.18 [-8.26, -2.33] ∗ |
| MQuAKE, paired vectors | test | multi-hop acc. | 2.67 [-4.50, -0.67] ∗ |
| Method | Qwen3-8B seed 17 | seed 29 | seed 41 | Mistral-7B |
|---|---|---|---|---|
| T | 0.825 | 0.825 | 0.825 | 0.639 |
| T + ungated global vector | 0.762 | 0.762 | 0.762 | 0.719 |
| T + S | 0.897 | 0.881 | 0.898 | 0.933 |
| T + E | 0.701 | 0.730 | 0.717 | 0.765 |
| T + E + S | 0.830 | 0.811 | 0.849 | 0.856 |
| E only | 0.890 | 0.891 | 0.898 | 0.898 |
Memory-Augmented Language Model Agents
Memory-augmented language model agents use persistent facts, interaction histories, and skills to support personalization and long-horizon tasks.
See all 490 papers