ARMED: Adaptive Retrieval-Augmented Medication Recommendation
Organizations: UX Factory, Inc., Seongnam-si, South Korea
Abstract
Medication recommendation requires jointly considering diagnoses, comorbidities, longitudinal patient history, and treatment interactions. Although recent retrieval-augmented generation approaches using language models have shown promise for clinical recommendation, most existing systems rely on fixed retrieval pipelines that cannot adapt to diverse clinical retrieval scenarios and may introduce noisy or irrelevant evidence. We propose ARMED, an adaptive clinical RAG framework that dynamically expands retrieval according to retrieval sufficiency and current-admission relevance. ARMED first observes the initial retrieval outcome and selectively performs supplementary or fallback multi-query retrieval when additional evidence is needed. The framework also incorporates a relevance gate that activates only clinically relevant same-patient history and organizes retrieved evidence into structured query-level clinical evidence. Experiments on MIMIC-IV demonstrate that ARMED consistently outperforms previous static retrieval baselines and improves overall medication recommendation quality. By combining locally runnable small language models with adaptive retrieval, ARMED supports medication recommendation without relying on external language model APIs or task-specific fine-tuning.
Figures & tables
| Method | F1 | 95% CI | Precision | Recall |
|---|---|---|---|---|
| History | 0.2926 | [0.255, 0.326] | 0.2859 | 0.3352 |
| Static RAG | 0.4093 | [0.397, 0.422] | 0.3841 | 0.5084 |
| Static RAG + History | 0.4472 | [0.432, 0.463] | 0.4121 | 0.5669 |
| TreatRAG | 0.4009 | [0.378, 0.425] | 0.4002 | 0.4712 |
| PACE-RAG | 0.3557 | [0.312, 0.397] | 0.4157 | 0.3553 |
| ARMED | 0.5103 | [0.491, 0.531] | 0.4910 | 0.6263 |
| Comparison | F1 | 95% CI | |
|---|---|---|---|
| vs. Static RAG + History | +0.0631 | [0.0522, 0.0735] | |
| vs. TreatRAG | +0.1094 | [0.0916, 0.1279] | |
| vs. PACE-RAG | +0.1546 | [0.1271, 0.1855] |
| Method | Predicted | TP | FP | FN |
|---|---|---|---|---|
| Static RAG + History | 15.834 | 6.490 | 9.344 | 6.136 |
| ARMED | 14.652 | 7.146 | 7.506 | 5.480 |
| Method | F1 | Precision | Recall |
|---|---|---|---|
| w/o History | 0.4387 | 0.4279 | 0.5293 |
| Always-History | 0.4783 | 0.4629 | 0.5757 |
| ARMED | 0.4792 | 0.4635 | 0.5777 |
| Method | F1 | GT Coverage | Evidence Precision |
|---|---|---|---|
| Single-query only | 0.4178 | 0.7174 | 0.2406 |
| Multi-query only | 0.3943 | 0.6329 | 0.2690 |
| Adaptive (ARMED) | 0.4417 | 0.7825 | 0.2437 |
| Metric | Adaptive | Multi-query only |
|---|---|---|
| F1 | 0.4417 | 0.3943 |
| Mean latency (s) | 14.686 | 16.865 |
| P50 latency (s) | 12.088 | 13.466 |
| P95 latency (s) | 28.630 | 33.934 |
| Throughput (/h) | 245.1 | 213.5 |
| Route | F1 | Precision | Recall | |
|---|---|---|---|---|
| Single-query sufficient | 449 | 0.4787 | 0.4587 | 0.5881 |
| Supplement | 448 | 0.4167 | 0.4215 | 0.4962 |
| Fallback | 103 | 0.3888 | 0.3884 | 0.4798 |
| Backbone | Static RAG + History | ARMED | F1 |
|---|---|---|---|
| MedGemma 1.5 4B | 0.4074 | 0.4891 | +0.0817 |
| Qwen3-8B | 0.4472 | 0.5103 | +0.0631 |
| Phi-3.5 Mini 3.8B | 0.3687 | 0.4300 | +0.0613 |
| Gemma 3 4B | 0.4323 | 0.4825 | +0.0502 |
| EXAONE 3.5 2.4B | 0.4143 | 0.4554 | +0.0411 |
| Ministral 3 8B | 0.4900 | 0.4921 | +0.0021 |
| Case Type | Ambiguous Comorbidity Case | Weak Retrieval Case | History Noise Control Case |
|---|---|---|---|
| Clinical Description | Advanced pulmonary malignancy with respiratory failure, renal disease, and cardiac ischemic comorbidity | End-stage renal disease with metabolic derangements and complex renal/urologic history | Neurologic/vascular presentation with diabetes and cardiovascular risk factors, but weakly relevant prior history |
| Baseline Failure | Broad retrieval caused many FP/FN errors | Single-query evidence failed to recover sufficient treatments | Recent history context increased FP burden |
| ARMED Action | Added multi-query supplement and retained relevant history | Switched to multi-query fallback | Rejected prior visits via history gate |
| Evidence Change | Recovered focus-specific candidates | Retrieved diagnosis-focused evidence | Suppressed noisy longitudinal context |
| F1 Change | 0.125 0.667 | 0.400 0.812 | 0.235 0.500 |
| Method | F1 | 95% CI | Precision | Recall |
|---|---|---|---|---|
| Static RAG + History | 0.4631 | [0.4590, 0.4671] | 0.4144 | 0.6179 |
| ARMED | 0.4878 | [0.4836, 0.4918] | 0.4601 | 0.6189 |