RES-MR: Risk-Aware Reasoning for Explainable and Safe Medication Recommendation
Authors: Cong Wang, Jin Li, Shoujin Wang, Yishuo Li, Huilin Gu, Wenpeng Lu
Organizations: Key Laboratory of Computing Power Network and Information Security, Ministry of Education, Shandong Computer Science Center (National Supercomputer Center in Jinan), Qilu University of Technology (Shandong Academy of Sciences); Shandong Provincial Key Laboratory of Computing Power Internet and Service Computing, Shandong Fundamental Research Center for Computer Science, Jinan, Shandong, China · University of Technology Sydney, Sydney, NSW, Australia
Medication recommendations seek to deliver personalized drug combinations based on patients' clinical information, where ensuring transparent decision-making and personalized safety are of paramount importance. However, existing approaches predominantly operate as ``black boxes'', offering limited interpretability and hindering clinician trust. Furthermore, they typically rely on fixed, patient-agnostic safety constraints, neglecting the heterogeneity of risk tolerance across individuals, which poses significant risks to vulnerable populations. To address these gaps, we propose RES-MR, a novel Risk-aware Reasoning framework for Explainable and Safe Medication Recommendation using LLMs. RES-MR follows a two-stage training paradigm: (1) an explainable clinical reasoning distillation stage to elicit diagnostic capabilities by fine-tuning on synthesized reasoning trajectories, grounded in patient-specific knowledge from graph retrieval; and (2) a risk-aware policy optimization stage to dynamically balance therapeutic efficacy with personalized safety. This stage employs disentangled drug factors to construct patient-specific reference prototypes that capture desired therapeutic drug features and risk features to avoid. These prototypes enable risk boundary calibration and guide the model toward safe recommendations via reward shaping and clipping. Extensive experiments on benchmark datasets demonstrate that RES-MR significantly outperforms state-of-the-art baselines in terms of accuracy, safety, and explainability. Our code and data are available at: https://github.com/wangcong2001/RES-MR.
Figures & tables
Figure 1. Examples illustrating two limitations of existing methods. (a) Most RNN/GNN/LLM methods follow a “direct-mapping” paradigm and usually output drugs (e.g., a beta-blocker for asthma) without providing an explicit rationale, leading to trust issues. (b) Safety-oriented methods use static global constraints, imposing a one-size-fits-all risk tolerance and thus risking vulnerable patients or over-restricting robust ones. (c) RES-MR leverages retrieval-augmented reasoning and personalized boundaries to generate verifiable explanations and safe medication recommendations.
Figure 2. Overall framework and training/inference pipeline of RES-MR. Stage 1: Given patient EHRs, hybrid retrieval retrieves patient-specific evidence from the knowledge graph; a teacher LLM synthesizes reasoning trajectories to perform Supervise Fine-tuning (SFT) of the LLM, endowing it with strong reasoning capabilities to provide explicit explanations. Stage 2: We further optimize the LLM with Reinforcement Learning (RL). A pretrained dual-factor disentanglement extracts drug efficacy and risk factors to construct patient-specific prototypes, which guide the policy update during RL training via reward shaping and clipping to ensure safety. Inference: The fully trained LLM uses the hybrid retrieval to augment generation with retrieved knowledge and outputs verifiable explanations and safe medication recommendations.
Items
MIMIC-III
MIMIC-IV
eICU
# of visits / # of patients
12,433 / 4,785
156,315 / 46,811
18,636 / 8,544
dis. / proc. / med. space size
4,316 / 1,330 / 593
19,812 / 10,859 / 743
1,562 / 937 / 152
avg. / max # of visits
5.68 / 29
11.07 / 70
2.18 / 9
avg. / max # of dis. per visit
14.68 / 39
13.45 / 56
4.79 / 76
avg. / max # of proc. per visit
4.69 / 32
2.75 / 34
8.03 / 118
avg. / max # of med. per visit
14.78 / 67
14.24 / 128
10.35 / 51
Table 1. Statistics on MIMIC-III, MIMIC-IV, and eICU Datasets
Dataset
Methods
Jaccard ↑
F1 ↑
DDI ↓
RIS ↓
BLEURT 1 ↑
FAS↑
FAE↑
MIMIC-III
LEAP
0.1934 ± 0.0023
0.3285 ± 0.0032
0.1341 ± 0.0012
0.1433 ± 0.0023
-
0.4005 ± 0.0029
-
COGNet
0.2381 ± 0.0019
0.3628 ± 0.0032
0.1466 ± 0.0013
0.1473 ± 0.0021
-
0.4444 ± 0.0015
-
RAREMed
0.2244 ± 0.0046
0.3414 ± 0.0012
0.1482 ± 0.0046
0.1547 ± 0.0038
-
0.4243 ± 0.0026
-
ARMR
0.2356 ± 0.0055
0.3599 ± 0.0035
0.1536 ± 0.0025
0.1613 ± 0.0035
-
0.4400 ± 0.0040
-
LAMO
0.2512 ± 0.0003
0.3707 ± 0.0027
0.1124 ± 0.0023
0.1427 ± 0.0027
-
0.4585 ± 0.0015
-
SafeDrug
0.2210 ± 0.0023
0.3469 ± 0.0012
0.1054 ± 0.0014
0.1484 ± 0.0015
-
0.4285 ± 0.0012
-
Table 2. Comparison of accuracy, safety, and explainability performance with baselines on the MIMIC-III, MIMIC-IV, and eICU datasets. ↑ and ↓ indicate higher and lower is better, respectively. The best and second-best results are highlighted in bold and underlined . * denotes statistical significance ( p<0.05 ) by a paired t -test.
Methods
Jaccard ↑
DDI ↓
BLEURT ↑
RES-MR w/o Reasoning
0.2414
0.1474
-
RES-MR w/o Retrieval
0.2244
0.1626
0.4117
RES-MR w/o RAPO
0.2668
0.1505
0.4408
RES-MR w/o Disentangle
0.2631
0.1211
0.4410
RES-MR w/o Dense Reward
0.2714
0.1103
0.4483
RES-MR w/o Sparse Reward
0.2631
0.1386
0.4396
Table 3. Ablation study of RES-MR on the MIMIC-III dataset.
Figure 3. Hyperparameter effects on model performance.
Figure 4. Efficiency analysis of training cost and inference time on MIMIC-III. Training uses 8× NVIDIA A100 GPUs, while inference uses a single NVIDIA A100 GPU.
Figure 5. Human and GPT evaluations on pairwise quality comparison of explanations (p-value < 0.05).
Key Laboratory of Computing Power Network and Information Security, Ministry of Education; Shandong Computer Science Center (National Supercomputer Center in Jinan); Qilu University of Technology (Shandong Academy of Sciences); Shandong Provincial Key Laboratory of Computing Power Internet and Service Computing; Shandong Fundamental Research Center for Computer Science, Jinan, Shandong, China · University of Technology Sydney
1Artificial Intelligence Thrust, The Hong Kong University of Science and Technology (Guangzhou) · Faculty of Engineering, University of New South Wales · 3Medical Big Data Center, Guangdong Provincial People’s Hospital, Southern Medical University +2