Abstract
Drug-drug interactions (DDIs) remain a major source of preventable harm, and many clinically important mechanisms are still unknown. Existing models either rely on pharmacologic knowledge graphs (KGs), which fail on unseen drugs, or on electronic health records (EHRs), which are noisy, temporal, and site-dependent. We introduce, to our knowledge, the first system that conditions KG relation scoring on patient-level EHR context and distills that reasoning into an EHR-only model for zero-shot inference. A fusion "Teacher" learns mechanism-specific relations for drug pairs represented in both sources, while a distilled "Student" generalizes to new or rarely used drugs without KG access at inference. Both operate under a shared ontology of pharmacologic mechanisms to produce interpretable, auditable alerts rather than opaque risk scores. Trained on a multi-institution EHR corpus paired with a curated DrugBank DDI graph, the system maintains precision across multi-institution test data, produces mechanism-specific predictions, and reduces false alerts at comparable overall detection performance (F1) compared to prior methods. Case studies further show zero-shot identification of clinically recognized mechanisms for drugs absent from the KG.
Introduction
Adverse drug-drug interactions (DDIs) are a massive source of preventable harm in healthcare. To flag these computationally, researchers typically rely on either pharmacological Knowledge Graphs (KGs) or Electronic Health Records (EHRs). However, both have significant limitations in isolation. KGs are static and struggle with "zero-shot" prediction—they cannot interpolate relationships for newly approved or rare drugs that lack existing graph edges. Conversely, EHRs capture real-world, patient-specific context but are notoriously noisy, temporal, and cohort-dependent. This creates a practical gap: models either fail to extrapolate to new drugs or overfit to cohort noise, bombarding clinicians with imprecise alerts.
Methodology: The Teacher-Student Framework
To bridge the gap between static KGs and dynamic EHRs, we propose a dual-pathway, teacher-student architecture. This framework allows the system to leverage the structured knowledge of KGs during training while maintaining the flexibility of EHR-only inference for new medications.
Fusion Teacher
For drugs present in both the KG and EHR, a "Teacher" model fuses KG entity embeddings with aggregated, per-drug EHR embeddings (derived using a RETAIN model). A dimension-wise gating mechanism modulates the signals, allowing patient context to amplify or dampen KG-derived mechanism scores. This contextualization helps filter out patient-implausible links, preserving relational structure while reducing false positives.
Knowledge-Distilled Student
To handle unseen drugs without KG nodes, we train an EHR-only "Student" model. Using knowledge distillation (KD), the student learns to mimic the teacher's mechanism-specific predictions using only EHR features at inference time. This effectively transfers structured pharmacological reasoning into a model that only requires routine hospital data for zero-shot prediction.
Experimental Setup
The system was trained and evaluated using two primary data sources:
- DrugBank KG: A curated knowledge graph containing 1,710 drugs and 86 specific DDI relation types (mechanisms).
- TriNetX EHR Corpus: A massive dataset of ~200 million de-identified clinical events spanning over 220 healthcare organizations.
Both models output actionable alerts via a two-step process: a high-precision binary detector decides whether to issue an alert, and a classifier assigns it to one of 86 specific pharmacological mechanisms (e.g., "CYP inhibition"), making the alerts auditable for pharmacists.
Key Results
Transductive Performance
In the transductive setting (seen drugs, unseen edges), the Fusion Teacher achieved 0.9008 precision, representing an 11% absolute improvement over the KG-only AutoSF baseline (0.8133) and vastly outperforming EHR-only models (0.5712). The F1 score nearly doubled to 0.3198.
Zero-Shot Performance
The Distilled Student maintained a remarkable 0.7126 precision on entirely unseen drugs, significantly outperforming EHR-only, SMILES-only, and KG-only baselines. This confirms that the distillation process successfully transfers generalizable pharmacological patterns rather than simple memorization.
Qualitative Case Studies
Qualitative analysis demonstrated the student model's ability to identify clinically recognized mechanisms for drugs absent from the training KG. For example, the model correctly flagged the CYP2D6-mediated reduction of endoxifen for Tamoxifen, proving its utility in real-world pharmacovigilance for new drug entries.
Conclusion
By fusing KG and EHR data, our framework addresses the "cold-start" problem in DDI prediction. The resulting mechanism-specific alerts provide clinicians with actionable insights rather than opaque risk scores. Future work will focus on uncertainty calibration and "silent-mode" hospital deployments to evaluate real-world actionability without interrupting clinical workflows.
Summary updated