Evaluating Compressed Memory: Dependence, Utility, and Content Benefit
Organizations: Department of Artificial Intelligence, Jeju National University · School of Software, Soongsil University
Abstract
Does a language model answer better because its compressed memory contains useful document information? Replacing memory vectors with zeros can lower a trained model's score without showing that it outperforms a model trained without memory. We combine zeroing with separately trained models that cannot access stored text or receive the same constant input for every document. Across nine systems, some models rely on memory yet perform worse than the trained alternative. For example, in experiments that predict states in generated stories, zeroing memory worsens a model's prediction loss, yet a model trained without memory achieves lower loss than the original model with intact memory. On TriviaQA, giving xRAG memory from another question's passage raises F1, which measures word overlap with accepted answers, from 19.38 without a document to 24.78. Its effect on how often outputs contain an accepted answer is statistically uncertain. The question's retrieved passage scores higher still (29.88 F1). Thus a gain over no document alone does not establish that the gain requires the question's passage. Evaluations must therefore specify the comparison model, absolute performance, and generation and scoring conditions.
Figures & tables
| System | Task adaptation / reference | Synthetic | Synthetic | PG-19 | PG-19 |
|---|---|---|---|---|---|
| StreamingLLM ( Xiao et al., 2024 ) | KV / restricted decoder | ||||
| H 2 O ( Zhang et al., 2023 ) | KV / restricted decoder | ||||
| xRAG ( Cheng et al., 2024 ) | projector / suffix decoder | ||||
| LoCoCo ( Cai et al., 2024 ) | convolution / suffix adapter | ||||
| CCM ( Kim et al., 2024 ) | merge adapter / suffix adapter | ||||
| ICAE ( Ge et al., 2024 ) | decoder / suffix decoder |
| Training objective | ||
|---|---|---|
| Model | All-token | Target-only |
| No-memory adapter | 2.3189 | 3.2729 |
| Pooled memory | 2.3190 | 2.4921 |
| Constant input | 2.3106 | 2.4566 |
| Projector training input | Intact F1 | Zeroed F1 |
|---|---|---|
| Document | 19.98 | 6.82 |
| Same constant for all documents | 12.54 | 6.82 |
| Input | Match (%) | EM (%) | F1 |
|---|---|---|---|
| Closed book | 57.01 | 1.31 | 19.38 |
| Full text | 65.87 | 1.64 | 21.86 |
| Document | 65.73 | 6.33 | 29.88 |
| Question | 60.53 | 1.66 | 22.43 |
| Zero vector | 57.61 | 1.28 | 19.49 |
| Donor mean | 56.45 | 5.11 | 24.78 |
| Donor minus closed book | Document minus donor | |||
|---|---|---|---|---|
| Dataset | Match | EM | F1 | Match |
| TriviaQA | ||||
| NQ-open | ||||
| WebQuestions | ||||
Appendix figures & tables38 assets
Supplementary material from the paper’s appendix.
Appendix
| Backbone | MLP width | Module (M) | |||
|---|---|---|---|---|---|
| Pythia-2.8B | 32 | 10 | 2,560 | 4,098 | 20.98 |
| Pythia-6.9B | 32 | 10 | 4,096 | 6,402 | 52.45 |
| Pythia-12B | 36 | 8 | 5,120 | 7,938 | 81.30 |
| Llama-3.2-1B | 16 | 20 | 2,048 | 3,330 | 13.64 |
| Llama-3.2-3B | 28 | 11 | 3,072 | 4,866 | 29.90 |
| Llama-3.1-8B | 32 | 10 | 4,096 | 6,402 | 52.45 |
| Backbone | Adapter NLL | Pooled NLL | Zeroed NLL | Gain [95% CI] | Zeroing [95% CI] |
|---|---|---|---|---|---|
| Pythia-2.8B | 2.4284 | 2.5067 | 3.0140 | ||
| Pythia-6.9B | 2.3499 | 2.4293 | 2.7966 | ||
| Pythia-12B | 2.3736 | 2.4459 | 2.7628 | ||
| Llama-3.2-1B | 2.3019 | 2.3801 | 2.8610 | ||
| Llama-3.2-3B | 2.1926 | 2.3343 | 2.7986 | ||
| Llama-3.1-8B | 2.0586 | 2.0910 | 2.1906 |
| Backbone | LoRA only | Local adapter | Pooled | Indexed |
|---|---|---|---|---|
| Pythia-2.8B | 2.6062 / 11.26 | 2.4284 / 10.86 | 2.5067 / 11.32 | 2.5168 / 11.29 |
| Pythia-6.9B | 2.4753 / 11.28 | 2.3499 / 11.00 | 2.4293 / 10.99 | 2.4261 / 11.99 |
| Pythia-12B | 2.5359 / 11.62 | 2.3736 / 11.44 | 2.4459 / 11.00 | 2.4516 / 11.11 |
| Llama-3.2-1B | 2.6037 / 13.54 | 2.3019 / 13.89 | 2.3801 / 13.77 | 2.4015 / 13.79 |
| Llama-3.2-3B | 2.6051 / 13.90 | 2.1926 / 14.48 | 2.3343 / 14.07 | 2.3449 / 14.11 |
| Llama-3.1-8B | 2.1252 / 13.71 | 2.0586 / 13.62 | 2.0910 / 13.63 | 2.0977 / 13.68 |
| Training loss | Model | Target NLL | Accuracy (%) |
|---|---|---|---|
| All-token | Local adapter | 2.1775 | 12.92 |
| All-token | Normal pooled memory | 2.2068 | 13.64 |
| All-token | Document-independent memory | 2.2055 | 13.48 |
| Target-only | Local adapter | 2.2422 | 16.83 |
| Target-only | Normal pooled memory | 2.1907 | 16.47 |
| Target-only | Document-independent memory | 2.1869 | 16.70 |
| QA effect (estimate) | Fixed-fit percentile 95% | Crossed simultaneous 95% |
|---|---|---|
| (F1) (+7.4436) | ||
| (F1) (+7.4336) | ||
| (F1) (+13.1594) | ||
| (F1) (+12.8842) | ||
| Constant zeroing (F1) (+5.7258) | ||
| Constant minus question (F1) (+0.0100) |
| F1 contrast | Estimate | Fixed-fit paper 95% | Crossed simultaneous 95% |
|---|---|---|---|
| : intact recovery | |||
| : trained-reference gain | |||
| : intact-minus-donor recovery | |||
| : training specificity | |||
| : swap damage | |||
| : mean damage |
| LLM and memory | F1 | EM (%) | NLL | Tokens |
|---|---|---|---|---|
| Public LLM, intact | 14.21 | 1.12 | 3.4513 | 48.90 |
| Public LLM, swap | 10.90 | 0.92 | 3.9922 | 48.47 |
| Public LLM, mean | 12.23 | 0.82 | 3.6518 | 40.51 |
| Document-trained LLM, intact | 21.29 | 4.58 | 2.0255 | 12.46 |
| Document-trained LLM, swap | 7.15 | 1.23 | 3.0156 | 11.10 |
| Document-trained LLM, mean | 10.30 | 1.97 | 2.7545 | 10.04 |
| Input | Match (%) | EM (%) | F1 | Tokens |
|---|---|---|---|---|
| Closed-book | 51.59 | 30.43 | 43.54 | 10.83 |
| Full text | 61.27 | 35.80 | 50.26 | 10.75 |
| Document input | 63.03 | 48.73 | 60.15 | 6.92 |
| Question input | 59.04 | 30.36 | 46.05 | 6.35 |
| Zero vector | 52.15 | 29.22 | 42.81 | 10.99 |
| Donor 1 | 53.98 | 41.68 | 51.84 | 7.42 |
| Effect | Estimate | Simultaneous 95% CI |
|---|---|---|
| Document closed | ||
| Question closed | ||
| Document question | ||
| Document mean donor | ||
| Mean donor closed | ||
| Full text closed |
| Comparison | Estimate | Fixed-fit 95% | Adjusted sensitivity 95% |
|---|---|---|---|
| Question minus closed prefix F1 | |||
| Document minus closed prefix F1 | |||
| Donor minus closed prefix F1 | |||
| Document minus donor prefix F1 |
| Panel | Input | NLL | Accuracy (%) |
|---|---|---|---|
| Original | Local input | 2.7986 | 49.26 |
| Original | Constant input | 2.8214 | 50.41 |
| Original | Remote input | 2.6116 | 47.56 |
| Original | Full-context reference | 1.5019 | 66.36 |
| Substituted | Local input | 13.3199 | 0.00 |
| Substituted | Constant input | 13.0405 | 0.00 |
| Study / effect (estimate) | Fixed-fit percentile 95% | Crossed simultaneous 95% |
|---|---|---|
| Ten-fit PG-19 lexical study | ||
| (NLL) (+0.3057) | ||
| (accuracy pp) (+2.1255) | ||
| Constant-reference utility (NLL) (+0.0109) | ||
| Constant zeroing (NLL) (+1.2360) | ||
| NASA article lexical study | ||
| Task / score | Ratio | |||
|---|---|---|---|---|
| QASPER (F1) | 13.16 | 7.43 | 5.73 | 43.5% |
| PG-19 (NLL) | 1.54 | 0.31 | 1.24 | 80.2% |
| NASA original (NLL) | 0.59 | 0.21 | 0.38 | 64.3% |
| System | Targets | Local NLL | Intact NLL | Gain [simultaneous CI] | Zeroing [simultaneous CI] |
| Synthetic: state-disambiguating token | |||||
| StreamingLLM | 1,652 | 1.849 | 2.459 | ||
| H 2 O | 1,652 | 1.849 | 2.068 | ||
| xRAG | 2,000 | 2.279 | 3.211 | ||
| LoCoCo | 2,000 | 2.232 | 3.646 | ||
| CCM | 2,000 | 2.231 | 0.078 | ||
| System | Absent NLL | Zeroed NLL | [simultaneous CI] | [simultaneous CI] |
| Synthetic: state-disambiguating token | ||||
| StreamingLLM | 10.906 | 8.943 | ||
| H 2 O | 10.906 | 9.757 | ||
| xRAG | 9.971 | 10.001 | ||
| PG-19: repeated-word first token | ||||
| StreamingLLM | 11.582 | 11.481 | ||
| Policy | Intact F1 | [crossed 95%] | [crossed 95%] | |
|---|---|---|---|---|
| TF–IDF top-1 | 13.213 | |||
| TF–IDF top-3 | 14.050 | |||
| SFR top-1 | 15.597 | |||
| SFR top-3 | 15.880 |
| Comparison set | Adjusted family | Inference scope |
|---|---|---|
| QA projectors | 12 F1/NLL effects | Ten paired order seeds and papers |
| Fixed-storage LLMs | 7 original F1; 2 direct F1/EM | Each family paired over seeds and papers |
| Released QA model | 8 Match/boost effects | One checkpoint; passage clusters |
| Lexical projectors | 4 PG-19; 18 NASA | Separate tasks; paired seeds/documents |
| Optimized/trained constants | 14 F1/NLL effects | Sample and interval choices use available results |
| Allocation / retrieval | 6 / 28 F1 effects | Rule quality versus deployed inputs |
| Learned compression ( ) | KV policy ( ) | |||||||
| Category | Present | Not located | Unclear | n/a | Present | Not located | Unclear | n/a |
| Full input/cache | 16 | 3 | 0 | 0 | 21 | 0 | 0 | 0 |
| Frozen source restriction | 4 | 12 | 1 | 2 | 3 | 18 | 0 | 0 |
| Trained reference (broad) | 16 | 3 | 0 | 0 | 3 | 0 | 0 | 18 |
| Trained independent input | 0 | 17 | 2 | 0 | 1 | 20 | 0 | 0 |
| Source/order intervention | 2 | 17 | 0 | 0 | 3 | 18 | 0 | 0 |
| Contrast (F1 points) | Estimate | Crossed 95% CI | Six-primary adjusted CI |
|---|---|---|---|
| Intact minus same-paper swap | 15.2365 | ||
| Correct minus wrong document | 7.4844 | ||
| Correct document minus closed book | 7.9442 |
| Decoder | Selected update: number of seeds |
|---|---|
| Correct document | 64:10 |
| Wrong document | 64:10 |
| Closed book | 64:8, 128:2 |
| Full text | 64:7, 128:3 |
| Input | Match | EM | F1 | Tokens |
|---|---|---|---|---|
| closed | 57.01 | 1.31 | 19.38 | 27.35 |
| full | 65.87 | 1.64 | 21.86 | 27.82 |
| document | 65.73 | 6.33 | 29.88 | 21.17 |
| question | 60.53 | 1.66 | 22.43 | 15.53 |
| zero | 57.61 | 1.28 | 19.49 | 27.45 |
| swap1 | 56.44 | 5.19 | 24.80 | 21.94 |
| Contrast | Metric | Estimate | Ordinary 95% | 15-effect adjusted |
|---|---|---|---|---|
| donor minus closed | MATCH | -0.5657 | ||
| donor minus closed | EM | +3.8039 | ||
| donor minus closed | F1 | +5.4011 | ||
| document minus donor | MATCH | +9.2814 | ||
| document minus donor | EM | +1.2169 | ||
| document minus donor | F1 | +5.0961 |
| Objective | Arm | NLL | Full accuracy (%) | Candidate accuracy (%) | Cap / 10 | Plateau / 10 |
|---|---|---|---|---|---|---|
| all-tokens | adapter | 2.3189 | 15.51 | 15.51 | 8 | 2 |
| all-tokens | pooled | 2.3190 | 14.24 | 14.24 | 9 | 1 |
| all-tokens | constant | 2.3106 | 14.93 | 14.93 | 7 | 3 |
| target | adapter | 3.2729 | 14.00 | 18.37 | 7 | 3 |
| target | pooled | 2.4921 | 19.66 | 19.66 | 6 | 4 |
| target | constant | 2.4566 | 19.82 | 19.82 | 6 | 4 |
| Panel | Contrast (nats) | Estimate | Crossed 95% | Adjusted interval |
|---|---|---|---|---|
| New holdout | Objective difference in U | +0.7809 | ||
| New holdout | All-token U | -0.0001 | ||
| New holdout | Target-only U | +0.7808 | ||
| New holdout | Target-only constant U | +0.8162 | ||
| New holdout | Target-only C | -0.0354 | ||
| Reused panel | Objective difference in U | +0.7469 |
| Fit and evaluation input | F1 |
|---|---|
| Projector: correct rationale | 60.56 |
| Projector: same-story non-rationale | 5.14 |
| Correct-document decoder | 66.56 |
| Wrong-document-trained decoder | 34.22 |
| Closed-book decoder | 18.86 |
| Contrast (F1) | Estimate | Fixed-fit 95% | Crossed 95% | Three-effect adjusted |
|---|---|---|---|---|
| Rationale minus non-rationale projector | 55.4226 | |||
| Correct minus wrong-document training | 32.3428 | |||
| Correct document minus closed book | 47.7046 |
| Planned contrast | Estimate | Ordinary crossed/clustered 95% | Six-contrast adjusted |
|---|---|---|---|
| Objective difference in utility (nats) | 0.7809 | ||
| QASPER intact minus same-paper swap (F1) | 15.2365 | ||
| QASPER correct minus wrong training (F1) | 7.4844 | ||
| QASPER correct minus closed book (F1) | 7.9442 | ||
| NQ-open/WebQuestions donor minus closed (EM) | 7.8904 | ||
| NQ-open/WebQuestions document minus donor (EM) | 4.4157 |
| System | Dataset | Method learning rate/decay | Local learning rate/decay |
|---|---|---|---|
| StreamingLLM | Syn. | 1e-3/0.1 | 1e-5/0 |
| H 2 O | Syn. | 1e-3/0.1 | 1e-5/0 |
| xRAG | Syn. | 5e-5/0 | 5e-5/0 |
| LoCoCo | Syn. | 0.05/0 | 1e-3/0.1 |
| CCM | Syn. | 5e-05/0 | 1e-3/0 |
| ICAE | Syn. | 5e-05/0 | 5e-5/0 |
| System | Memory trainables | Local trainables | Synthetic updates (M/L) | PG-19 updates (M/L) |
|---|---|---|---|---|
| StreamingLLM | 21,561,344 | 21,561,344 | 24 / (183+64+512) | 128 / 128 |
| H 2 O | 21,561,344 | 21,561,344 | 24 / (183+64+512) | 128 / 128 |
| xRAG | 33,562,624 | 33,559,552 | 128 / 128 | 128 / 128 |
| LoCoCo | 11,012,128 | 11,010,048 | 256 / 256 | 256 / 256 |
| CCM | 16,842,752 | 16,777,216 | 256 / 256 | 256 / 256 |
| ICAE | 218,636,288 | 218,636,288 | 128 / 128 | 64 / 64 |
| Learning rate | Document | Question | Constant |
|---|---|---|---|
| 2.1352 | 2.5067 | 2.4693 | |
| 2.1321 | 2.4550 | 2.4462 | |
| 2.3597 | 2.4405 | 2.4402 | |
| 2.4451 | 2.4540 | 2.4640 | |
| 2.5074 | 2.5078 | 2.5582 |
| Dataset | Input | Match | EM | F1 | Mean output tokens |
|---|---|---|---|---|---|
| NQ-open | Closed book | 30.2493 | 0.0000 | 7.9622 | 34.1532 |
| NQ-open | Document | 38.6981 | 0.6094 | 15.5835 | 28.1623 |
| NQ-open | Donor 1 | 30.4432 | 0.1939 | 11.8873 | 28.1850 |
| NQ-open | Donor 2 | 30.0554 | 0.0831 | 11.6641 | 28.9119 |
| NQ-open | Donor 3 | 29.6399 | 0.1385 | 11.4745 | 28.8266 |
| NQ-open | Donor mean | 30.0462 | 0.1385 | 11.6753 | 28.6412 |
| Dataset | Contrast | Score | Estimate | Ordinary 95% | Twelve-effect adjusted |
|---|---|---|---|---|---|
| NQ-open | Donor closed | MATCH | |||
| NQ-open | Donor closed | EM | |||
| NQ-open | Donor closed | F1 | |||
| NQ-open | Document donor | MATCH | |||
| NQ-open | Document donor | EM | |||
| NQ-open | Document donor | F1 |
| Dataset | Input | Reverse | Regroup |
|---|---|---|---|
| NQ-open | Closed | 0 | 228 |
| NQ-open | Document | 0 | 221 |
| NQ-open | Donor 1 | 0 | 216 |
| NQ-open | Donor 2 | 0 | 223 |
| NQ-open | Donor 3 | 0 | 224 |
| WebQuestions | Closed | 0 | 231 |
| Input / intervention | F1 | EM | Answer NLL |
|---|---|---|---|
| Document input | 19.98 | 4.29 | 2.0979 |
| Question input | 12.53 | 3.15 | 2.4336 |
| Constant input | 12.54 | 3.13 | 2.4161 |
| Shared zero-vector input | 6.82 | 0.00 | 10.6852 |
| Document, swapped | 7.09 | 1.44 | 3.0507 |
| Full-text reference | 29.57 | 0.20 | 7.4681 |
| Training input | F1 | NLL | F1 gain |
|---|---|---|---|
| Correct document | 21.21 | 1.9941 | — |
| Wrong document | 13.73 | 2.3289 | |
| Closed book | 13.27 | 2.4044 | |
| Full text | 62.54 | 0.6520 | (exploratory) |
| Compressed fit | Reference | Ref. F1 | Gain |
|---|---|---|---|
| Projector (19.98) | Frozen closed book | 6.60 | 13.37 |
| Projector (19.98) | Question projector | 12.53 | 7.44 |
| Decoder (21.21) | Trained closed book | 13.27 | 7.94 |
| Decoder (21.21) | Wrong-document fit | 13.73 | 7.48 |
| Decoder | Correct | Other paper | Difference |
|---|---|---|---|
| Public, unadapted | 14.21 | 10.90 | 3.31 |
| Document-trained | 21.29 | 7.15 | 14.14 |
Memory-Augmented Language Models
Memory-augmented language models combine persistent or temporary memory with neural computation to retain, retrieve, and use information beyond the active context.
See all 292 papers