REFINE: A Fine-Grained Medication Recommendation System Using Deep Learning and Personalized Drug Interaction Modeling
Authors: Suman Bhoi
Mong-Li Lee
Wynne Hsu
Ngiap Chuan Tan
Venue: NeurIPS 2023 poster (2023)
Keywords: Fine-grained Medication recommendation
Drug Interaction Severity

Abstract: Patients with co-morbidities often require multiple medications to manage their conditions. However, existing medication recommendation systems only offer class-level medications and regard all interactions among drugs to have the same level of severity. This limits their ability to provide personalized and safe recommendations tailored to individual needs. In this work, we introduce a deep learning-based fine-grained medication recommendation system called REFINE, which is designed to improve treatment outcomes and minimize adverse drug interactions. In order to better characterize patients’ health conditions, we model the trend in medication dosage titrations and lab test responses, and adapt the vision transformer to obtain effective patient representations. We also model drug interaction severity levels as weighted graphs to learn safe drug combinations and design a balanced loss function to avoid overly conservative recommendations and miss medications that might be needed for certain conditions. Extensive experiments on two real-world datasets show that REFINE outperforms state-of-the-art techniques.

A Fine-Grained Medication Recommendation System Using Deep Learning and Personalized Drug Interaction Modeling
REFINE:
Suman Bhoi'
Mong Li Lee
Wynne Hsu
Ngiap Chuan Tan
National University of Singapore
SengHealth Polyclinics
sumanbhoi @ edu,, whsu) @ comp.nus cww.:uuuuuuuu.ggg...... tan.ngiap.chuan hiiiaapphhaannsngggaattth...... com.sg
Abstract
Patients with co-morbidities often require multiple medications manage their conditions. However, existing medication recommendation systems only offer class- level medications and regard all interactions among drugs to have the same level of severity, This limits their ability to provide personalized and safe recommendations tailored to individual needs. In this work, introduce deep learning-basee fine- grained medication recommendation system called REFINE, which is designed to improve treatment outcomes and minimize adverse drug interactions. order better characterize patient's 's health conditions, we model the trend in medication dosage titrations and lab test responses, and adapt the vision transformer to obtain effective patient representations. We also model drug interaction severity levels as weighted graphs to learn safe drug combinations and design balanced loss function to avoid overly conservative recommendations and miss medications that might be needed for certain conditions. Extensive experiments on two real-world datasets shows that REFINE outperforms state-of-the-arl techniques.
Introduction
The widespread adoption of digital patient records in hospitals has led to the creation of a rich knowl- edge base in the form of Electronic Health Records (EHR). This valuable resource can be utilized for various tasks in the medical domain, such as mortality prediction [19], outcome prediction [14), and medication recommendation [16 2] Concurrently, advances in drug therapy have resulted in growing interest in research aimed at enabling personalized and safe treatment recommendations for managing patient conditions. Current medication recommendation systems are coarse-grained, providing rec- ommendation at the class level rather than individual drugs, and are unable to differentiate between patients who require single versus multiple drugs from the same class. For example, while diabetic patients often prescribed Metformin to manage their blood sugar levels, patients with uncontrolled blood sugar level may be given additional blood glucose lowering drug such as Glipizide which belong the same medication class A Metformin. As such, the recommended treatment regime is the same for both types of patients which is suboptimal. Thus, it is essential to develop a fine-grained recommender system capable of providing recommendations at the drug level.
Existing recommender systems that consider drug interactions assume that all the interactions have the same severity. This is not true in practice resources on drug information such as the DDInter database (23) record different levels of interaction severity, ranging from mild to moderate to severe. By assuming all interactions are equally severe, existing recommender systems tend to avoid any combination of drugs with known interactions, even when the benefits outweigh the potential risks.
https//wwww.whccc.oo/aae ddd https//wwww...e.....oo.ooooeoota
37th Conference on Neural Information Processing Systems (NcurIPS 2023).

---

For example, in the benchmark MIMIC-IV [10]. Metformin and Lisinopril are preseribed together 36% of the time for patients with diabetes and hypertension better manage their conditions, despite having a moderate level of interaction severity.
In this work, we propose fine-grained medication recommender system that takes into account the severity of drug interactions and leverages information gathered over past visits to provide safe and personalized drug treatment regimes. We represent the varying severity of drug interactions as a weighted graph and employ a graph attention network to obtain drug interaction representations, enabling the system to learn safe drug pair combinations. Moreover, to avoid overly conservative recommendations, we design balanced loss function that weighs the benefits of pair of drugs against the severity of any potential drug interaction. This approach allows for more effective and personalized treatment recommendations while minimizing the risk of adverse drug interactions. Additionally, since clinicians often titrate treatment regimes for patients based on their past lab test responses and medication dosages, we incorporate such trend information and adapt the vision transformer (ViT) to learn an effective patient representation.
Our contributions can be summarized as follows: (1) We design novel deep learning system that combines knowledge from patient information over multiple visits and severity-based drug interaction database to provide personalized, safe, and accurate fine-grained medication recommendation, (2) We propose to extract and model trend information from the medication dosage titrations and lab test responses over multiple visits to obtain effective patient representation. This enables the system to adjust the treatment regime as the patient condition changes. (3) We design a balanced DDI loss function that weighs the benefits of a pair of drugs against the severity of any potential drug interaction. (4) We provide comprehensive quantitative and qualitative evaluations on benchmark medical dataset MIMIC-IV (10) and proprietary outpatient dataset to demonstrate the capability and effectiveness of our proposed approach in providing fine-grained medication recommendations while considering drug interaction severity and patient history.
2 Related Work
Early works in medication recommendation focus learning collection of rules from EHR. Solt and Tikk [77 extract rules from discharge summaries, while Lakkaraju et al. [I]] use Markov Decision Processes to learn the mapping between the patient characteristics and treatments. However, this approach may introduce confficting rules, and is difficult to generalize and scale. Subsequent works employ recurrent neural networks model sequential dependency in patient's past visits to improve the performance of medication recommendation [2]. However, they do not consider drug interactions, which are crucial minimize adverse drug reactions.
LEAP 27 incorporates an external drug-drug interaction (DDI) database and uses a recurrent decoder to model the drug-diseass relationship in the current visit for recommending set of medications. GameNet [16] uses dynamic memory and Graph Convolutional networks (GCN) to personalize the medication recommendations based on patients' longitudinal visit history and drug interactions. CompNet (21 is another GCN based recommender system that models relation among patient's 's past visits well as the drug interactions by combining reinforcement learning with relational GCN.
PREMIER introduces a two-stage recommender system that employs dual iiiention-basee re- current neural networks to model patient visits and adapts graph attention networks to model drug co-occurrences and drug interactions. SafeDrug 25 uses RNN based patient visit representation and incorporates drug molecular structure information to enhance the safety of the recommended drugs. They introduce a threshold during training to penalize the recommended set of medications the total drug interaction in the set is above the threshold. MICRON (24) uses recurrent residual networks to capture the medication changes over the visits, and incorporate drug interaction information from an external database in the design of their DDI loss function.
COGNet 22 introduces a copy module, which generates the probability of a medication being repeated from past visits. They model the drug interaction information with the help of GCN and a DDI loss function. MoleRee [26] introduces hierarchical architecture to model the association between drug substructures at the molecular level and the target disease to provide personalized medication recommendation. [18] proposes a causal inference based medication recommendation model. They model patient visit information causal graphs and DDI as propositional satisfiability

---

yT
Information
Frequency based Drug Co- occurrence Graph Attenticn
Severity based Drug
Representation
Attention Based Agpregation
Interaction
n,
Graph Allention
Representation
Transformer Enzoder
Trar stomee Encoder
Transformer Encoder
Embedding Layer
Embedding Layer
Embedding Layer
Trend Extraction
Trend Extraction
by
Figure I: Overview of REFINE.
problem. However, they use additional information such as patient symptoms which available in our datasets, making a direct comparison difficult.
Our approach differs from existing works in that provide fine ine-grained medication recommendation by explicitly modeling drug names, and the trend information the medication dosages as well as the lab test responses gathered over multiple visits. We also ensure the safety of the recommendations by modeling the severity of drug interactions to reduce the risk harmful combinations.
Methodology
Figure[ssovee the framework of the proposed system REFINE for REcommendation of FINE-genn grained medication. The input a list of patient visits. The 1th visit is represented as æ; [d., L, m.] where d; is multi-hot vector of diagnosis, is vector of lab tests and responses, m. is the vector of medications and dosages, and E [1. 7). All continuous values are normalized using min-max normalization (9). The goal is to predict set medications yr for the T visit, taking into account the patient history, the trend in the medication dosages and lab test responses, well the severity of drug interactions.
3.1 Trend Information Extraction
We observe that the treatment regimes for patients with the same disease vary depending on whether their conditions are well managed. This is typically reflected in the fluctuations in the lab test responses over the various visits. Further, clinicians often titrate the dosage of first-line medications before introducing additional medications achieve the optimal treatment outcome. As such, we extract trend information from medication dosages and lab test responses over the past visits in the form of slope and variance from [15].
Let var and slope?" be the vectors of dosage variance and rate of dosage change for the medications
across visits to respectively. The dosage variance and rate of dosage change for the 4th medication can be computed as follows:
var." ParT [k] Σj= (m, [k] 14"" ((]((() [A])2
(i (1-1)
slope," = Σ ビ==1 (1j T.)(mm 14." kk))
(2)
Σj= (tg -7,)²
3

---

41
1 111-11
h
Encodar
Encoder
Encodar
Transformer
Encoder
Encoder
Encoder
Embedding Layer Dlagnosis
Embedding Layer
Embedding
Layer
Trend
Trend
Codes
Extraction
72
Extraction Medicine
Lab Test
m7
W2
Responses
Figure 2: Patient representation obtained from transformer encoders.
where my(k) is the dosage of the h medication at the jth visit, μ4 [k] is the mean of the dosages of the hthh medication across visits to i, Lj is the interval (in days) between the 1s visit and the jth visit, is the average ty for E i]. The variance var, and slope slope, for the lab test responses are obtained in the similar manner.
We stack the variance var." and slope slope, and medication dosages m; to obtain a 2D array 33x Nr, where Nm is the total number of medications. We flatten the 2D array into ID array sequence, similar to the approach used Vision Transformer (ViT) (7]. To do this, concatenate the three values (medication dosage, slope, and variance) for every medication in visit to obtain ID array sequence 8g. We repeat the process for the lab test response information to obtain a array sequence
3.2 Patient Representation
To obtain a comprehensive representation of a patient's evolving health condition, it is crucial to capture and combine the sequential dependencies present in their EHR data. Specifically, utilize three separate transformers 7 20 to model the sequential dependencies in the patient's 's diagnosis, multiple visits. These transformer modules be used individually or in combination to derive a patient representation even when some information sources missing from the EHR data. The embeddings df rf and se for diagnosis, lab test response, and medication dosage respectively are passed to their respective transformers to generate the patient representation dr shown in Figure
lab test response, and medication information
Each transformer is composed of multiple layers of encoders, and each encoder has multi-head self-attention block followed by nosition-wise feed-forward network. For the 7th visit, the encoder the first layer of the transformer takes as input the concatenation of the respective input embeddings from visits I to i. The input to the subsequent encoders is the concatenation of the outputs from the encoder of the previous layer. This helps to preserve and process the information from the patient's visit history. Residual connections
employed around self-attention mechanism to facilitate the propagation lower layer features to higher layers. To stabilize and accelerate neural network training, apply layer normalization after the multi-head self-attention block and the position- wise ferward network. We also apply dropout to avoid over-fitting. The outputs of the transformers for the tth visit are h h;, and h for diagnosis, lab test response, and medication dosage respectively.
Since our goal is to predict the set of medications for the current visit T, we fuse the encoded sequential representation for the diagnosis lab test response up to the current visit, and the encoded representation for the medication dosage information up to the previous visit to obtain the

---

Ur
Sigmold
GATvZ
GATUZ
73
Layer
Tkk
lied
Hesd
76
Ze
Based
ED
Asprevation
47
Patient Representation
Figure Details modeling drug information from the EHR as well as the drug interaction database.
final patient representation qr follows:
qr
ho + 1T + h
(3)
3.3 Drug Information Representation
We observe that clinicians take into account the severity levels of interacting drug pairs and the severity of drug interactions can vary significantly. This information crucial when prescribing medications to ensure patient safety. In addition, the frequency of co-occurrence of drug pairs observed in the EHR can provide valuable insights into commonly or rarely prescribed combinations, further guiding the decision-making process.
We represent drug co-occurrence information from the EHR and drug interaction from the DDI database DDInter (23] as two separate graphs GC = (V, EC) and GDD = (V, ED) respectively. Each node n, depicts drug i. The weighted edges in EC and ED depicts the co-occurrence frequency and interaction severity between drug pairs, respectively. For co-occurrence, a weighted edge (n2; nzj, w E E gives the co-occurrence of drug and drug j with frequency of wff The co-occurrence frequency is calculated by counting the number of occurrences of a drug pair in the prescribed medication sets in the EHR. These values are normalized range between and 1.
For drug interactions, a weighted edge (n,, n, wP) E ED gives the interaction between drug i and drug with severity of wf.- The severity information is given as Major, Moderate, Minor, or Unknown/No interaction in the DDInter database. this work, we represent these severity levels numerically as I, 0.66, 0.33, and O, respectively.
We adapt GATv2 [5] to learn node representations from the weighted drug interaction graph GD GATv2 has two lavers with attention heads in the first layer, and attention head in the second layer (see Figure 3p. For the first layer, the attention weight between nodes n2 and n, at the 6th attention head is calculated as follows:
wht X exp(d/LeakyReLU(E" (n, (mxl))) 3k En,es, w x exp(a' Lepla'LeakyReLL(E"" [n, [n.))
(4)
where S, is the set of drugs that interact with drug j. a' is the transpose of the weight vector of single layer feed-forward neural network, E²" the embedding matrix for the 6th attention head
with E² = E E 5 w. D is the edge weight depicting the severity of interaction between drugs
j and k and denotes the concatenation operation. The output from the first layer for node n, is given by:
of =1iã_0
Σ MNEES
8 ER
T2k
(5)
nos
5

---

where a is the sigmoid function. With this, the output from the second layer for node n, is given by:
n =0=0
Σ nREE,
Ey of
(6)
where E is the embedding matrix for the second layer, and 65k is obtained by applying Equation on the output of the first layer for nodes j and & with w updated to the average of 82 for - S
We obtain the drug interaction representation ZD by stacking u/, the total number of drugs. Similarly, we can obtain drug co-occurrence representation Z by applying another GATv2 on the drug co-occurrence graph G and stacking the node representation .j.j E f1, The final drug information representation is given by:
{1, Nm and Nm is
Z = Zc + w D
where w is a parameter that controls the relative importance of the two representations.
The final output vector yr is obtained by applying attention-based aggregation the patient representation and the weighted drug information representation as follows:
yr (W (ar + 22-)) X))
where À softmax( transpose(2) 9r) and W is the gradient matrix of the transformation function in the linear layer.
We consider medication is recommended if yr [k] 0.5, k E (1,2,... Nm J. To understand the factors influencing the model's recommendations, Appendix shows how we can derive the contributions of the different information sources.
3.4 Training Objective
We formulate the recommendation task as a multi-label prediction task and employ the widely used binary cross entropy loss Lice and hinge loss Luinge [16, 3]. To capture the trade-off between the benefits and potential interactions of drug pair, we propose a balanced drug interaction loss function
Lidi defined as follows:
Ludi ΣΣΣ
Bww ()) yolb [k]
where w and C.C. depict the severity of drug interaction and the frequency of co-oceurrence obtained from the graphs GD and GC respectively, 3 is a controllable factor which provides a balance between drug interaction and drug co-occurrence information.
The final objective function is given by:
Lival = * Live + 72 * Lhinge + (1 71 - -72)= Lodi
(10)
where "/ and 71 are hyperparameters.
Performance Study
We implement REFINE in PyTorch and carry out the training on two NVIDIA Titan RTX GPU. We use two datasets, MIMIC-IV [10] and PRIVATE, in our experiments. MIMIC-IV is publicly available inpatient dataset consisting of 299,712 patient (mostly ICU patients) data collected between 2008 and 2019, whereas PRIVATE is proprietary outpatient dataset from 6 primary clinics over a span of ten years. Table [ gives the statistics. Patients with fewer than two visits are filtered out (see details in Appendix B).
We evaluate the accuracy as well as the level of drug interactions the recommended medication set. For accuracy, we use the metrics precision-recall area under the curve (AUC), Fl, and Jaccard

---

Table 1: Characteristics of datasets.
Attribute
MIMIC-IV
PRIVATE
Number of patients
61310
85039
Number diagnosis
2000
Number of lab tests
573
18
Number of medications
735
50
Avg number visits per patient
4.0
Avg number of diagnosis per visit
12.5
1.8
Avg number of lab tests per visit
35.6
3.6
Avg number medications per visit
8.9
4.1
Table 2: Results of comparative study.
MIMIC-IV
PRIVATE
Methods
AUC
wDDI
AUC
FI
WDDI
LR
0.632
0.006
0.526 + 0.004
0.055 0.0009
0.639 = 0.007
0.561 0.002
0.146 + 0.0004
RF
0.635 0.000
0.531 1 0.003
0.053 0.0005
0.642 0.003
0.565 0.005
0,140 1 0.0003
BART
0.637 0.002
0.540 + 0.002
0.056 = 0.0006
0.646 = 0.004
0.571 = 0.004
0,142 + 0.0005
LEAP
0.625 + 0.003
0.514 + 0.005
0.047 = 0.0003
0.633 = 0.005
0.558 + 0.007
0,117 + 0.0001
DMNC
0.633 + 0.006
0.528 + 0.002
0.056
0.0002
0.640 + 0.007
0.566
0.002
0.158 + 0.0005
GameNet
0.641 0.000
1 0.005
0.033
0.0005
0.647 = 0.001
0.575 0.004
1 0,0003
CompNet
0.638 0.002
0.546 1 0.006
0.050
0.0002
0.645 0.005
0.582 0.001
0.134 1 0.0005
PREMIER
0.655 4 0.001
0.565
1 0.002
0.047 = 0.0001
0.689 = 0.001
0.607 = 0.003
0,122 + 0.0001
MICRON
0.658 + 0.003
0.567 1 0.006
0.047 = 0.0006
0.662 = 0.002
0.597 2 0.006
0,120 + 0.0001
SafeDrug
0.652 + 0.004
0.564 + 0.002
0.045 = 0.0001
0.671 = 0.003
0.608 - 0.006
0.113 + 0.0002
COGNet
0.661 0.002
0.573
+ 0.001
0.054 0.0006
0.682 0.005
0.616 0.002
0.129 + 0.0004
MoleRec
0.000
0.579 0.003
0.044 0.0001
0.688 0.002
0.623 0.006
0,112 1 0.0001
REFINE
0.708 = 0.001
0.635 0.003
0,043 1 0,0001
0.729 0,004
0.656 + 0.003
0,111 0.0002
indicates that the result statistically significant when compared to the second best with p-value 0.05.
For the level of drug interactions, we introduce a weighted drug interaction score (wDDI) defined as follows:
similarity 2 25
1 WDDI
Σ
2
Σ JEM, AYj.M,
Σ
D jk
(11)
T
M.
1=1
where M, is the set of recommended medications at the 7th visit for patient, [M,] is the cardinality of Mr, witk is the severity of interaction between drug j and drug h obtained from the graph GD. The values the various metrics are averaged over all the patients in the test set.
We split the datasets into training, validation and test sets in the ratio 4:1:1, and report the performance on the test set. Appendix provides details of the training and hyperparameter settings. Sensitivity experiments and additional comparative and ablation studies can be found in Appendix D.
4.1 Comparative Analysis
We compare the performance REFINE with baseline methods such as Logistic Regression (LR) 13
Random Forest (RF) 4. BART 6 LEAP (27). DMNC [12]. GameNet [16), CompNet [21. PRE-
MIER (2). MICRON (24), SafeDrug (55), COGNet (22), and MoleRec (66). We perform 10 rounds of bootstrapping sampling and report the mean and standard deviation.
As can be seen from Table REFINE demonstrates superior performance compared to the baseline methods, with statistically significant differences (p-values < 0.05) based on one-way ANOVA test 8 The improved performance of REFINE can be attributed to its ability to account for medica- tion dosage and lab test response trends across patient visits. Further, REFINE also outperforms the baselines in terms of wDDI, and is even lower than the wDDI present in MIMIC-IV (0.0448) and PRIVATE (0. 1159) datasets. This suggests that REFINE effectively reduce the potential risk of adverse drug interactions, which is a critical aspect of ensuring patient safety in clinical practice.
Table shows the performance on a subset of patient instances where at least one change of medication occurs between consecutive visits. As more than 90% of the instances MIMIC-IV already involve medication changes, we consider the performance reported in Table 2 to be representative of such
7

---

Table 3: Results for instances with medication change.
Methods
PRIVATE
AUC
FT
Jaccard
WDDI
LR
0.608
0.006
0.536
0.004
0.379
0.008
0.1239
0.0006
RF
0.607
0.003
0.539
0.005
0.381
0.005
0.1234
0.0002
BART
0.609 = 0.002
0.541
0.003
0.385 = 0.004
0.1236
0.0004
LEAP
0.602 + 0.003
0.527
0.005
0.374 1 0.006
0.1111
0.0002
DMNC
0.606 + 0.006
0.532
0.002
0.387 = 0.005
0.1243
0.0003
GemeNet
0.619 0.003
0.545
0.005
0.392 1 0.003
0.1124
0.0006
CompNet
0.614 1 0.002
0.552
0.006
0,401 1 0.008
0.1138
0.0003
PREMIER
0.638 + 0.001
0.576
0.002
0.419 + 0.005
0.1119
0.0001
MICRON
0.647 1 0.003
0.581
0.006
0.422 = 0.002
0.1114
0.0004
SafeDrug
0.648 = 0.004
0.591
0.002
0,405 = 0.006
0.1107
0.0001
COGNet
0.665 0.007
0.605
0.002
0.437 1 0.005
0.1129
0.0007
MoleRee
0.667 0.003
0.6T0
0.001
0.442 = 0.003
0.1T06
0.0002
REFINE
0.707 0.002
0.645 + 0.001
0.494 0.003*
0.1097
0.0001
indicates that the result is statistically significant when compared to the second best with p-value < 0.05.
Table 4: Average number of recommended, extra, and missed medications.
MIMIC-IV
PRIVATE
Methods
# Average
Extra
# Missed
# Average
# Extra
# Missed
PREMIER
9.85
4.60
3.47
5.13
2.3
1.35
MICRON
750
2.90
4.12
3.08
0.91
2.01
SafeDrug
7.01
2.57
4.29
2.93
0.77
2.02
COGNet
10.31
4.86
3.27
5.27
2.36
1.27
MoleRec
10.27
4.77
3.22
5.22
2.29
1.25
REFINE
9.48
3.70
2.94
4.91
1.93
1.20
cases. Therefore, we focus our analysis on the PRIVATE dataset, where around 50% of the instances involve medication changes between visits. We observe drop in performance for all methods. This is expected as a change in treatment regime often implies a different patient response, making accurate predictions more challenging. Nevertheless, REFINE still outperforms the baseline methods in this challenging scenario. This indicates that even when faced with more complex situations involving medication changes, REFINE'S integrated approach provides valuable insights and maintains higher level of performance compared to other methods.
We also analyze the average number of recommended medications, average number of extra medica- tions recommended, and average number of missed medications per visit for REFINE and the best performing baselines, shown in Table The average number of medications in the ground truth for the test set is 8.72 and 4.18 for MIMIC-IV and PRIVATE dataset respectively. We see that COGNet, PREMIER, and MoleRec generally recommend more medications whereas SafeDrug, MICRON tend to recommend fewer medications; whereas the average number of medications recommended by REFINE is closely aligned with the ground truth for both datasets. We find that COGNet has the highest average of extra medications in the recommended set. In contrast, REFINE recommends relatively lower extra medications. This can be attributed the effective learning of patient condition from lab test and medication dosage trends. For the average number of missed medications, SafeDrug has the worst performance. On the contrary, REFINE misses the least number of medications from the ground truth set. This indicates that not weighing the benefits and potential interactions of drug pairs together may lead the system omit medications necessary for managing a patient's condition.
4.2 Ablation Study
We conduct ablation study to evaluate the effect of trend information and drug interaction severity on the performance of REFINE. We have four variants: (a) REFINE w/o med trend excludes variance and slope of the medication dosages, (b) REFINE w/o lab trend omits the variance and slope of the lab test responses, (c) REFINE w/o any trends does not incorporate any trend information, and (d) REFINE w/o severity does not incorporate severity- drug interaction.
Table Sshoss the results. We observe that REFINE w/o any trend has the lowest accuracy, indicating that trend information is crucial for making accurate fine-grained medication recommendations. There a significant drop performance for REFINE w/o severity, highlighting the importance of considering drug interaction severity when recommending medications.
8

---

Table S: Results for ablation study.
MIMIC-IV
PRIVATE
Methods
AUC
F1
wDDI
ATC
F1
wDDI
w/o med trend
0,701 = 0.001
0,618 = 0.003
0.044 = 0.0001
0.718 + 0.003
0.645 = 0.004
0.112 = 0.000
w/o lab trend
0.695 0.002
0.613 + 0.001
0.04 0.0003
0.714 4 0.004
0.643 0.001
0.112 0.0005
w/o any trends
0.682 1 0.002
0.602 1 0.002
0.045 = 0.0002
0,703 1 0.002
0.630 = 0.001
0.112 1 0.0004
w/o severity
0.694 = 0.002
0.617 = 0.001
0.046 = 0.0005
0.713 : 0.004
0.639 = 0.002
0.115 = 0.0003
REFINE
0.708 0.001
0.635 0,003*
0.043
0.00011
0.729 + 0,004
0.656 0.003
0.111 + 0.0002
indicates that the result statistically significant when compared to the second best with p-value 0.05.
5
Case Studies
Finally, we present case studies to highlight REFINE's ability to provide accurate medication recommendations which ultimately contributes to better patient care. Figure 4[a) shows sample patient from the PRIVATE dataset who has been diagnosed with Type 2 Diabetes Mellitus and Hyperlipidemia, and the HbAlc ranges from 7.4 to 9.8. In the second visit, we observe that diabetes medication Glipizide is added to the Metformin treatment to manage the increased HbA lc value. REFINE successfully recommends the addition of Glipizide, while SafeDrug and COGNet do not. This can be attribbuedd REFINE'S ability to learn lab test trends and incorporate balanced drug interaction information. REFINE identifies the increase in HbAle value for the current visit as the influencing factor for Glipizide, which is consistent with clinical knowledge. Further, the decrease in HbAlc in the third visit indicates that certain medication combinations with some risk of interaction may indeed be necessary to effectively manage a patient's 's condition.
Figure b) shows another patient from the PRIVATE dataset who has been diagnosed with Diabetes Mellitus, Hypertension, and Hyperlipidemia in visit followed by chronic kidney disease in visit 2. We see that the medication Simvastatin is replaced by Atorvastatin in the second visit as it is preferred over other hyperlipidemia medications for patients with chronic kidney disease REFINE closely follows the prescribed medication set and accurately recommends the medication change, indicating REFINE's ability to model co-morbidities. In contrast, SafeDrug and COGNet are unable to effectively capture this aspect.
Figure (()) shows patient from the MIMIC-IV dataset who has been diagnosed with multiple diseases in visit 1, and is diagnosed with nontoxic multinodular goiter, and nausea with vomiting in visit 2. We observe that REFINE is able to recommend medications that matches the prescribed medications more closely compared to COGNet and SafeDrug. A closer inspection reveals that SafeDrug tends to under-recommend avoid the interacting medication pairs, whereas COGNet tends to over-recommend many drugs outside the prescribed set.
6 Conclusion and Discussion
We have described unique fine-grained medication recommender system that offers personalized medication suggestions while considering the severity of potential drug interactions and explicitly modeling the trends in medication dosage titrations and lab test responses over visits. To the best of our knowledge, REFINE is the only system that factors in these trends while also assessing the varying severity of drug interactions. Experiments on real-workl datasets and case studies show the effectiveness of REFINE in providing personalized, accurate, and safe medication recommendation.
The current system can be extended to include additional rich data from EHR such clinician notes to further refine the system's is recommendations. While we have shown that the severity of drug interactions a crucial factor, the dosage strength of the drugs could also have significant impact. A lower dosage of an interacting drug pair may sometimes be clinically acceptable and beneficial. Future work could explore how dosage strength influences the acceptability of interacting drug pairs.
Acknowledgements
This research/project is supported by the National Research Foundation, Singapore under its AI Singapore Programme (AISG Award No: AISG-GC-2001-000--2
hhaps///tiyyall.oo//ddddyypp

---

Visit 1
Visit2
Visit
Diabetes mellitus, Hyperlipidemia
Diagmosis
Diabetes mellitus, Hyperlipidemia
Diabetes mellitus, Hyperlipidemis
ALT tast, Chalasteral HDL, Cholestaral
Cholesterol HDL, Cholesterol LDL, Chelesteral Total, HbA1c 1 Triglycerides
HbAIc
LUL, Cholesterol Total, IlbAlc wr, Triglycaridas
Lab Tests
Prescribed Medications
Metformin, , Simvastatin
Metformin, Glipizida, Simvastatin
Matformin v Glipizida, Simvastatin
SafeDrug
Metformin,
Metformin, Atorvastatin
Melformin Sinnvastatin
Recommended Medications
COGNet
Metformin, Simvestatin
Metformin, Sinwastatin, Atorvastatin
Metformin Sinvastatiin
REFINE Matformin, , Simvastatin
Metformin, Gllpizide, Simvastatin
Metformin, Glipizide, Simvastatin
[Recommended Medications, Influencing
[Metformin, Diabetes
[Metformin, Diabetes mellitus), [Glipizide, HbA1: f [Slmwastatin, Hyperllpidemia]
[Metformin, HbAlc v,l, [Glipizide, HbAlc V [Simvastatin, Cholesterol IDI Calculated]
mellitus], [Simvastatin,
Factors]
Hyperllpidemla]
(a) Patient with fluctuating HbAlc values.
Visit 1
Visit 2
Diabetes mellitus, Hypertension, Hyparlipidamia, Diahatic chronic kidnay disease
Diabetes mellitus, Hypertension, Hyperlipidemia
Diagnosis
ALT test, Chloride serum, Cholesterol HDL, Cholesterol LDL, Cholesterol Total, Creatinine, Glucase (fasting) plasma, HbAlc, Potassium, Sodium, Triglycerides
HbA1c +
Lab Tests
Prescribed Medications
Metformin Melpormin,,ilppzide,, Simvastatin, Lisinopril
Metformin, Glipizide, Atorvastatin, Lisinopril
SafeDrug
Metformin, Simwastatin, Atenolol
Matformin, Simvastatin, Atenolol, Lisinopril
Recommended
COGNet
Metformin, Simvastatin, Enalapril
Metformin Simvastatin, Atenolol, Lisinopril
Medications
REFINE
Metformin, Glipizide, Sinvvastttin, Atenolol
Metformin, Glipizide, Atorvastatin, Lisinopril
[Metformin, Diabetes mellitus), [Gliplaide,
[Metformin, Diabetes mellitus), [Glipizide,
[Recommended Medications, Influencing Factors]
HbA1s), [Simvastatin, Hyperlipidemia) [Atenolol, Hypertension]
Diabetes mellitus), [Atorvastatin, Hyperlipidemia], [Uisnnpprl, Hypertension]
(b) Patient with changes in co-morbidities.
Visit
Visit 2
Morbid (severe) obesity, Obstructive sleep apnea, Prediabetes, Postprocedural hypothyroidism, Vitamin deficlency, Iron deficiency anemia, Hyperlipidemia, Hyporuricemia, Localized edema,, Nausea
Nontoxic multinodular golter, Nausea with vomiting
Diagnosis
Lab Tests
Hematocrit
Parathyroid Hormone, Calcium
Heparin, Calcium carbonate,
Heparin, Lactate, Acetaminophen, Cefazolin, Levothyroxnne, Famotidine
Prescribed Medications
Hydromorphone, Calcitriol, Levothyroxdne
I, Scopolamine
Heparin, Lactate, Acetaminophen, Levothyroxine, Simvastatin
lleparin, Levothyroxine, Scopolamine,
SafeDrug
Lactate
Heparin, Calcium carbonate, Hydrooorphhnee Levothyroxine,
Lactate, lbuprofen, Cefazolin, Levothyroxdne, Famotidine, Simvastatin
Recommended
COGNet
Medications
Tamotidine, Lactate
Heparin, Calcium carbonate, Hydromorphone, Lewothyroxine, Scopolamine
Heparin, Lactate, Aceteminophen, Cefazolin, Levothyraxine, Famotidine, Simvastatin
REFINE
[Heparin, Postprocedural hypothyroidism), [Lactate,
[Heparin, Postprocedural hypothyyridism)
Nausea], [Acetaminophen, Postprocedural hypothyroidism), [Cefazolin, Postprocedural hypothyroldismj, [I eunthyrnxina, Postproreduural hypothyroldlam), [Famotidine, Nausea), [Sinvastatin, Hyperlipidemia)
[Galcium carbonate, Calcium),
[Recommended Medications, Influencing Factors]
[Hydromorphone, Postorocedural
hypathyroidism), (1 suothyroxine, Nontoxl
multinodular golter], [Scopolamine, Nausea with vorniting]
(c) Patient from MIMIC-IV with multiple diagnosis.
Figure 4: Medications recommendeded sample patients. Red color indicates interacting medications. Symbols 1 and J. depict an increase and decrease in the value of dosage or lab test response. The top influencing factor for each recommended medication provide insights into why REFINE recommends it.
10

---

References
[1] Jacek M Bajor and Thomas A Lasko. Predicting medications from diagnostic codes with recurrent neural networks. In International conference on learning representations, 2017.
[2] Suman Bhoi, Mong Li Lee. Wynne Hsu, Andrew Fang, and Ngiap Chuan Tan. Personalizing medication recommendation with graph-based based approach. ACM Transactions on Information Systems, 1(1), 2021.
[3] Suman Bhoi, Mong Li Lee, Wynne Hsu, Hao Sen Andrew Fang. and Ngiap Chuan Tan. Chronic disease management with personalized lab test response prediction. In Proceedings of the Thirty- First International Joint Conference on Artificial Intelligence, IJCAI-22, pages 5038-5044 7 2022.
[4] Leo Breiman. Random forests. Machine learning, 45:5-32, 2001.
[5] Shaked Brody, Uri Alon, and Eran Yahav. How attentive are graph attention networks? In International Conference on Learning Representations, 2022.
[6] Hugh A CHIPMAN, Edward GEORGE, and Robert E MCCULLOCH. Bart: Bayesian additive regression trees. The Annals of Applied Statistics, 4(1 4(1):266-298, 2010.
[7] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
[8] Ronald Aylmer Fisher. Statistical methods for research workers. In Breakthroughs in statistics, pages 66-70. Springer, 1992.
(9] Jiawei Han, Micheline Kamber, and Jian Pei. Data mining concepts and techniques third edition. The Morgan Kaufmann Series in Data Management Systems, 5(4):83-124, 2011.
[10] Alistair Johnson, Lucas Bulgarelli, Tom Pollard, Steven Horng, Leo Anthony Celi, and Roger Mark. Mimic-iv. PhysioNet. Available online at: https:/physionee. org/onneet/mimiiii//l///scssssee August 23, 2021), 2020.
[11] Himabindu Lakkaraju and Cynthia Rudin. Learning Cost-Effective and Interpretable Treatment Regimes. In Aarti Singh and Jerry Zhu, editors, AISTATS, volume 54 of Proceedings of Machine Learning Research, pages 166-175. PMLR, 20-22 Apr 2017.
[12] Hung Le, Truyen Tran, and Svetha Venkatesh. Dual memory neural computer for asynchronous two-view sequential learning. In SIGKDD, pages 1637-1645. ACM, 2018.
[13] Oscar Luaces, Jorge Diez, José Barranquero, Juan José del Coz, and Antonio Bahamonde. Binary relevance efficacy for multilabel classification. Progress in Artificial Intelligence. 1(4):303-313, 2012.
[14] Fenglong Ma, Quanzeng You, Houping Xiao, Radha Chitta, Jing Zhou, and Jing Gao. Kame: Knowledge-baase based attention model for diagnosis prediction in healtheare. In CIKM, pages 743-752, 2018.
[15] Roxy Peck, Chris Olsen, and Jay L Devore. Introduction to statistics and data analysis. Cengage Learning, 2015.
[16] Junyuan Shang, Cao Xiao, Tengfei Ma, Hongyan Li, and Jimeng Sun. Gamenet: Graph augmented memory networks for recommending medication combination. In AAAI, volume 33, pages 1126-1133, 2019.
[17] Illés Solt and Domonkos Tikk. Yet another rule-based approach for extracting medication information from discharge summaries. In i2h2 workshop. 2009.
[18] Hongda Sun, Shufang Xie, Shuqi Li, Yuhan Chen, Ji-Rong Wen, and Rui Yan. Debiased, longitudinal and coordinated drug recommendation through multi-visit clinic records. Advances in Neural Information Processing Systems, 35:27837-27849, 2022.

---

[19] Qingxiong Tan, Andy Jinhua Ma, et al. Ua-crnn: Uncertainty-aware convolutional recurrent neural network for mortality risk prediction. In CIKM, pages 109-118, 2019.
[20] Ashish Vaswani, Noam Shazeer, al. Attention all you need. In NeurlPS, pages 6000-6010,
2017.
[21] Shanshan Wang. Pengjie Ren, Zhumin Chen, Zhaochun Ren, Jun Ma, and Maarten de Ri- jke. Order-free Medicine Combination Prediction With Graph Convolutional Reinforcement Learning. In CIKM 2019, 2019.
[22] Rui Wu, Zhaopeng Qiu, Jiacheng Jiang, Guilin Qi, and Xian Wu. Conditional generation net for medication recommendation. In Proceedings of the ACM Web Conference 2022, pages 935-945,
2022.
[23] Guoli Xiong, Zhijiang Yang, Jiacai Yi, Ningning Wang. Lei Wang, Huimin Zhu, Chengkun Wu, Aiping Lu, Xiang Chen, Shao Liu, et al. Ddinter: an online database towards improving clinical decision-makinn and patient safety. Nucleic acids research,
interaction
10(DI):D1200-DI1 2022.
[24] Chaoqi Yang. Cao Xiao, Lucas Glass, and Jimeng Sun. Change matters: Medication change prediction with recurrent residual networks. In Proceedings of the Thirtieth International Joint Conference Artificial Intelligence, IJCAI-21, pages 3728 3734, 2021.
[25] Chaoqi Yang, Cao Xiao, Fenglong Ma, Lucas Glass, and Jimeng Sun. Safedrug: Dual molecular graph encoders for recommending effective and safe drug combinations. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, pages 3735-3741,
8 2021.
[26] Nianzu Yang, Kaipeng Zeng, Qitian Wu, and Junchi Yan. Molerec: Combinatorial drug recommendation with substructure-awaat molecular representation learning. In Proceedings of the ACM Web Conference 2023, pages 4075-4085, 2023.
[27] Yutao Zhang. Robert Chen, Jie Tang, Walter F Stewart, and Jimeng Sun. Leap: learning to prescribe effective and safe treatment combinations for multimorbidity. In SIGKDD, pages 1315-1324. ACM. 2017.
12


Reviews:
[{"review_id": "BkZvjPZrAV", "reviewer": "Reviewer_nz6X", "summary": "This manuscript proposes a new system for personalized medication recommendation.  The method relies on the history of patient visits: diagnoses, lab responses and medication dosages across time. For obtaining safe recommendations, it uses severity level information of drug interactions. An important aspect of the model is the extraction of trend information, measuring how much medication dosages and lab responses change across patient visits. The approach relies on deep learning for obtaining drugs’ and patients’ representations that are then combined. More specifically, it uses transformers for learning a patient’s representation, and graph attention networks for learning drug interaction representations. \n\nOne of the main contributions of the paper is modelling drug interaction severity, and providing fine-grained personalized recommendations, that is, personalized recommendations at the drug level. It combines existing approaches and adapts graph attention networks for weighted graphs containing drug interaction severity information. In addition, the authors designed a balanced drug interaction loss function that weighs the benefits of a pair of drugs against the severity of any potential drug interaction.", "questions": "1. Previous approaches argue that they do class-level predictions for making the data compatible with MIMIC. Reference 16 uses the same version of the database as in this paper (MIMIC-IV). I am not used to this dataset. Could the authors explain why did they manage to make drug-level predictions using MIMIC database whereas the other methods did not? Are the NDC codes available for most of the drugs? \n\n2. For each patient visit, the model receives as input a multi-hot encoding vector of diagnoses, lab test response vector and medication dosage vector. Could the authors answer the questions below? \n\n    - (2.a) I am assuming that patients may have different types of exams and take different medications. I am also assuming that all patients share the same transformers. How is the input represented so that it is comparable across different patients? Could the authors clarify this in the paper?  \n\n    - (2.b) Also, could the authors clarify what they mean by “for the lab test response, only the first entry of  a lab test for a given visit is considered” in Section F Data Pre-Processing and Dataset Distribution, in Appendix. Is only the first exam result considered for a visit? In the main paper, the authors mention that each visit has a list o lab responses, so I was confused when I read the appendix. What is each entry of the a lab test response? Do the entries have a particular order? I recommend adding more details about how lab responses are pre-processed and represented in the model. \n\n3. The input of GATv2 corresponds to initial node embeddings. How are they initialized? If they are random, what are the range of values and distribution used?  \n\n4. One of the datasets used by the model is private. I noticed in Table 1 that it is very different from the public dataset. Could the authors explain why? Are the public and private datasets focused on different types of patients/diseases? If the private dataset refers to a particular group of patient or type of disease, I would recommend the authors to include this information in the paper. \n\n5. In the comparative analysis, Section 4.1, the authors mention that their method have a lower wDDI than in the original datasets (MIMIC and PRIVATE). I was wondering if it is necessarily a good thing. Could it mean that the predictions are too conservative and avoiding drug combinations that could still be important for the patient?", "limitations": "The authors addressed some limitations of their work.\n\nAnother aspect that could be addressed is how safe it is to apply the proposed system in a real world scenario. Would a doctor trust the recommendations made by the system? What would be the main impacts of using this system? In which scenarios do the authors think it would be more useful?", "rating": 6, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "- The problem is difficult and relevant \n\n- The proposed approach is sound \n\n- The proposed method has a better performance than state-of-the art methods \n\n- The authors claim that REFINE is the first personalized medication recommendation systems to make predictions at the drug level \n\n- They show the importance of including the drug interaction severity information \n\n- The authors adapted attention weights for their problem \n\n- They designed a balanced drug interaction loss function that weighs the benefits of a pair of drugs against the severity of any potential drug interaction \n\n- The writing is clear.", "weaknesses": "**Major** \n\n- The paper did not provide the code used in the experiments. Notice, however, that the authors mentioned in the neurips form that they would make it available “soon”. \n\n- There are some aspects of the model that I did not fully understand. There are details missing about the dataset and how the information is represented. I will explain my concerns in the Questions section. \n\n- The paper relies on a private dataset containing patient data. I think it is important to indicate whether all ethics concerns were addressed.\n\n**Minor**\n\n- I suggest some improvements in the mathematical notation. In 3.3, node and node’s representation of a drug $i$ are denoted in the same way ($n_i$). Could the authors use different notation and clarify whether $n_i$ is a node embedding in Eq 4? \n\n- The authors use set notation {$1, N_m$} when they refer to intervals. For example, in lines 170, and 179, do the authors mean $[1, N_m]$ or {$1, 2, …, N_m$} instead of {$1, N_m$}? \n\n- Reference 4 refers to an arXiv version of the paper. The paper was published in ICLR 2022. I recommend also checking if references 22 and 23 were published \n\n- The venue where reference 5 was published is missing", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "\nWe would like to thank the reviewer for the thorough analysis and comments on our work. We have addressed the queries as follows:\n\n1) Existing works have focused on coarse-grained medication recommendations at the class level since making drug-level predictions introduces more complexity. In the MIMIC datasets, the medication names are noisy. However, NDC codes are provided for almost all drugs. This allows us to derive the corresponding medication names from the NDC codes using RxNorm mappings.\n\n2.a) Each patient is represented by fixed length vectors for diagnosis, lab test responses, medication dosages based on the respective vocabulary size in the dataset. Suppose there are two lab tests [i,j]  and three medications [a,b,c] in the dataset, then the lab test vector has 2 entries while the medication vector has 3 entries and the values in these vectors depict the respective lab test response or medication dosage.\nFor example, suppose a patient has undergone lab test i and is prescribed two medications (a, c), his lab test vector is  [0.8, 0] and medication vector is [0.3, 0, 0.4]. For another patient with lab test j and medication b, we will have a lab test vector of [0, 0.2] and a medication vector of [0, 0.6, 0]. \n\n2.b) In the dataset, some lab tests are repeated more than once in a visit, and we consider the initial lab test response as indicative of the effect of the treatment regime of the previous visit. Each position in the lab test response vector corresponds to a specific lab test, and each entry in the vector captures the results of the initial lab test during the visit.\n\n3) The embedding matrices are initialized using xavier uniform initialization with a gain of 1.41 as described in Understanding the difficulty of training deep feedforward neural networks - Glorot, X. & Bengio, Y. (2010).  $n_i$ is a one-hot vector that depicts the presence of the drug i.\n\n4) MIMIC dataset consist of data related to inpatient care, particularly ICU patients, whereas the Private dataset contains outpatient information with chronic diseases such as diabetes, and hypertension. We will add this information to the paper.\n\n5) Table 4 in the main paper shows that the average number of medications missed by REFINE is the lowest, indicating that the prediction by REFINE is not too conservative and has not avoided drug combinations that are important for the patient. \n\nAdditional Queries:\n\n6) The paper relies on a private dataset containing patient data. I think it is important to indicate whether all ethics concerns were addressed. \n\nWe have obtained IRB approval to use the dataset for this research, and no ethics regulations were violated.\n\n7) I suggest some improvements in the mathematical notation. In 3.3, node and node’s representation of a drug i are denoted in the same way ($n_i$). Could the authors use different notation and clarify whether ni is a node embedding in Eq 4?\n\n $n_i$ depicts a drug i representation and not the node embedding. Here, $n_i$ is a one hot vector which depicts the presence of a drug i. We will clarify this in the paper.\n\n8) The authors use set notation {1, $N_m$} when they refer to intervals. For example, in lines 170, and 179, do the authors mean [1, $N_m$] or {1, 2, … , $N_m$} instead of {1, $N_m$}?\n\nWe mean {1, 2, … , $N_m$} and have updated the paper accordingly.\n\n9) Reference 4 refers to an arXiv version of the paper. The paper was published in ICLR 2022. I recommend also checking if      references 22 and 23 were published\n\nWe have updated the paper accordingly.\n\n10) The venue where reference 5 was published is missing.\n\nWe have noted this and have updated the paper accordingly.\n\n11) Another aspect that could be addressed is how safe it is to apply the proposed system in a real world scenario. Would a doctor trust the recommendations made by the system? What would be the main impacts of using this system? In which scenarios do the authors think it would be more useful?\n\nWe believe that our proposed system can provide safe recommendations in the real-world scenario due to the use of a balanced drug interaction loss which helps ensures the safety and accuracy of the recommendations as shown in the experiments and case studies from real-world datasets. \n\nDuring our collaboration and interactions with the clinicians, we found that they were keen to use medication recommender systems provided the recommendations were at the drug level. This is in fact what motivated us to come up with a fine-grained medication recommendation system. Our proposed system provides contribution scores to identify factors influencing the recommendations as described in Appendix B and as demonstrated in the case studies (Section 5), which establishes trust among clinicians. \n\nConsidering a patient’s history along with keeping track of interacting drug pairs to prescribe a tailor-made treatment regime is a challenging task for clinicians. Hence, our proposed system provides decision support to clinicians to make accurate and safe recommendations. Moreover, such a system would help reduce the high workload on clinicians by helping them make faster and more precise decisions.\n\nWe believe that our proposed system will be more useful in providing personalized recommendations to help clinicians to design treatment regimens to better manage chronic diseases (diabetes, hypertension, etc.)."}, {"review_id": "RSyaOGerrq", "reviewer": "Reviewer_ebob", "summary": "This paper presents a medication recommendation system with 2 components: a GAT based medication interaction and a ViT-based patient embedding. The results on MIMIC and PRIVATE shows its superior performance.", "questions": "1: I really think you need to share the Jupyter Notebook (or codes) in whatever way to convince readers that the work is reproducible. It is very hard to implement simply based on the model description. \n2: How does the small improvement in AUC translate to clinical impact? You need to sell it to the readers. \n3: I encourage the authors to add some visualization figures. For example, how does the patient embedding look like, or how are the drug interations distributed?", "limitations": "N/A", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 4, "contribution": 3, "strengths": "1: I think this paper is well-presented. The structure is very clear and the writing is polished. \n2: The results are generalizable -- consistent performance can be observed from two datasets. \n3: The experiments are comprehensive. The qualitative study is also interesting.", "weaknesses": "1: Reproducibility: The codes/notebooks are not shared either through supplementary materials or anonymous github. The paper does not provide much detail about the implementation. \n2: The choice of baselines: For EHR dataset, it is well-known that tree-based methods (like Gradient Boosting Tree, Random Forest, etc) perform the best. There are also some causal inference tree models like Causal Forest and BART. It is strange to me that the authors include LR but neglect all tree models. \n3: Give that the proposed work is a concatenation of ViT and GAT, the level of novelty is questionable.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We would like to thank the reviewer for highlighting the strong points and shortcomings of our work. We have addressed some of the queries and have summarized them as follows:\n\n1) Given that the proposed work is a concatenation of ViT and GAT, the level of novelty is questionable.\n\nWe would like to emphasize that our paper introduces an innovative fine-grained medication recommendation system, addressing actual challenges and needs.\nThe main highlights of our work include:\n\nLearning patient condition progression representation:  Beyond the sequential dependencies modelled by existing techniques, we also analyze and model fluctuations in medication dosage titrations and lab test responses over the time between visits. This offers a robust representation of a patient's evolving condition.\n\nIncorporating drug interaction severity: Unlike current methods, we embed information regarding drug severity into our recommendations. Furthermore, we formulate a balanced DDI loss, accounting for both the level of drug severity and the frequency of co-occurrence within the EHR. This leads to recommendations more closely aligned with clinical practices.\n\n\n\n2)\tI really think you need to share the Jupyter Notebook (or codes) in whatever way to convince readers that the work is reproducible. It is very hard to implement simply based on the model description.\n\nWe will publish our code on Github upon acceptance of the paper. Currently, we have provided the data pre-processing and the training/optimization details in Appendix F and H respectively.\n\n3)\tThe choice of baselines: For EHR dataset, it is well-known that tree-based methods (like Gradient Boosting Tree, Random Forest, etc) perform the best. There are also some causal inference tree models like Causal Forest and BART. It is strange to me that the authors include LR but neglect all tree models.\n\nWe conducted additional experiments to compare the performance of tree-based methods (Random Forest) with REFINE. The table below shows substantial improvement achieved by REFINE across all metrics in both datasets. \n\n\n| Method                                          |   |   | MIMIC-IV |  |\n| -------------------------------------------- | ------------------------ | -----------| -----------| -----------|\n|  | AUC |\tF1|\tJaccard |\twDDI |\n| __Random Forest__\t                                |   0.635 ± 0.004\t                |      0.531 ± 0.003 | 0.406 ± 0.004 | 0.053 ± 0.0005 |\n| __REFINE__\t\t|  0.708 ± 0.001\t                |      0.635 ± 0.003 | 0.462 ± 0.003 | 0.043 ± 0.0001 |\n\n\n| Method                                          |   |   | PRIVATE|  |\n| -------------------------------------------- | ------------------------ | -----------| -----------| -----------|\n|  | AUC |\tF1|\tJaccard |\twDDI |\n| __Random Forest__\t                                |   0.642 ± 0.003\t                |      0.565 ± 0.005 | 0.411 ± 0.004 | 0.140 ± 0.0003 |\n| __REFINE__\t\t|  0.729 ± 0.004\t                |      0.656 ± 0.003 | 0.506 ± 0.002 | 0.111 ± 0.0002 |\n\n\n4)\tHow does the small improvement in AUC translate to clinical impact? You need to sell it to the readers.\n\nWe assess the performance of our model through the AUC for the precision-recall curve, where a higher value signifies fewer missed medications and a reduced number of extra recommended medications. In a perfect system, the AUC would reach 1, implying no missed or extra medications. In the case of MIMIC-IV with 10,218 patients and  40,872 visits (in the test set), an improvement of 0.047 in the AUC over COGNet can correspond to a substantial increase in correct medication recommendations across numerous patients. Such improvements not only translate into more accurate and personalized treatment but also contribute to overall enhancements in healthcare quality.\n\n5)\tI encourage the authors to add some visualization figures. For example, how does the patient embedding look like, or how are the drug interactions distributed?\n\nThe visualization of the distribution of the number of visits in both datasets is provided in Figure 4 in the Appendix. We have included the figures showing the distribution of drug interactions in both datasets in the pdf attached to the global response. \n"}, {"review_id": "wNbwg15AFR", "reviewer": "Reviewer_Eh21", "summary": "This paper proposes a new medication recommendation model that learns patient representations from diagnoses, lab tests, and medications. The new aspect of the paper is that it considers different severities of drug-drug interactions and can prevent overly conservative drug prescriptions.", "questions": "see the above.", "limitations": "NA", "rating": 5, "confidence": 5, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "1. The biggest strength of this paper is that it utilizes the DDInter databases into the drug recommendation tasks. As mentioned in the paper, the DDInter database has broken down the drug drug interactions into different severity levels. Previous DDI-aware drug recommendation models, such as SafeDrug, only considers the binary DDI existence and can provide overly conservative prescriptions. By considering the severity level, the proposed model can improve the performance by including some drug pairs that are beneficial and have low co-prescription severity.\n\n2. The paper is well written and the experiments are extensive. Figures in the paper are very informative.", "weaknesses": "1. The contribution of the paper is below the NeurIPS acceptance bar.\n2. Some statements are not well supported or overclaimed.\n    - In the conclusion, the paper states that the proposed model can offer personalized medication suggestions. It is not discussed in the main paper.\n    - In the conclusion, the paper states that REFINE is the only system that factors in the medication, lab test trends. This is not true. Many other models, such as GAMENet, also model the progression of medications, diagnoses, etc.\n3. Some details in the paper is missing.\n    - what is $\\mu_i^t$ in equation (2)\n    - how does equation (8) work? $q_T$ is a vector and $Z\\times \\lambda$ is a matrix.\n    - should equation (9) be $\\beta\\times xxx + (1-\\beta)\\times xxx$. Use the plus sign?\n    - what is the hinge loss?\n    - why choose 0.5 as the medication recommendation threshold? It seems that each binary classification is highly imbalanced, and thus the learned logits are more skewed towards 0. Maybe a threshold of 0.3 would be a better choice.\n4. Two datasets have a very small medication space (one has 735 medications, and another has 50). Are they individual drugs? As far as the reviewer knows, MIMIC-IV can have more than 10,000+ drug IDs. If the paper claims on individual drug recommendations (as stated in the intro), then this part needs explanation.\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We would like to thank the reviewer for the thoughtful reviews. We have addressed some of the queries and have summarized as follows:\n\n1) The contribution of the paper is below the NeurIPS acceptance bar.\n\nWe would like to emphasize that our paper introduces an innovative fine-grained medication recommendation system, addressing actual challenges and needs.\nThe main highlights of our work include:\n\nLearning patient condition progression representation:  Beyond the sequential dependencies modelled by existing techniques, we also analyze and model fluctuations in medication dosage titrations and lab test responses over the time between visits. This offers a robust representation of a patient's evolving condition.\n\nIncorporating drug interaction severity: Unlike current methods, we embed information regarding drug severity into our recommendations. Furthermore, we formulate a balanced DDI loss, accounting for both the level of drug severity and the frequency of co-occurrence within the EHR. This leads to recommendations more closely aligned with clinical practices.\n\n2) Some statements are not well supported or overclaimed. \n\n  2a) In the conclusion, the paper states that the proposed model can offer personalized medication suggestions. It is not discussed in the main paper. \n\nOur proposed system is designed to recommend medications by taking into account a patient's current conditions along with their medical history. By specifically modeling trends in medication dosages and lab test responses, our system is capable of personalizing medication recommendations tailored to individual needs. We recognize the oversight and will include this discussion in the main paper.\n\n  2b) In the conclusion, the paper states that REFINE is the only system that factors in the medication, lab test trends. This is not true. Many other models, such as GAMENet, also model the progression of medications, diagnoses, etc.\n\nWhile models like GAMENet do model the sequential dependency of medications or diagnoses over visits, our approach goes a step further. We specifically factor in the trends of medication dosages and lab test responses over time, thus capturing a more detailed progression. This distinction sets our model apart in its approach to analyzing these medical trends.\n\n3) Some details in the paper is missing.\n\n  3a) what is $μ_i^t$ in equation (2) \n\nIt should be $t_i^{ ̅}$ which depicts the average $t_j$ for j ∈ [1, i]. We have corrected the equation.\n\n 3b) How does equation (8) work? $q_T$ is a vector and Z × λ is a matrix. \n\nSuppose $d$ is the embedding dimension and $N_m$ is the total number of drugs, then $q_T$ is a vector of dimension $d×1$, $Z$ is a matrix of dimension $d× N_m$ and $λ$ is a vector of dimension $N_m×1$. Therefore $Z∙λ$ will yield a vector of dimension $d×1$ .\n\n3c) should equation (9) be $β ×xxx+(1-β)×xxx$. Use the plus sign? \n\nNo, plus sign should not be used in this context. Our goal is to avoid over-conservative recommendation by allowing drug pairs that have frequent co-occurrences though they may have higher severity interaction. Hence, we use the minus sign to favour drug pairs with high co-occurrences.\n\n3d) what is the hinge loss? \n\nWe have defined hinge loss in Appendix C.\n\n3e) why choose 0.5 as the medication recommendation threshold? It seems that each binary classification is highly imbalanced, and thus the learned logits are more skewed towards 0. Maybe a threshold of 0.3 would be a better choice.\n\nWe have experimented with different threshold values. The use of hinge loss helps maintain the threshold at 0.5 (see Appendix C).\n\n\n4) Two datasets have a very small medication space (one has 735 medications, and another has 50). Are they individual drugs? As far as the reviewer knows, MIMIC-IV can have more than 10,000+ drug IDs. If the paper claims on individual drug recommendations (as stated in the intro), then this part needs explanation.\n\nThe small medication space referenced in our datasets refers to individual generic drug names, not specific drug IDs. We translated the NDC codes found in the MIMIC-IV dataset into medication generic names using the mapping tables outlined in Appendix F. Although there are 5733 unique NDC codes in MIMIC-IV dataset (in the file prescriptions.csv), not all these codes have a one-to-one mapping with a medication generic name. This is because the same medication with different dosages/manufacturers will have different NDC codes, e.g., Metformin can have multiple NDC codes based on the dosage strength or the manufacture. Further, we use the medications prescribed within the first 24 hours of each patient's visit. This timeframe is considered critical in patient care and has also been adopted in other baseline studies, such as GameNet. We believe that these factors, coupled with the other pre-processing steps detailed in Appendix F, reduced the size of the medication set.\n"}, {"review_id": "7Noe07ZipW", "reviewer": "Reviewer_RMGb", "summary": "In this paper, the authors present a deep learning framework that utilizes patients' electronic health records and drug information to recommend safe and accurate medication combinations based on their symptoms and examination results. The proposed method is evaluated on two real-world datasets, MIMIC-IV and PRIVATE, and is compared with existing baselines. The results show that the proposed framework outperforms the baselines.", "questions": "**If the authors can provide satisfactory answers to my questions, I would consider revising my score.**\n\n- (Major) The proposed method lacks evaluation in terms of \"Jaccard\", which is a metric used in many of the baselines such as SafeDrug (https://arxiv.org/abs/2105.02711) and GameNet (https://ojs.aaai.org/index.php/AAAI/article/view/3905). Evaluating the distances between the ground truth medication combination and the predicted one is vital, as many combinations of drugs require their presence to exert a synergistic effect.\n- (Major) I find the validation to be insufficient. There should be comparisons to more state-of-the-art baselines such as MoleRec (https://dl.acm.org/doi/abs/10.1145/3543507.3583872) and 4SDrug (https://dl.acm.org/doi/abs/10.1145/3534678.3539089).\n- (Major) The author declares that the suggested system is more potent than the baselines. Multiple baselines, such as SafeDrug (https://arxiv.org/abs/2105.02711)  and GameNet (https://ojs.aaai.org/index.php/AAAI/article/view/3905), utilize Recurrent Neural Networks (RNNs) to extract features from Electronic Health Records (EHRs) for patient representation, whereas the proposed system employs transformers. However, no experiment validates that the performance boost is due to the proposed system and not only a mere replacement of RNNs with transformers. To ensure a just and unbiased comparison, the author should compare the RNN version of the proposed system to demonstrate that the performance improvement is genuinely caused by the proposed system instead of transformers.\n- (Major) MIMIC-IV benchmark AUC seems much lower than typical methods would produce, is it some mistake?  Reference: https://arxiv.org/abs/2305.12788. To my best knowledge, there does not seem to be any issue of out-of-distribution with the dataset. Comparing the result in the article to the reference, the reported performance of the baselines is noticeably lower by approximately **ten percentage** points. Despite the possibility of differences in train-valid-test dataset split, this discrepancy is still unusual.\n- (Major) The author claimed that the balanced DDI Loss is powerful, there are no experiments demonstrating that it outperforms the DDI loss used in SafeDrug (https://arxiv.org/abs/2105.02711). Based on my understanding, the **REFINE w/o severity** in the ablation study removes the severity information from both the loss and the graph neural networks\n\n- What's the meaning of GATv2 in Equation (4)? If it's a graph neural network, how can a GNN takes only one features as input instead of a graph; If it's not, what's the relation between it and the GATv2. Still how can the same linear transformation be applied to two vectors with different dimensions as it's shown in Equation (4) and Equation (5)? And does the two layers of GAT share the same parameters? It's claimed in the article that $\\delta_{jk}$ is calculated via the average of $\\delta_{jk}^b$. \n- The figures should be presented in vector graphics. The information in Figure (4) should be presented in form of table instead of figures.\n- Why the calculation of patient representation is obtained via $q_T=h_T^d+h_T^r+h_{T-1}^s$ instead of $q_T=h_T^d+h_T^r+h_{T}^s$？\n\nIf the author can respond satisfactorily to my questions, I am willing to adjust my score.", "limitations": "The article is poorly written and the experiment is not sufficient to support the contribution claimed in the article.", "rating": 6, "confidence": 5, "soundness": 2, "presentation": 1, "contribution": 1, "strengths": "The topic is pioneering and meaningful. Learning to recommend safe and accurate drug combinations is an important component of intelligent healthcare, and it makes a significant contribution to the development of human healthcare. ", "weaknesses": "- The presentation of the paper is poor, and the equations cause confusion for the reader. Additionally, the figures presented in the article are of low quality and are not vector graphics. \n- The paper lacks necessary indicators and adequate comparisons with baselines, which undermines the overall validity of the experiment and the claimed contributions.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We would like to thank the reviewer for highlighting the strong points and shortcomings of our work. We have addressed the queries as follows (numbers are in order of query raised):\n\n1) Evaluation in terms of Jaccard as well as three other metrics have already been provided in Table 1 under Appendix I.\n\n2) MoleRec has been shown to outperform 4SDrug in their paper. The table below shows the results of our comparative experiment with MoleRec. We see that REFINE significantly outperforms MoleRec across all metrics for both datasets.\n\n| Method                                          |   |   | MIMIC-IV |  |\n| -------------------------------------------- | ------------------------ | -----------| -----------| -----------|\n|  | AUC |\tF1|\tJaccard |\twDDI |\n| __MoleRec__\t                                |   0.670 ± 0.004\t                |      0.579 ± 0.003 | 0.431 ± 0.002 | 0.044 ± 0.0001 |\n| __REFINE__\t\t|  0.708 ± 0.001\t                |      0.635 ± 0.003 | 0.462 ± 0.003 | 0.043 ± 0.0001 |\n\n\n| Method                                          |   |   | PRIVATE|  |\n| -------------------------------------------- | ------------------------ | -----------| -----------| -----------|\n|  | AUC |\tF1|\tJaccard |\twDDI |\n| __MoleRec__\t                                |   0.688 ± 0.002\t                |      0.623 ± 0.006 | 0.459 ± 0.001 | 0.112 ± 0.0001 |\n| __REFINE__\t\t|  0.729 ± 0.004\t                |      0.656 ± 0.003 | 0.506 ± 0.002 | 0.111 ± 0.0002 |\n\n3) The table below compares that the performance of REFINE when implement using both RNN and Transformer architectures. Although the RNN-based REFINE demonstrates a slight decrease in performance compared to its Transformer-based counterpart, the improvement in both cases is still more significant than the results achieved by the state-of-the-art method, MoleRec. This suggests that the improvement achieved by our proposed solution goes beyond merely employing Transformer modules.\n\n| Method                                          |   |   | MIMIC-IV |  |\n| -------------------------------------------- | ------------------------ | -----------| -----------| -----------|\n|  | AUC |\tF1|\tJaccard |\twDDI |\n| __MoleRec__\t                                |   0.670 ± 0.004\t                |      0.579 ± 0.003 | 0.431 ± 0.002 | 0.0442 ± 0.0001 |\n| __REFINE with RNN__\t\t|  0.696 ± 0.003\t                |      0.625 ± 0.002 | 0.448 ± 0.001 | 0.0439 ± 0.0003 |\n| __REFINE with Transformer__\t\t|  0.708 ± 0.001\t                |      0.635 ± 0.003 | 0.462 ± 0.003 | 0.0431 ± 0.0001 |\n\n| Method                                          |   |   | PRIVATE|  |\n| -------------------------------------------- | ------------------------ | -----------| -----------| -----------|\n|  | AUC |\tF1|\tJaccard |\twDDI |\n| __MoleRec__\t                                |   0.688 ± 0.002\t                |      0.623 ± 0.006 | 0.459 ± 0.001 | 0.1123 ± 0.0001 |\n| __REFINE with RNN__\t\t|  0.718 ± 0.002\t                |      0.642 ± 0.001 | 0.495 ± 0.003 | 0.1119 ± 0.0002|\n| __REFINE with Transformer__\t\t|  0.729 ± 0.004\t                |      0.656 ± 0.003 | 0.506 ± 0.002 | 0.1112 ± 0.0002 |\n\n4) The work in https://arxiv.org/abs/2305.12788 recommends medications at the class level, which is a coarse-grained approach. In contrast, our work recommends medications at the drug level, which is a more fine-grained approach. Hence, we cannot directly compare the AUC for the Precision-Recall curve (and other metrics) between our method/baselines and the cited article. Recommending specific drugs introduces a greater complexity compared to class-level recommendations, as it requires consideration of whether patients need single or multiple drugs from the same class.\n\n\n5) An evaluation of our system's performance, utilizing the DDI loss found in SafeDrug (labeled as REFINE w/o L_bdi)), can be found in the full Ablation study (Table 2 under Appendix J). We noted that substituting our balanced DDI loss with the DDI loss used in SafeDrug led to a decline in performance. This was observed both in terms of accuracy and the degree of drug interaction within the recommended medication set.\n\n6) In Equation (4), GATv2 in used to depict the application of feed-forward neural network layer after the LeakyReLU function, as well as the linear transformation layer after the concatenation process. To avoid confusion, we have revised Equation (4) as follows:\n$$\nδ_{jk}^b=  \\frac{w_{jk}^D  ×exp⁡(a^{'}LeakyReLU(E^b∙[n_j ||n_k]))}{∑_{n_{i} ϵS_{j}}w_{ij}^D  × exp⁡(a^{'}LeakyReLU(E^b∙[n_j ||n_i])) }\n$$\n$a^{'}$ is the transpose of the weight vector of a single layer feed-forward neural network, $E^b=[E^{b^* } || E^{b^* }]$  as shown in https://arxiv.org/pdf/2105.14491.pdf where $E^{b^* }$  is the embedding matrix for the $b^{th}$ attention head. Equation (5) is also revised to:\n$$\no_j^D=∥_{b=1}^z σ(∑_{n_k ϵS_j} δ_{jk}^b E^{b^* }∙ n_k )\n$$\nNo, the layers do not share the same parameters. In the second layer, for calculating $ δ_{jk} $ we update $ w_{jk}^D  $ to average of $ δ_{jk}^b $ in equation (4). In other words, the edge weights for the second layer are updated with average (across heads) attention coefficients of the first layer. \n\n7) Yes, we will update the figures as suggested in the camera-ready paper.\n\n8) In this work, $h_i^d , h_i^r, h_i^s$ depict the representations of diagnosis, lab test response, medication dosage set obtained from the transformer at the $i^{th}$ visit. Since our goal is to recommend a medication set for visit T, we are limited to utilizing the medication information up to visit  T-1, that is, $h_{T-1}^s$.\n\n"}]

Author rebuttal:
Response to ethical concerns.

We take data privacy and security very seriously, and we would like to reassure the reviewer that all necessary precautions were taken to ensure that no ethics regulations were violated in the use of the private dataset for this research. The data has been appropriately anonymized and processed in compliance with all relevant ethical guidelines and legal requirements. 

We have attached a pdf with figures showing the distribution of drug interactions in both datasets.

Meta-review: The paper presents a deep learning framework focused on medication recommendations, a subject of high importance in healthcare. While the work is acknowledged for its potential impact, reviewers have varied opinions on its overall quality. Strengths of the paper include its clear structure, polished writing, and the incorporation of severity levels of drug-drug interactions from the DDInter database, which improves its applicability across multiple datasets.

However, the paper faces substantial criticisms across different aspects. There are concerns about the clarity and quality of equations and figures and insufficient validation against state-of-the-art baselines. The paper is also criticized for not providing enough evidence to support its claim of superiority over existing methods, particularly regarding whether its advantages stem from the proposed framework or merely from the technology used, such as transformers over RNNs. Reviewers question the unusually low AUC reported for the MIMIC-IV dataset and call for clarification.

Further issues include limited reproducibility due to the absence of shared code, and questions regarding the level of novelty and the choice of baselines for comparison. Despite these criticisms, the general sentiment is that the paper holds promise and could have a moderate-to-high impact if the authors address these substantial concerns. Overall, the work is seen as technically solid but in need of critical refinements and further justification to solidify its claimed contributions.
Decision: Accept (poster)