RES-MR: A Risk-Aware Reasoning Framework for Explainable and Safe Medication RecommendationRES-MR: Risk-Aware Reasoning for Explainable and Safe Medication Recommendation
RES-MR uses two-stage training for interpretable medication recommendation; on MIMIC-III, RES-MR-8B has Jaccard 0.2803.
- Clinical medication recommendation requires both verifiable reasoning and safety boundaries that vary with the patient. The authors state that existing methods are mostly direct mappings, and safety constraints are globally fixed, which may therefore disadvantage fragile patients or overly restrict patients with higher tolerance.
- RES-MR first performs ECRD: hybrid retrieval over the medical knowledge graph, using GPT-5 to synthesize reasoning traces based on real prescriptions, then SFT. Then RAPO: decomposes drugs into efficacy and risk factors, builds patient prototypes and risk boundaries, and updates using reward shaping, clipping, and GSPO.
- Jaccard, F1, DDI, RIS, and BLEURT are compared on three datasets. The authors state that RES-MR-8B is overall better than the baselines; on MIMIC-III, Jaccard is 0.2803 and DDI is 0.1031. MIMIC-IV and eICU only run 1 epoch of RAPO from the MIMIC-III SFT weights.
- The paper does not have a dedicated limitations section. The conclusion states that future work will explore agentic reasoning with iterative retrieval and self-verification. Experiments were conducted on three EHR datasets and two Llama backbones, with human explanation evaluation on 50 instances.
- Evaluated models
- RES-MR-3B (Llama-3.2-3B-Instruct)RES-MR-8B (Llama-3.1-Aloe-Beta-8B)
- Benchmarks
- MIMIC-IIIMIMIC-IVeICU
- Metrics
- JaccardF1DDIRISBLEURTF_ASF_AE
RES-MR is an LLM-based risk-aware reasoning framework for explainable and safe medication recommendation. It adopts a two-stage training approach: first, it distills explainable clinical reasoning from reasoning trajectories synthesized from patient knowledge obtained via graph retrieval, then it constructs patient-specific reference prototypes using decoupled drug factors to calibrate risk boundaries, guiding safe recommendations through reward shaping and truncation. On benchmark datasets, RES-MR significantly outperforms existing state-of-the-art baselines in accuracy, safety, and interpretability.
Paper analysis
What problem does this paper attempt to solve?
Medication recommendations lack verifiable reasoning, and safety constraints are unrelated to the patient.
Medication recommendation requires verifiable reasoning paths, as well as risk boundaries that adapt to changes in patient clinical status.
- Scenario: The authors state that this task requires jointly considering efficacy, drug interactions, contraindications, and patient context; and that reliable recommendation systems can help reduce preventable medication errors and alleviate physician cognitive burden.
- CH1: The authors state that RNN, GNN, and LLM methods mostly follow direct mapping, outputting only drugs without verifiable reasoning. Attention or aspect alignment is mainly post-hoc feature attribution and cannot explain how conclusions are derived (Figure 1a).
- CH2: The authors state that safety mostly relies on static global constraints such as DDI penalties in the loss or molecular structure representations, without distinguishing individual risk tolerance. The text uses hypertension as an example: the acceptable risk for a healthy young patient differs from that for a frail, multimorbid elderly patient (Figure 1b).
- This paper's approach: Proposes RES-MR. In the two-stage training, explainable clinical reasoning distillation (ECRD) addresses CH1, and risk-aware policy optimization (RAPO) addresses CH2.
What related research exists?
The authors state that existing methods lack verifiable reasoning and do not set risk tolerance per patient.
Medication Recommendation
- Instance and longitudinal: The authors classify LEAP (Zhang et al., 2017) as an instance method, stating that it mainly encodes the current visit and ignores the disease course. Longitudinal methods incorporate medical history: COGNet (Wu et al., 2022) reuses historical medications via copy-or-predict, and ARMR (Wu et al., 2025) uses segmented temporal components to characterize state changes.
- Interpretation and generation: ExpDrug (Lu et al., 2025) maps patient features to interpretable aspects. The authors state that LAMO (Zhao et al., 2025) is the first to combine structured encoding with unstructured clinical text.
Safe Medication Recommendation
- Molecules and interactions: SafeDrug (Yang et al., 2021) uses a dual molecular graph encoder and minimizes the DDI loss; MoleRec (Yang et al., 2023) models the relationship between molecular substructures and patient health states.
- Confidence and generative constraints: ARC (Chen et al., 2025) calibrates confidence at both the single-drug and set levels. KELLM (Xu and Li, 2025) adds safety constraints using LoRA and external knowledge; FLAME (Fan et al., 2025) frames recommendation as sequential decision-making and generates medication lists using stepwise Group Relative Policy Optimization.
- Authors' critique: At the end of this section, the authors state that existing methods lack verifiable reasoning traces and ignore patient-specific risk tolerance.
Reasoning-Enhanced LLM Recommendation
- Before fine-tuning: The authors state that in-context learning such as Chain-of-Thought has been explored, but general LLMs often lack domain optimization if not fine-tuned.
- Two distillation works: EXP3RT (Kim et al., 2025) builds profiles from reviews and generates reasons and ratings in one step; Reason4Rec (Fang et al., 2025) uses a multi-stage framework with feedback to control reasoning paths.
- Difference from clinical settings: The authors state that these general-domain methods prioritize aligning with user preferences and do not simultaneously handle efficacy, drug-drug interactions, and contraindications.
Baselines and Data
- Baselines: General recommendation: LEAP, COGNet, RAREMed, ARMR, LAMO; safety methods: SafeDrug, MoleRec, ARC, KELLM, FLAME; interpretable methods: ExpDrug, Reason4Rec, EXP3RT. ARC uses MICRON as its backbone. LLM baselines use the same Llama-3.1-Aloe-Beta-8B as RES-MR-8B.
- Data: Evaluation uses MIMIC-III, MIMIC-IV, and eICU; the DDI matrix comes from DrugBank, and the knowledge graph is PrimeKG.
The authors position this paper as: supplementing opaque decisions with verifiable reasoning traces, and supplementing patient-agnostic safety constraints with patient-specific risk boundaries.
How does the paper address this problem?
Two-stage training: first distill verifiable reasoning, then optimize the policy according to patient risk boundaries.
RES-MR has two stages: ECRD uses supervised fine-tuning to learn to write reasoning based on evidence, and RAPO then uses reinforcement learning to put efficacy and patient-specific risk into the same reward.
Problem Setting
- Visit records: The t-th visit is v_t=(C_t, n_t, m_t). C_t contains diagnoses, procedures, and demographic attributes, n_t is the clinical note, and m_t is the medication set. This paper writes structured context, notes, and medications all in natural language.
- External graph: G_kg contains medical entities, relations (e.g., Indication, Contraindication), and triples.
- Learning objective: Given historical visits, the current context, and the graph, train an LLM π_θ to generate a reasoning trace and the current medication set.
Interpretable Clinical Reasoning Distillation
- Hybrid retrieval: Node retrieval uses the current structured context to take one-hop neighbors, giving G_node; semantic retrieval embeds the note and takes graph context G_sem by cosine similarity, then merges into G_ret. The implementation uses PrimeKG, Neo4j one-hop, and bge-large-en-v1.5 for top-5 notes.
- Trace source: GPT-5's input includes structured context, notes, G_ret, and the true medications m_t. The authors state the synthetic traces connect symptoms to pharmacological mechanisms and medication actions. Figure 2 shows an example.
- SFT: The student is Llama-3.1-Aloe-Beta-8B, using LoRA to minimize the negative log-likelihood of the concatenated sequence of reasoning path and final medications. Context length is 8192, keeping only the most recent three visits. LoRA rank is 8, alpha is 16, dropout is 0.05; learning rate 2×10^-4, optimizer AdamW, and Flash Attention 2 is used. The authors state this stage gives a format-stable initialization, but the supervised objective does not handle the efficacy-safety trade-off.
Two-Factor Decoupling and Patient Prototypes
- Decoupling: Each drug first takes the semantic vector from the LLM encoder, then passes through a shared encoder and two adapters for efficacy and risk. A mutual exclusion block suppresses shared information between the two factors, followed by variational reparameterization. The paper does not state the model name of this encoder.
- Pretraining: Efficacy positives come from Indication, risk positives from Contraindication, and negatives are randomly sampled from other concepts. The loss includes alignment, orthogonality constraints, and KL. The encoder is trained for 100 epochs, Adam, learning rate 10^-4, hidden/shared dimensions 128/512. λ_orth is searched over [0.05, 0.50] in steps of 0.05, and β_KL over {1, 3, 5, 7, 9}×10^-4. After convergence, μ_eff and μ_risk are frozen.
- Prototypes: Retrieved medications are split into indication and contraindication sets by graph relations, and both are required to be non-empty. The positive prototype is the mean efficacy factor of indication medications, and the negative prototype is the mean risk factor of contraindication medications.
Reward, Clipping, and Policy Update
- Risk boundary: B takes the δ quantile of cosine similarities between historical medications and the negative prototype, with δ=0.9. The authors treat historical medications as an empirical proxy for risk exposure under prior clinical supervision; the larger B is, the authors interpret it as higher tolerance.
- Synthetic reward: R=(1−ρt)Re−ρt Rs. R_e includes Jaccard with the true set and an efficacy bonus for positive similarity to the positive prototype; R_s includes the DDI rate and risk similarity exceeding B. ρ_t is obtained by a sigmoid over the moving-average Jaccard and a linearly increasing threshold, with the threshold annealed starting from 0.2. The authors state this is to avoid premature convergence to overly conservative behavior. Format violations or hallucinated medications are scored -100, and R_e and R_s are skipped.
- Clipping and update: The safety margin is B minus the maximum risk similarity of generated medications to the negative prototype. When the margin is positive, the reward is clipped to the within-group mean minus 1 standard deviation to plus 2 standard deviations; otherwise the upper bound is tightened and the lower bound relaxed. The authors state this is to suppress high-reward but unsafe trajectories. The policy is updated with Group Sequence Policy Optimization: 4 complete sequences are sampled per context, clipping coefficient 0.2, learning rate 10^-6, and importance ratios are normalized by sequence length. Reward weights are tuned over {1, 3, 5, 7, 10}; the paper does not give the selected values.
Generation at Inference
- Input: Graph retrieval is performed again for the current visit, and historical visits, current context, and retrieval results are fed to the trained LLM, which autoregressively generates the reasoning trace and medication set. The paper does not state that B is used for filtering at inference.
What experiments did the paper conduct?
The authors state that RES-MR-8B is overall better on three datasets; the MIMIC-IV DDI is not significance-tested.
Experimental Setup
- Data: MIMIC-III, MIMIC-IV, eICU. In Table 1, the visit/patient counts are 12,433/4,785, 156,315/46,811, and 18,636/8,544, respectively. Patient-level split is 4:1:1. Diagnosis, procedure, and medication spaces are not truncated; the authors state that direct comparison with existing results using different preprocessing is therefore not possible. MIMIC-III and MIMIC-IV keep only admissions with clinical notes and extract present illness, past history, allergies, and admission medications. Diagnoses and procedures are mapped to ICD-9, and medications to DrugBank IDs.
- Models: RES-MR-8B and all LLM baselines use Llama-3.1-Aloe-Beta-8B; RES-MR-3B uses Llama-3.2-3B-Instruct. Traces are synthesized by GPT-5. Note retrieval uses bge-large-en-v1.5. ARC uses MICRON as its backbone.
- Baselines: General recommendation: LEAP, COGNet, RAREMed, ARMR, LAMO; safety methods: SafeDrug, MoleRec, ARC, KELLM, FLAME; interpretable methods: ExpDrug, Reason4Rec, EXP3RT. The latter two are adapted to the medication recommendation setting.
- Metrics: Jaccard and F1 on the last visit of each test patient; DDI rate; the authors' proposed RIS, which measures how much predicted medications exceed the patient's risk boundary. BLEURT is computed only for methods that output explanatory text. F_AS and F_AE are the harmonic means of accuracy with safety and accuracy with BLEURT, respectively.
- Implementation and repetition: PrimeKG, one-hop expansion, top-5 notes. δ=0.9. GSPO group size is 4 and clipping coefficient is 0.2. Each setting uses 5 random seeds; Table 2 reports mean and standard deviation. Hardware is 8 NVIDIA A100-SXM4, Intel Xeon Platinum 8370C, and 512GB memory.
- Transfer setting: MIMIC-IV and eICU start from the MIMIC-III SFT weights and only run 1 epoch of RAPO; baselines on these two datasets are fully trained.
Main Results
According to Table 2, the table below shows means; standard deviations are not included. Transfer rows use only 1 epoch of RAPO. Methods that do not output explanatory text have BLEURT recorded as "–" in the original.
Swipe horizontally to read the table
Setting and Method Jaccard↑ F1↑ DDI↓ RIS↓ BLEURT↑ MIMIC-III / RES-MR-8B 0.2803 0.4179 0.1031 0.1267 0.4538 MIMIC-III / RES-MR-3B 0.2407 0.3681 0.1041 0.1342 0.4390 MIMIC-III / FLAME 0.2601 0.3880 0.1291 0.1374 — MIMIC-III / Reason4Rec 0.1529 0.2519 0.1512 0.1311 0.4052 MIMIC-IV transfer / RES-MR-8B 0.2525 0.3842 0.1064 0.1247 0.4439 MIMIC-IV / FLAME 0.2401 0.3644 0.1210 0.1344 — MIMIC-IV / Reason4Rec 0.1477 0.2480 0.1476 0.1370 0.4207 eICU transfer / RES-MR-8B 0.2593 0.3908 0.1009 0.1247 0.4368 - Authors' overall interpretation: The authors state that ECRD provides explicit clinical reasoning and RAPO balances efficacy and safety, and state a 7.7% Jaccard improvement over FLAME on MIMIC-III. Table 2 marks paired t-tests with * for p<0.05的格子;论文未说明配对对象。上表8B行中,仅MIMIC-IV的DDI未标*。F_AS在三套数据上分别为0.5007、0.4682、0.4758,F_AE分别为0.3946、0.3708、0.3727,均为Table 2该列最高。
- 安全与迁移:作者称以DDI惩罚为主的SafeDrug、MoleRec可能过保守,并称RES-MR的RIS和DDI最低。例外是MIMIC-IV:最低DDI是RES-MR-3B的0.1017,不是8B的0.1064。同表中RES-MR-3B在MIMIC-IV的Jaccard为0.2301,低于FLAME的0.2401;eICU上3B的Jaccard为0.2376,低于FLAME的0.2397。
- 省略与推理基线:表未列入LEAP、COGNet、RAREMed、ARMR、LAMO、SafeDrug、MoleRec、KELLM、ARC、ExpDrug、EXP3RT,以及两套迁移数据上的RES-MR-3B。作者认为Reason4Rec、EXP3RT未能把推理转成临床准确且安全的决策,可能因为它们来自偏好对齐、缺少显式安全约束。eICU上RES-MR-3B的BLEURT为0.4013,低于Reason4Rec的0.4277和EXP3RT的0.4119。
消融
- 测了什么:Table 3在MIMIC-III上去掉推理、检索、RAPO或双因子解耦。完整RES-MR-8B的Jaccard、DDI、BLEURT为0.2803、0.1031、0.4538。
- 结果:无推理时Jaccard为0.2414、DDI为0.1474,且无BLEURT。无检索时三者为0.2244、0.1626、0.4117。无RAPO时为0.2668、0.1505、0.4408。无解耦时为0.2631、0.1211、0.4410。
- 作者的解读:作者称检索增强推理是准确决策的基础;只做监督学习不足以内化患者特异风险边界;解耦因子对构造原型是关键的。
解释质量与案例
- 协议:Section 5.6在MIMIC-III随机抽50条,做盲法成对比较。评审为GPT-5和3名医学或药学背景评估者。解释看Reasonableness、Verifiability,药物集合看Effectiveness、Safety。ExpDrug只评后两项。
- 作者的解读:作者称Figure 5中RES-MR持续优于基线,并归因于ECRD和RAPO。图注写p-value<0.05。正文写四个维度上Fleiss' κ>0.7, and state that human and GPT-5 judgments agree. Percentages in the plain text cannot be reliably mapped to methods, so they are not cited item by item.
- Case study: Table 4 shows Subject 41115 from MIMIC-III, an 80-year-old male with aortic valve replacement plus bypass, with a history of atrial fibrillation and hypertension. The authors state the model recommends Neostigmine and Glycopyrronium according to the surgical procedure, places Warfarin after hemostasis, and recommends potassium supplementation for Furosemide-related hypokalemia. The authors treat this case as an example of verifiable reasoning and patient-specific risk boundaries.
Other Ablations and Analyses
- Without dense reward: Jaccard 0.2714, DDI 0.1103, BLEURT 0.4483 (Table 3).
- Without sparse reward: Jaccard 0.2631, DDI 0.1386, BLEURT 0.4396.
- Without dynamic trade-off: Jaccard 0.2703, DDI 0.1324, BLEURT 0.4387.
- Without reward clipping: Jaccard 0.2688, DDI 0.1086, BLEURT 0.4337; the authors state this may cause reward hacking.
- Figure 3 varies λ_j, λ_e, λ_d, λ_r over {1, 3, 5, 7, 10}. The authors state that too large λ_e slightly decreases Jaccard; when λ_d and λ_r are too high, DDI decreases but Jaccard also decreases. Curve readings in the figure cannot be reliably mapped in plain text, so they are not cited.
- Figure 4: The authors state training takes about 125 GPU-hours (8 A100s) and inference 13.3 seconds (single A100); and state training is lower than FLAME and inference is comparable to LAMO. KELLM has lower time cost, which the authors attribute to its non-generative design.
What are some points that can be further explored?
The paper does not list limitations separately; the conclusion proposes exploring iterative retrieval and self-verification.
Limitations and future directions noted by the authors
- Future directions: The paper has no dedicated Limitations section, nor does it list limitations item by item in the Discussion or appendix. Section 6 states that future work will explore agentic reasoning workflows with iterative retrieval and self-verification to strengthen faithful clinical reasoning and further improve decision reliability.
Experimental coverage
- Data: Evaluations are MIMIC-III (12,433 admissions / 4,785 patients), MIMIC-IV (156,315 / 46,811), and eICU (18,636 / 8,544), with patient-level 4:1:1 (Table 1, Section 5.1). The experimental setup states that after retaining the full medication label space, results cannot be directly compared with existing studies using different preprocessing.
- Models and knowledge sources: Tested backbones are Llama-3.2-3B-Instruct and Llama-3.1-Aloe-Beta-8B; the LLM baseline uniformly uses the latter. Trajectory synthesis and explanation review use GPT-5. Retrieval uses bge-large-en-v1.5 and PrimeKG, and the DDI matrix comes from DrugBank.
- Training scope: MIMIC-III goes through the full two stages; MIMIC-IV and eICU start from MIMIC-III's SFT weights and only do 1 epoch of RAPO, while baselines are fully trained on the corresponding datasets (Section 5.2). All experiments are repeated 5 times.
- Explanation evaluation: BLEURT and F_AE are computed only for methods that output explanation text (Table 2 note). Human and GPT pairwise evaluations are on 50 random MIMIC-III items with 3 evaluators plus GPT-5 (Section 5.6).
- Implementation details not reported in the paper: The number of RAPO training epochs on MIMIC-III, the number of synthetic trajectories, the name of the LLM used for drug semantic embeddings, the final values of λ_orth, β_KL, and the four reward weights, and the comparison method for the paired t-test.
Summarize the main content of the paper
RES-MR uses retrieval distillation and risk-aware reinforcement learning for interpretable medication recommendation.
RES-MR frames EHR medication recommendation as a generation process with reasoning traces and incorporates patient-specific risk boundaries during training.
- Problem addressed: The authors believe direct mapping lacks diagnostic logic verifiable by physicians, and fixed global safety constraints ignore individual risk tolerance.
- Approach: ECRD first performs hybrid retrieval over the medical graph, GPT-5 synthesizes reasoning traces after seeing the real prescriptions, then SFT is applied to Llama. RAPO decomposes the drug representation into efficacy and risk factors, calibrates risk boundaries using the δ quantile of historical medications, then updates the policy with reward shaping, clipping, and GSPO.
- Full training results: On MIMIC-III, RES-MR-8B has Jaccard 0.2803, F1 0.4179, DDI 0.1031, RIS 0.1267, BLEURT 0.4538 (Table 2). The authors state a 7.7% Jaccard improvement over FLAME. In the same table, 3B has Jaccard 0.2407, lower than FLAME's 0.2601.
- Transfer results: MIMIC-IV and eICU only run 1 epoch of RAPO. The 8B Jaccard is 0.2525 and 0.2593, respectively. On MIMIC-IV, the 8B DDI is 0.1064, not significance-tested; the lowest DDI on this dataset is 3B's 0.1017.
- Components: In Table 3, removing retrieval gives Jaccard 0.2244 and DDI 0.1626; removing RAPO gives DDI 0.1505. In 50 pairwise evaluations, the authors state RES-MR is better, with inter-rater Fleiss' κ>0.7.
- Authors' conclusion: The authors state that two-stage training achieves a better accuracy-safety trade-off on three datasets; future work will explore agentic reasoning with iterative retrieval and self-verification.