Efficient and Effective Internal Memory Retrieval for LLM-Based Healthcare Prediction
Organizations: University of Massachusetts, Amherst · University of Connecticut · University of Massachusetts, Lowell · UMass Chan Medical School
Abstract
Large language models (LLMs) hold significant promise for healthcare, yet their reliability in high-stakes clinical settings is often compromised by hallucinations and a lack of granular medical context. While Retrieval Augmented Generation (RAG) can mitigate these issues, standard supervised pipelines require computationally intensive searches over massive external knowledge bases, leading to high latency that is impractical for time-sensitive care. To address this, we introduce Keys to Knowledge (K2K), a novel framework that replaces external retrieval with internal, key-based knowledge access. By encoding essential clinical information directly into the model's parameter space, K2K enables rapid retrieval from internal key-value memory without inference-time overhead. We further enhance retrieval quality through activation-guided probe construction and cross-attention reranking. Experimental results demonstrate that K2K achieves state-of-the-art performance across four benchmark healthcare outcome prediction datasets.
Figures & tables
| III-Mort | III-Read | IV-Mort | IV-Read | |
| Train | 7,777 | 7,777 | 100,125 | 10,0125 |
| Test | 953 | 953 | 12,667 | 12,667 |
| Dev | 978 | 978 | 12,547 | 12,547 |
| Mortality-MIMIC-III | Readmission-MIMIC-III | ||||||||||
| Type | Model | F1 | Jac. | AUPRC | AUROC | Avg | F1 | Jac. | AUPRC | AUROC | Avg |
| ML | GRU Chung et al. (2014) | 13.87 | 7.45 | 8.03 | 53.50 | 20.71 | 68.28 | 51.84 | 52.94 | 50.00 | 55.77 |
| RETAIN Choi et al. (2016) | 13.73 | 7.37 | 9.57 | 54.86 | 21.38 | 45.88 | 23.48 | 54.11 | 51.29 | 43.69 | |
| Deepr Nguyen et al. (2016) | 13.87 | 7.45 | 7.58 | 51.66 | 20.14 | 68.28 | 51.84 | 51.68 | 49.70 | 55.38 | |
| AdaCare Ma et al. (2020) | 12.90 | 6.89 | 7.80 | 50.69 | 19.57 | 63.49 | 46.51 | 52.83 | 52.27 | 53.77 | |
| StageNet Gao et al. (2020) | 9.97 | 5.25 | 7.10 | 47.14 | 17.37 | 51.56 | 34.74 | 50.38 | 48.27 | 46.24 | |
| Model | F1 | Jaccard | AUPRC | AUROC | |
| Mortality-III | K2K | 18.55 | 10.22 | 15.22 | 61.05 |
| K2K w/o graph | 20.48 | 11.40 | 13.18 | 60.54 | |
| K2K w/o document | 16.66 | 9.09 | 10.52 | 55.72 | |
| Mortality-IV | K2K Ours | 6.61 | 3.42 | 2.93 | 66.50 |
| K2K w/o graph | 4.50 | 2.30 | 2.51 | 60.86 | |
| K2K w/o document | 3.57 | 1.82 | 2.71 | 66.41 |
| Model | F1 | Jaccard | AUPRC | AUROC | |
| Mortality-III | K2K | 18.55 | 10.22 | 15.22 | 61.05 |
| LLM | 4.49 | 2.29 | 8.67 | 55.62 | |
| LLM+Doc | 16.00 | 8.69 | 11.61 | 59.40 | |
| LLM+Graph | 4.50 | 2.29 | 8.67 | 55.62 | |
| LLM+Doc+Graph | 16.00 | 8.70 | 11.61 | 59.41 | |
| Readmission-III | K2K | 69.31 | 53.03 | 62.49 | 56.64 |
| Model | F1 | Jaccard | AUPRC | AUROC | |
| Mortality-III | K2K | 18.55 | 10.22 | 15.22 | 61.05 |
| K2K w Euclidean | 16.97 | 9.27 | 9.67 | 57.25 | |
| K2K (Mean Only) | 12.06 | 6.42 | 8.45 | 52.51 | |
| Readmission-III | K2K | 69.31 | 53.03 | 62.49 | 56.64 |
| K2K w Euclidean | 63.27 | 46.28 | 58.26 | 53.25 | |
| K2K (Mean Only) | 63.98 | 47.03 | 54.67 | 50.92 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Avg | Retrieval Time | |
| KARE | 21.11 | 00:33:52 |
| Prompt-based | 22.52 | 3:26:00 |
| K2K | 22.89 | 0:0:5 |
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 291 papers