HADRec: A Hierarchy-Aware Drug Recommendation Framework by Fusing Molecular Knowledge and Electronic Health Record

cs.LG Junke Wang, Hongshun Ling, Li Zhang, Jinjing Wu, Tong Shao, Fang Wang, Yuan Gao · Oct 1, 2026
Local to this browser
What it does
HADRec targets two key gaps in AI-driven medication recommendation: drugs are usually treated as anonymous tokens, and predictions ignore the hierarchical structure of the ATC taxonomy. The proposed framework fuses LLaMA-7B–encoded...
Why it matters
The proposed framework fuses LLaMA-7B–encoded clinical text with ChemBERTa molecular embeddings via cross-attention, then generates prescriptions through a four-level top-down ATC predictor constrained by a novel consistency loss. This is...
Main concern
HADRec presents a sensible, incremental extension of medication recommendation that combines molecular embeddings with hierarchical ATC constraints. On MIMIC-III it attains modest accuracy gains—Jaccard 0.
Community signal
0
0 up · 0 down
Sign in to vote with arrows
AI Review AI reviewed
Plain-language introduction

HADRec targets two key gaps in AI-driven medication recommendation: drugs are usually treated as anonymous tokens, and predictions ignore the hierarchical structure of the ATC taxonomy. The proposed framework fuses LLaMA-7B–encoded clinical text with ChemBERTa molecular embeddings via cross-attention, then generates prescriptions through a four-level top-down ATC predictor constrained by a novel consistency loss. This is important because grounding recommendations in both chemical structure and medical ontology could improve accuracy, interpretability, and clinical trustworthiness.

Critical review
Verdict
Bottom line

HADRec presents a sensible, incremental extension of medication recommendation that combines molecular embeddings with hierarchical ATC constraints. On MIMIC-III it attains modest accuracy gains—Jaccard 0.5517 versus 0.5431 for EGNeT—yet its claims of state-of-the-art safety and strong cross-dataset generalization are overstated. Its DDI rate of 0.0774 is higher than SafeDrug and several other baselines, and on MIMIC-IV it is competitive but not dominant (e.g., DEPOT exceeds it on Jaccard and PR-AUC). The work is a valid contribution, but readers should treat the boldest claims with caution.

“Extensive experiments on MIMIC-III demonstrate that HADRec achieves state-of-the-art performance across Jaccard, F1, and PR-AUC.”
paper · Abstract
“It maintains a competitively low DDI rate (0.0774),”
paper · Section 5.1
“we propose a DDI-controllable drug recommendation model named SafeDrug to leverage drugs’ molecule structures and model DDIs explicitly”
SafeDrug (Yang et al., 2021) · arXiv:2105.02711, Abstract
What holds up

The cross-attention fusion between patient states and the precomputed molecular knowledge base is a principled mechanism for injecting pharmacological context into patient representations, and the ablation study confirms that removing molecular knowledge degrades performance. The top-down hierarchical predictor is clinically intuitive, and the visualization of attention weights shows that the model learns a coherent “parent-to-child” reasoning pattern across ATC levels. Calibration metrics and a public code release further strengthen the empirical foundation.

“The attention weights are then used to aggregate the molecular knowledge $\mathcal{H}_{mol}$ through a weighted sum, producing a patient-specific pharmacological context vector $C_{drug}$:”
paper · Section 3.4
“Removing the MKR module leads to a marked drop in all accuracy metrics compared to the full model (cf. Row 4 vs. Row 5). This confirms that fine-grained molecular semantics provides essential pharmacological prior and enhance the model’s ability to align patient states with drug mechanisms.”
paper · Section 5.2
Main concerns

HADRec’s safety narrative is undercut by its DDI rate: on MIMIC-III it reports 0.0774, which is worse than SafeDrug (0.0589) and several other baselines, and on MIMIC-IV the rate rises further to 0.0873. Moreover, the external validation does not support “strong generalization”: on MIMIC-IV HADRec is beaten on Jaccard by DEPOT (0.4857 vs 0.4861) and on PR-AUC by DEPOT (0.7193 vs 0.7274), so its advantage is largely limited to F1.\n\nSecond, the consistency loss adds only a marginal gain—ablation shows a Jaccard drop of merely ~0.0045 when it is removed—and the molecular projection layer is precomputed, limiting end-to-end learning. The L2 ATC level is pruned to just 17 categories without justification, and critical training details such as the number of runs, batch size, and random seeds are omitted.

“It maintains a competitively low DDI rate (0.0774),”
paper · Section 5.1
“HADRec trained directly on MIMIC-IV achieves the highest F1-score (0.6408) among all compared methods, while also obtaining competitive Jaccard (0.4857) and PR-AUC (0.7193).”
paper · Section 5.7.1
“Furthermore, removing both the HP and CL modules—thereby reverting to a flat prediction structure while retaining molecular knowledge—results in the most substantial performance decrease across all metrics (cf. Row 2 vs. Row 5).”
paper · Section 5.2
Evidence and comparison

The MIMIC-III experiments support modest improvements in Jaccard, F1, and PR-AUC, but the evidence for safety and hierarchy-aware superiority is weaker than claimed. The counterfactual case study is purely anecdotal—only three cases with top-category lists—and does not substitute for a systematic causal evaluation. Although the comparison to flat and molecular baselines is generally fair, the omission of hierarchy-aware competitors such as CEHMR limits the evidence that the ATC constraint itself drives the gains.

“These results demonstrate clinically consistent and interpretable medication recommendation behavior in both real-world and counterfactual clinical scenarios under controlled comorbidity perturbations.”
paper · Section 5.6
“current medication recommendation frameworks still predominantly adopt flat multi-label formulations that overlook the intrinsic hierarchical logic of the ATC taxonomy.”
paper · Section 2
Reproducibility

The authors release code at a public GitHub repository and report most hyperparameters in Table 3, which is helpful. However, the statement that results are averaged over “multiple runs” lacks the exact count, random seeds, or batch size, and the standard deviations for HADRec are noticeably larger than those of baselines. The molecular embedding projection is described as precomputed, yet it is unclear whether this projection is learned or frozen, which matters for reproducing the fusion module. Because MIMIC access is credential-gated, exact replication further depends on a detailed preprocessing and ATC-mapping protocol that is only sketched.

“Code and data for this research are available at: https://github.com/wjk78623-cell/HADRec/tree/main”
paper · Data availability
“Results are reported as mean ± standard deviation across multiple runs.”
paper · Table 4 caption
Abstract

Accurate medication recommendation is central to clinical decision-making, directly determining therapeutic efficacy and patient safety. However, existing methods suffer from two key limitations: drugs are often abstracted as discrete tokens, ignoring their molecular structures and pharmacological mechanisms, and the commonly used "flat" recommendation paradigm fails to leverage the hierarchical logic of the internationally standardized Anatomical Therapeutic Chemical (ATC) classification system. To address these issues, we propose HADRec, a Hierarchy-Aware Drug Recommendation framework that integrates molecular knowledge with electronic health records (EHRs). HADRec employs LLaMA-7B to encode clinical notes for rich patient representations and ChemBERTa to encode drug Simplified Molecular Input Line Entry System strings, building a global molecular knowledge base. A cross-attention mechanism then performs deep multimodal fusion between patient states and drug features. The framework further incorporates a hierarchical predictor and a novel consistency constraint loss to enforce strict adherence to ATC logical dependencies. Extensive experiments on MIMIC-III demonstrate that HADRec achieves state-of-the-art performance across Jaccard, F1, and PR-AUC. External validation on MIMIC-IV confirms strong generalization under distribution shifts, and calibration analysis shows well-calibrated predictive confidence on MIMIC-IV with ECE = 0.04, and Brier = 0.06. Counterfactual evaluation reveals clinically aligned reasoning, disentangling disease-specific treatments from general care. Together, these results establish HADRec as a high-performance, interpretable, and clinically grounded pathway toward safe and reliable AI-driven medication recommendation.

Challenge the Review

Pick a starting point or write your own. Challenges run in the background, so you can keep reading while the AI investigates.

No challenges yet. Disagree with the review? Ask the AI to revisit a specific claim.