R-GEAN: Regimen-Guided Edit Action Network for Within-Admission Medication Change Prediction

arXiv cs.AI Papers

Summary

This paper introduces R-GEAN, an asymmetric candidate-scoring network for predicting medication changes in hospital admissions, and establishes a leakage-controlled benchmark to accurately evaluate edit-level performance.

arXiv:2609.22959v1 Announce Type: new Abstract: The medications prescribed to a patient often change during a hospital admission as clinicians start, stop, or continue therapies. We study whether models can predict which medication classes are added or removed between 24 hours after admission and discharge. Metrics that compare the complete discharge regimen can reward models for copying medications that remain unchanged, even when they identify no actual changes. We therefore introduce a leakage-controlled benchmark that predicts net ATC3 additions and removals using only prior completed admissions and information available within the first 24 hours of the current admission. Addition candidates are classes not active at 24 hours, whereas removal candidates are classes active at that time. We also introduce R-GEAN, an asymmetric candidate-scoring network with independent addition and removal predictors. Across 240,480 admissions from 82,286 patients, R-GEAN achieves the highest predefined summary of addition, removal, changed-regimen, and action-pattern performance, termed the edit composite (0.464), compared with 0.435 for the strongest primary comparator. Reimplemented RETAIN, GAMENet, and MICRON baselines obtain 0.428, 0.420, and 0.288, respectively. R-GEAN's advantage is concentrated in correctly identifying medication classes no longer active at discharge, while rare additions and admissions with multiple medication changes remain difficult. Rankings based on micro-F1 over the reconstructed discharge regimen and the edit composite correlate weakly across the evaluated models (Spearman r = 0.20). The continuation baseline achieves the highest complete-regimen score despite predicting no additions or removals. These results show that complete-regimen and edit-level evaluation measure different aspects of medication prediction. The benchmark evaluates observed prescribing changes, not treatment appropriateness
Original Article
View Cached Full Text

Cached at: 09/23/26, 09:18 AM

# R-GEAN: Regimen-Guided Edit Action Network for Within-Admission Medication Change Prediction
Source: [https://arxiv.org/html/2609.22959](https://arxiv.org/html/2609.22959)
###### Abstract

The medications prescribed to a patient often change during a hospital admission as clinicians start, stop, or continue therapies\. We study whether models can predict which medication classes are added or removed between 24 hours after admission and discharge\. Metrics that compare the complete discharge regimen can reward models for copying medications that remain unchanged, even when they identify no actual changes\. We therefore introduce a leakage\-controlled benchmark that predicts net ATC3 additions and removals using only prior completed admissions and information available within the first 24 hours of the current admission\. Addition candidates are classes not active at 24 hours, whereas removal candidates are classes active at that time\.

We also introduce R\-GEAN, an asymmetric candidate\-scoring network with independent addition and removal predictors\. Across 240,480 admissions from 82,286 patients, R\-GEAN achieves the highest predefined summary of addition, removal, changed\-regimen, and action\-pattern performance, termed the edit composite \(0\.464\), compared with 0\.435 for the strongest primary comparator\. Reimplemented RETAIN, GAMENet, and MICRON baselines obtain 0\.428, 0\.420, and 0\.288, respectively\. R\-GEAN’s advantage is concentrated in correctly identifying medication classes no longer active at discharge, while rare additions and admissions with multiple medication changes remain difficult\. Rankings based on micro\-F1 over the reconstructed discharge regimen and the edit composite correlate weakly across the evaluated models \(Spearmanρ=0\.20\\rho=0\.20\)\. The continuation baseline achieves the highest complete\-regimen score despite predicting no additions or removals\. These results show that complete\-regimen and edit\-level evaluation measure different aspects of medication prediction\. The benchmark evaluates observed prescribing changes, not treatment appropriateness\.

1Gwangju Institute of Science and Technology \(GIST\), Gwangju, Republic of Korea

Regan Mahat: reganmahat@gm\.gist\.ac\.kr

Mansu Kim: mansu\.kim@gist\.ac\.kr

## 1Introduction

Medication treatment often changes during a hospital admission\. Clinicians may start, stop, or continue therapies as the patient’s condition and treatment needs evolve\([Daliri et al\. 2021](https://arxiv.org/html/2609.22959#bib.bib23)\)\. As a result, the medication classes active early in an admission may differ from those active at discharge\. Our goal is to predict these changes: which medication classes will be added and which will be removed by discharge\.

For each admission, we observe the medication classes active after 24 hours and call this set the*anchor regimen*\. The task predicts two net changes relative to this observed regimen: additions are classes absent at 24 hours but active at discharge, whereas removals are classes active at 24 hours but inactive at discharge\. These labels compare the 24\-hour and discharge snapshots and do not represent every medication event occurring between them\. To prevent temporal leakage, models use only prior completed admissions and information available within the first 24 hours of the current admission\([Pungitore and Subbian 2023](https://arxiv.org/html/2609.22959#bib.bib24)\)\.

Complete\-set evaluation can hide a model’s failure to predict medication changes\. A complete\-set metric compares the entire predicted discharge regimen with the observed regimen, whereas an edit\-level metric evaluates additions and removals directly\. Most medication\-prediction systems predict the complete medication set and evaluate it using Jaccard similarity or micro\-averaged F1\([Zhang et al\. 2017](https://arxiv.org/html/2609.22959#bib.bib5);[Choi et al\. 2016](https://arxiv.org/html/2609.22959#bib.bib2);[Shang et al\. 2019](https://arxiv.org/html/2609.22959#bib.bib3);[Yang et al\. 2021b](https://arxiv.org/html/2609.22959#bib.bib4)\)\. Because many therapies remain unchanged, a model can obtain a high complete\-set score by copying the 24\-hour regimen without identifying any actual changes\([Yang et al\. 2021a](https://arxiv.org/html/2609.22959#bib.bib1)\)\. In our benchmark, this continuation baseline attains the highest micro\-F1 over the reconstructed discharge regimen, 0\.8169, but only 0\.1634 on the edit composite because it predicts no additions or removals\. We therefore report both complete\-set metrics, which credit correctly continued therapies, and edit\-level metrics, which directly measure addition and removal recovery\. We also test whether these two evaluation views rank models differently\.

R\-GEAN predicts additions and removals with separate predictors because the two decisions rely on different evidence\. The addition predictor scores medication classes not present after 24 hours using the current clinical state, whereas the removal predictor scores classes already present using medication\-specific exposure history\. Their predictions are combined to reconstruct the medication regimen active at discharge\.

Our contributions are as follows\.

- •A leakage\-controlled benchmark that separates medication additions and removals from therapies that remain unchanged\. It enforces a 24\-hour information boundary and provides patient\-disjoint splits and change\-recovery metrics for 240,480 MIMIC\-IV admissions from 82,286 patients and 78 ATC3 classes\. The task, cohort, and leakage controls were fixed before model training and verified by automated tests\.
- •R\-GEAN, an asymmetric candidate\-scoring model with separate predictors for additions and removals\. The model scores only classes eligible for each direction and uses current clinical information and medication\-specific exposure history\. R\-GEAN achieves the highest edit composite, with its advantage concentrated in removal prediction and supported by Holm\-corrected patient\-level bootstrap analysis\.
- •An evaluation showing that complete\-set and edit\-level metrics rank models differently, motivating the use of both evaluation views\.

## 2Related Work

#### Complete\-set medication recommendation\.

Most prior work predicts the full medication regimen for each visit rather than changes from an observed regimen\. Existing methods use current\-visit information, longitudinal histories, molecular structure, generative decoding, substructure\-aware representations, or selective retrieval of prior visits\([Zhang et al\. 2017](https://arxiv.org/html/2609.22959#bib.bib5);[Choi et al\. 2016](https://arxiv.org/html/2609.22959#bib.bib2);[Shang et al\. 2019](https://arxiv.org/html/2609.22959#bib.bib3);[Yang et al\. 2021b](https://arxiv.org/html/2609.22959#bib.bib4);[Wu et al\. 2022](https://arxiv.org/html/2609.22959#bib.bib6);[Yang et al\. 2023](https://arxiv.org/html/2609.22959#bib.bib7);[Kim et al\. 2024](https://arxiv.org/html/2609.22959#bib.bib8)\)\. We report complete\-set metrics for comparison with this literature and edit\-level metrics for direct change recovery\.

#### Medication change prediction\.

MICRON is the closest prior method because it also predicts medication additions and removals\([Yang et al\. 2021a](https://arxiv.org/html/2609.22959#bib.bib1)\)\. It models visit\-to\-visit changes from a maintained medication vector, whereas R\-GEAN predicts within\-admission changes from an observed 24\-hour regimen\. R\-GEAN also restricts additions to classes absent at 24 hours and removals to classes present at that time\. MICRON was developed on MIMIC\-III, while R\-GEAN is evaluated on MIMIC\-IV\([Johnson et al\. 2016](https://arxiv.org/html/2609.22959#bib.bib11);[Johnson et al\. 2023](https://arxiv.org/html/2609.22959#bib.bib9)\)\. We reimplement MICRON on this benchmark; implementation details and the DualNN comparison are provided in the supplement\.

#### Evaluation of medication recommendation\.

To our knowledge, prior work has reported addition and removal errors\([Yang et al\. 2021a](https://arxiv.org/html/2609.22959#bib.bib1)\), but has not directly tested whether models receive the same ranking under complete\-set and edit\-level evaluation\.

## 3Task and Benchmark

### Formulation

The task compares the medication classes active 24 hours after admission with those active at discharge\. Let𝒱\\mathcal\{V\}denote the vocabulary of\|𝒱\|=78\|\\mathcal\{V\}\|=78ATC3 therapeutic classes\. For each admission, letMA⊆𝒱M\_\{A\}\\subseteq\\mathcal\{V\}be the medication classes recorded as active 24 hours after admission; we call this the*anchor regimen*\. LetMT⊆𝒱M\_\{T\}\\subseteq\\mathcal\{V\}be the medication classes recorded as active at discharge; we call this the*target regimen*\. Activity at discharge is determined from recorded prescription start and stop times\. Because MIMIC\-IV does not provide a reconciled discharge medication list,MTM\_\{T\}is an approximation of the medication classes active at discharge\.

The prediction targets are the two net changes between these medication sets:

Y\+=MT∖MA,Y−=MA∖MT,Y^\{\+\}=M\_\{T\}\\setminus M\_\{A\},\\qquad Y^\{\-\}=M\_\{A\}\\setminus M\_\{T\},\(1\)Here,Y\+Y^\{\+\}contains additions: classes absent at 24 hours but active at discharge\. Similarly,Y−Y^\{\-\}contains removals: classes active at 24 hours but inactive at discharge\. These targets compare the two medication snapshots and do not represent every event occurring between them\. In particular, they exclude temporary exposures that begin and end between the landmarks and stop–restart sequences that do not change snapshot membership\.

A model predictsY^\+\\hat\{Y\}^\{\+\}andY^−\\hat\{Y\}^\{\-\}and reconstructs the target regimen as

M^T=\(MA∖Y^−\)∪Y^\+\.\\hat\{M\}\_\{T\}=\\left\(M\_\{A\}\\setminus\\hat\{Y\}^\{\-\}\\right\)\\cup\\hat\{Y\}^\{\+\}\.\(2\)
For each prediction direction, the candidate space is the set of medication classes that can validly be predicted\. Addition candidates are classes absent from the anchor regimen, whereas removal candidates are classes present in it:

𝒞\+=𝒱∖MA,𝒞−=MA\.\\mathcal\{C\}^\{\+\}=\\mathcal\{V\}\\setminus M\_\{A\},\\qquad\\mathcal\{C\}^\{\-\}=M\_\{A\}\.\(3\)These candidate spaces cover all benchmark labels in the final 78\-class vocabulary and are disjoint, soY^\+∩Y^−=∅\\hat\{Y\}^\{\+\}\\cap\\hat\{Y\}^\{\-\}=\\emptysetby construction\.

![Refer to caption](https://arxiv.org/html/2609.22959v1/Figures/task_formulation.jpg)Figure 1:The model uses prior history and information available within the first 24 hours to predict medication classes added to or removed from the observed 24\-hour regimen by discharge\. The two predictions are combined to reconstruct the discharge regimen\. No information recorded after the 24\-hour boundary is available to the model\.
### Cohort and construction

The benchmark includes adults from MIMIC\-IV v3\.1 with at least one completed admission before the current hospital stay\([Johnson et al\. 2023](https://arxiv.org/html/2609.22959#bib.bib9);[Johnson et al\. 2024](https://arxiv.org/html/2609.22959#bib.bib10)\)\. An admission is eligible if the patient is at least 18 years old, the admission and discharge times are valid, and prescription and diagnosis records are present\. Earlier admissions provide patient history, whereas the 24\-hour medication regimen is constructed only from the current admission\.

Cohort and admission data come from the MIMIC\-IV v3\.1 HOSP module\. Laboratory measurements come fromhosp/labevents, and vital\-sign change features are derived from linkedicu/charteventsrecords when available\. Admissions without linked vital\-sign records remain in the cohort and receive the corresponding no\-data states\.

This design excludes first admissions and patients with only one admission, which limits generalizability to those populations\. Compared with otherwise eligible adults with a single admission, the retained patients are older \(62\.9 vs\. 56\.6 years; standardized mean difference 0\.33\) and have longer hospital stays\.

Patients are divided into training, validation, and test sets in a70:10:2070\{:\}10\{:\}20ratio using a seeded random permutation of patient identifiers \(seed 2026\)\. All admissions from the same patient remain in one split, ensuring that the partitions are patient\-disjoint\.

We convert medication records into a fixed vocabulary of 78 ATC3 therapeutic classes\. Medication names are first standardized with RxNorm\([Nelson et al\. 2011](https://arxiv.org/html/2609.22959#bib.bib12);[Zeng et al\. 2006](https://arxiv.org/html/2609.22959#bib.bib13)\)and then mapped to the Anatomical Therapeutic Chemical system\([World Health Organization n\.d\.](https://arxiv.org/html/2609.22959#bib.bib22)\)\. We use ATC level 3 to reduce sparsity while retaining clinically meaningful therapeutic groups\. After excluding out\-of\-scope records under the prespecified policy, 99\.4% of the remaining eligible medication records are resolved\. All 78 retained classes are represented in the training cohort\. Detailed mapping rules, intermediate coverage statistics, and handling of medications with multiple possible ATC codes are provided in the supplement\.

We defined the 24\-hour cutoff, cohort eligibility criteria, discharge target, and medication\-mapping rules before training any model and kept them unchanged throughout model development\. Table[1](https://arxiv.org/html/2609.22959#S3.T1)summarizes the final benchmark\.

Table 1:Benchmark and split statistics\. The splits are patient\-disjoint\. Each test admission belongs to one of seven mutually exclusive medication\-change patterns:continue9,580,add9,879,remove7,818,switch7,389,multi\-edit13,560,empty\-to\-nonempty749, andnonempty\-to\-empty57\.
### Leakage control

We control leakage through patient\-disjoint splits, a fixed 24\-hour information boundary, training\-only feature construction, validation\-only threshold selection, a locked test evaluation, and direction\-specific candidate masking\. All admissions from a patient remain in one split, and model inputs are limited to prior completed admissions and information available within the first 24 hours of the current admission\. Data\-derived statistics, including co\-prescription information, are computed from the training split only\. Decision thresholds are selected on the full validation candidate set\. Primary models, thresholds, and confirmatory comparisons are fixed before test evaluation; later ablations and diagnostics are reported as secondary analyses on the same test split\. Candidate masking follows Equation[3](https://arxiv.org/html/2609.22959#S3.E3), so models score only classes valid for the corresponding prediction direction\.

Clinical measurements are included only when their recorded availability time falls within the first 24 hours\. Laboratory and vital\-sign values requirestoretimeat or before the cutoff, excluding measurements collected earlier but recorded later\. Medication\-exposure features use only orders available before the cutoff, and a medication is marked as discontinued only when its recorded stop time is at or before 24 hours\. We verified across the full cohort that every R\-GEAN feature block satisfies these availability rules, and all automated leakage tests passed\. Detailed feature provenance is provided in the supplement\.

## 4R\-GEAN

### Design

R\-GEAN predicts additions and removals separately because the two decisions use different evidence\. Predicting an addition depends mainly on the patient’s current clinical state and changes observed during the first 24 hours\. Predicting a removal depends more strongly on the patient’s prior exposure to that medication class\. R\-GEAN therefore uses separate neural predictors for additions and removals\. The two predictors are trained and decoded independently, and their outputs are combined only when reconstructing the discharge regimen \(Figure[2](https://arxiv.org/html/2609.22959#S4.F2)\)\.

Figure 2:R\-GEAN architecture\. The addition and removal encoders receive 117\- and 101\-dimensional admission inputs, respectively, and produce 256\-dimensional admission representations\. Each representation is combined with a 32\-dimensional medication\-specific laboratory vector, a 16\-dimensional exposure vector, and an 83\-dimensional medication\-class representation\. The resulting 387\-dimensional vector is scored by a→→1387\\\!\\rightarrow\\\!128\\\!\\rightarrow\\\!1MLP\. The addition branch evaluates classes absent from the observed 24\-hour regimen \(𝒞\+=𝒱∖MA\\mathcal\{C\}^\{\+\}=\\mathcal\{V\}\\setminus M\_\{A\}\), whereas the removal branch evaluates classes present in it \(𝒞−=MA\\mathcal\{C\}^\{\-\}=M\_\{A\}\)\. Their predictions reconstruct the discharge regimen asM^T=\(MA∖Y^−\)∪Y^\+\\hat\{M\}\_\{T\}=\(M\_\{A\}\\setminus\\hat\{Y\}^\{\-\}\)\\cup\\hat\{Y\}^\{\+\}\.
### Inputs and representations

R\-GEAN scores each candidate medication class by combining shared patient and admission context with information specific to that class\. The shared context is a 101\-dimensional vector containing 13 demographic, admission, and prior\-history features; a 78\-dimensional multi\-hot representation of the medication regimen active at 24 hours,MAM\_\{A\}; and 10 indicators of data availability and healthcare use\. The first group includes age, admission type, and counts of prior visits, diagnoses, and procedures\. Diagnoses and procedures are represented as aggregate counts rather than code\-level embeddings or visit sequences\.

The addition predictor also receives a patient\-level summary of laboratory and vital\-sign changes during the first 24 hours\. For each available variable, the transition module assigns one of 16 ordered clinical\-state codes using its first and latest values, observation count, and slope relative to reference bands computed from the training split\. A shared embedding maps each code to a 16\-dimensional vector, and the vectors are averaged across variables\. This overall transition representation extends the shared context from 101 to 117 dimensions for the addition encoder\. The addition and removal encoders use→→256117\\\!\\rightarrow\\\!256\\\!\\rightarrow\\\!256and→→256101\\\!\\rightarrow\\\!256\\\!\\rightarrow\\\!256mappings, respectively\.

Both predictors also use information specific to the medication class being scored\. This includes a 32\-dimensional laboratory\-interaction vector derived from first\-24\-hour measurements and a 16\-dimensional representation of medication exposure available before the 24\-hour cutoff\. Each class is also represented by a 64\-dimensional identity embedding, a 16\-dimensional therapeutic\-group embedding, and three class\-level statistics computed from the training split: addition support, removal support, and overall prevalence\. The identity embedding, therapeutic\-group embedding, and three statistics together form an 83\-dimensional candidate representation\.

For each candidate, the 256\-dimensional admission representation is combined with the 32\-dimensional candidate\-specific laboratory vector, 16\-dimensional exposure vector, and 83\-dimensional candidate representation\. The resulting 387\-dimensional vector is scored by a→→1387\\\!\\rightarrow\\\!128\\\!\\rightarrow\\\!1MLP\.

The observed 24\-hour regimen enters through its multi\-hot representation, the addition and removal candidate masks, and the discharge\-regimen reconstruction in Equation[2](https://arxiv.org/html/2609.22959#S3.E2); no separate learned anchor encoder is used\.

### Training and decoding

The addition and removal tasks are highly imbalanced, with positive candidate pairs substantially less frequent than negative pairs\. To address this imbalance, each predictor is trained using weighted binary cross\-entropy\. The two predictors are optimized separately\. The positive\-class weight is computed from the class distribution in the training set:

w\+=min⁡\(6,max⁡\(1,nnegnpos\)\),w\_\{\+\}=\\min\\\!\\left\(6,\\max\\\!\\left\(1,\\frac\{n\_\{\\mathrm\{neg\}\}\}\{n\_\{\\mathrm\{pos\}\}\}\\right\)\\right\),where the upper bound of 6 prevents extreme class weighting\. Negative training pairs are subsampled to a 3:1 negative\-to\-positive ratio\.

The addition predictor includes an auxiliary penalty for predicted medication pairs recorded as interacting in TWOSIDES\. LetAddiA\_\{\\mathrm\{ddi\}\}denote the TWOSIDES interaction matrix mapped to the 78 ATC3 classes\([Tatonetti et al\. 2012](https://arxiv.org/html/2609.22959#bib.bib14)\)\. The regularization termΩddi\\Omega\_\{\\mathrm\{ddi\}\}represents the expected number of mapped interacting pairs formed between the predicted additions and the reconstructed discharge regimen\. It is applied only to the addition predictor because adding a medication can introduce new interaction pairs, whereas removing a medication cannot introduce a new pair\. The resulting training objectives are:

ℒ\+=ℓwbce\+\+0\.01​Ωddi,ℒ−=ℓwbce−\.\\mathcal\{L\}^\{\+\}=\\ell\_\{\\text\{wbce\}\}^\{\+\}\+0\.01\\,\\Omega\_\{\\mathrm\{ddi\}\},\\qquad\\mathcal\{L\}^\{\-\}=\\ell\_\{\\text\{wbce\}\}^\{\-\}\.\(4\)
Both predictors are optimized with Adam\([Kingma and Ba 2015](https://arxiv.org/html/2609.22959#bib.bib17)\)using a learning rate of2×10−32\\times 10^\{\-3\}, weight decay of10−510^\{\-5\}, a batch size of 65,536, and 16 training epochs\.

At inference, a medication class is predicted as an addition or removal when its score exceeds the corresponding direction\-specific threshold:

Y^\+=\{m∈𝒞\+:p\+​\(m\)≥τ\+\},Y^−=\{m∈𝒞−:p−​\(m\)≥τ−\}\.\\begin\{split\}\\hat\{Y\}^\{\+\}&=\\\{m\\in\\mathcal\{C\}^\{\+\}:p^\{\+\}\(m\)\\geq\\tau^\{\+\}\\\},\\\\ \\hat\{Y\}^\{\-\}&=\\\{m\\in\\mathcal\{C\}^\{\-\}:p^\{\-\}\(m\)\\geq\\tau^\{\-\}\\\}\.\\end\{split\}\(5\)The addition and removal thresholds are selected independently by maximizing the corresponding micro\-F1 on the full validation candidate set over\{0\.05,0\.10,…,0\.95\}\\\{0\.05,0\.10,\\ldots,0\.95\\\}\. This procedure yieldsτ\+=0\.25\\tau^\{\+\}=0\.25andτ−=0\.65\\tau^\{\-\}=0\.65\. Validation candidates are not subsampled, so threshold selection reflects the class distribution encountered at inference\. Predictions use the raw model probabilities without post\-hoc calibration; calibration is evaluated separately using ECE and Brier score\([Guo et al\. 2017](https://arxiv.org/html/2609.22959#bib.bib15);[Pakdaman Naeini et al\. 2015](https://arxiv.org/html/2609.22959#bib.bib16);[Brier 1950](https://arxiv.org/html/2609.22959#bib.bib20)\)\.

## 5Experimental Setup

### Baselines

We compare R\-GEAN with baselines chosen to test three questions: whether medication changes can be predicted without a learned model, whether existing public models transfer to this task, and whether separate addition and removal predictors improve performance\.

The non\-learned baselines arecontinuation, which predicts no medication changes, andfrequency, which predicts changes using class\-level frequencies\. The public baselines are RETAIN\([Choi et al\. 2016](https://arxiv.org/html/2609.22959#bib.bib2)\), GAMENet\([Shang et al\. 2019](https://arxiv.org/html/2609.22959#bib.bib3)\), and MICRON\([Yang et al\. 2021a](https://arxiv.org/html/2609.22959#bib.bib1)\)\. We use “FullSet” for models that predict the complete discharge regimen and then derive additions and removals, and “Edit” for variants that predict additions and removals directly\. RETAIN and GAMENet are evaluated in both forms\. MICRON is reimplemented using its residual reconstruction approach, interaction penalty, and separate addition and removal thresholds\.

The internal baselines are a gradient\-boostedtreemodel and asharedneural model\. The tree baseline is a LightGBM classifier over admission–candidate pairs\([Ke et al\. 2017](https://arxiv.org/html/2609.22959#bib.bib21)\)\. The shared model uses one common encoder with separate addition and removal output heads and receives all R\-GEAN feature blocks together with a general clinical\-summary input\. It controls for feature access; a separately widened parameter\-matched version tests whether the advantage persists at comparable model capacity\. LightGBM hyperparameters are provided in the supplement\.

SafeDrug\([Yang et al\. 2021b](https://arxiv.org/html/2609.22959#bib.bib4)\)relies on molecular information below the ATC3 class level\. A substantially adapted ATC3 version achieves a composite of 0\.2816 and is reported only as a sensitivity analysis\. It is excluded from the primary comparison and rank\-correlation analysis\.

Comparisons with public models are interpreted at the system level because their task adaptations and available inputs differ\. The shared model provides the controlled comparison for separate addition and removal predictors\.

### Metrics

Addition F1 \(F1\+\\mathrm\{F1\}^\{\+\}\) and removal F1 \(F1−\\mathrm\{F1\}^\{\-\}\) measure how accurately the corresponding medication changes are recovered\. Changed\-admission Jaccard \(JchgJ\_\{\\text\{chg\}\}\) compares the reconstructed and observed discharge regimens only for admissions with at least one true addition or removal\. Action macro\-F1 \(F1act\\mathrm\{F1\}\_\{\\text\{act\}\}\) measures whether the overall change pattern—such as no change, addition, removal, switch, or multiple changes—is correctly identified\. The seven action groups are mutually exclusive and cover all test admissions; their full definitions and precedence rules are provided in the supplement\.

We combine these four measures into a predefined edit composite used to summarize model performance:

S=0\.35​F1\+\+0\.30​F1−\+0\.25​Jchg\+0\.10​F1act\.S=0\.35\\,\\mathrm\{F1\}^\{\+\}\+0\.30\\,\\mathrm\{F1\}^\{\-\}\+0\.25\\,J\_\{\\text\{chg\}\}\+0\.10\\,\\mathrm\{F1\}\_\{\\text\{act\}\}\.\(6\)The weights were fixed before final model selection: 65% of the composite is assigned to addition and removal F1, 25% to changed\-admission Jaccard, and 10% to action macro\-F1\. The composite is a model\-comparison summary rather than a clinical utility measure; we therefore report all four components separately and do not interpret a higher composite as evidence of clinical benefit\.

We also report resulting\-set micro\-F1, which compares the reconstructed and observed discharge regimens across all medication classes\. This metric supports comparison with methods that predict the complete medication set\.

### Protocol

The primary models, decision thresholds, and confirmatory comparisons were specified before the locked test evaluation\. Results in the main tables use seed 2026\. Later ablations and diagnostic analyses use the same test split and are treated as secondary analyses\.

R\-GEAN remains the highest\-ranked model across three independent training seeds \(2026–2028\), with a mean edit composite of0\.4636±0\.00470\.4636\\pm 0\.0047compared with0\.4334±0\.00410\.4334\\pm 0\.0041for the strongest competing model\. Full seed\-specific results are provided in the supplement\.

We use patient\-level paired bootstrap sampling to estimate uncertainty while preserving the dependence among admissions from the same patient\. Holm correction is applied jointly to eleven prespecified comparisons: four edit\-composite comparisons against RETAIN\-FullSet, GAMENet\-FullSet, the tree model, and the shared model, and seven metric\-specific comparisons against MICRON\([Holm 1979](https://arxiv.org/html/2609.22959#bib.bib18);[Efron and Tibshirani 1993](https://arxiv.org/html/2609.22959#bib.bib19)\)\. Other directional differences are reported with confidence intervals only\. Contextual baselines, edit variants, and SafeDrug were outside the confirmatory inferential family and are reported descriptively as point estimates\.

## 6Results

### Main comparison

R\-GEAN attains the highest edit composite, the predefined summary of addition, removal, changed\-regimen, and action\-pattern performance\. Its score of 0\.4643 exceeds the shared neural model at 0\.4350 and RETAIN\-FullSet at 0\.4275, the strongest complete\-set comparator\.

MICRON obtains an edit composite of 0\.2884, with addition F1 of 0\.2280 and removal F1 of 0\.3456\. The direct edit variants of RETAIN and GAMENet also underperform their FullSet versions \(0\.3492 vs\. 0\.4275 and 0\.3414 vs\. 0\.4195, respectively\)\. These results indicate that directly predicting additions and removals alone does not explain R\-GEAN’s performance\. The component analyses below examine the contributions of the asymmetric architecture and candidate\-specific inputs\.

Table 2:Test results for the primary seed \(49,032 admissions; 16,444 patients\)\. Bold and underlined values indicate the best and second\-best result in each column\. The continuation baseline attains the highest changed\-admission Jaccard despite predicting no additions or removals\. The composite is the predefined summary of edit performance described in Equation[6](https://arxiv.org/html/2609.22959#S5.E6)\.
### Where the advantage lies

Patient\-level paired bootstrap analysis supports R\-GEAN’s edit\-composite advantage over all four learned comparators\. R\-GEAN improves the composite by 0\.0368 over RETAIN\-FullSet, 0\.0448 over GAMENet\-FullSet, 0\.0431 over the tree model, and 0\.0293 over the primary shared baseline\. Its advantage over MICRON is 0\.1759\. Reported differences are computed from unrounded estimates and may differ by up to 0\.0001 from differences between the rounded table entries\.

Its largest advantage is in correctly identifying medication classes active at 24 hours but absent at discharge\. Compared with MICRON, R\-GEAN improves removal F1 by 0\.2556\. It also improves removal F1 over RETAIN\-FullSet and GAMENet\-FullSet by 0\.1342 and 0\.1355, respectively, with 95% confidence intervals entirely above zero\. R\-GEAN additionally exceeds MICRON in resulting\-set micro\-F1 by 0\.3131\.

All eleven 95% confidence intervals exclude zero, and all corresponding comparisons remain significant after joint Holm correction\. No bootstrap replicate favors a comparator\. Full confidence intervals and empiricalpp\-value calculations are provided in the supplement\.

Addition prediction is the only direction in which a complete\-set model outperforms R\-GEAN\. RETAIN\-FullSet achieves higher addition F1 \(−0\.0178\-0\.0178relative to R\-GEAN; 95% CI\[−0\.0211,−0\.0145\]\[\-0\.0211,\-0\.0145\]\)\. R\-GEAN nevertheless exceeds GAMENet\-FullSet \(\+0\.0067\+0\.0067, 95% CI\[0\.0035,0\.0099\]\[0\.0035,0\.0099\]\) and both internal learned baselines\. These directional comparisons were not included in the Holm\-adjusted primary analysis and are reported with confidence intervals only\.

### Robustness to composite weighting

R\-GEAN remains the highest\-ranked model under all six predefined alternative weighting schemes and under 94\.1% of 20,000 randomly sampled weight combinations\. It ranks within the top three in 99\.99% of these combinations\.

### Set\-level and edit\-level rankings disagree

Models receive different rankings when evaluated on the complete reconstructed discharge regimen and when evaluated directly on additions and removals\. The rank correlation between resulting\-set micro\-F1 and the edit composite is weak \(ρ=0\.20\\rho=0\.20,n=10n=10\)\.

The continuation baseline ranks first on resulting\-set micro\-F1 \(0\.8169\) despite predicting no additions or removals\. Similarly, GAMENet\-FullSet has the highest resulting\-set micro\-F1 among the learned models \(0\.7938\) but ranks fifth on the edit composite\. These results support reporting both evaluation views: complete\-set metrics measure reconstruction of the full discharge regimen, whereas edit\-level metrics measure recovery of medication changes\.

## 7Diagnostics and Limitations

#### Component attribution\.

The ablations show that addition and removal prediction depend on different information\. The interaction regularizer and prior\-history features contribute most to addition performance, whereas medication\-specific exposure contributes most to removal performance\. Removing the interaction regularizer reduces the composite by 0\.0409, and removing candidate exposure from the removal branch reduces removal F1 by 0\.0772 and the composite by 0\.0293\. Table[3](https://arxiv.org/html/2609.22959#S7.T3)summarizes the main component effects\.

The shared\-model experiments further support the use of separate predictors\. The primary shared baseline achieves a composite of 0\.4350\. A separately retrained shared\-predictor ablation achieves 0\.4345 \(Δ​S=−0\.0298\\Delta S=\-0\.0298\)\. After widening the shared model to match R\-GEAN’s parameter count, the parameter\-matched control remains 0\.0225 behind R\-GEAN at seed 2026 \(95% CI\[0\.0208,0\.0242\]\[0\.0208,0\.0242\]\)\.

Table 3:Changes in test performance after removing individual components\. Full R\-GEAN obtainsF1\+=0\.2509\\mathrm\{F1\}^\{\+\}=0\.2509,F1−=0\.6013\\mathrm\{F1\}^\{\-\}=0\.6013, andS=0\.4643S=0\.4643\. When one branch is modified, the other is held fixed\. Complete results are provided in the supplement\.
#### Error structure\.

R\-GEAN’s clearest weakness is ranking rare additions\. Across the 39 classes in the bottom half of training\-set addition support, R\-GEAN attains an addition F1 of 0\.0004, the lowest among the evaluated models\. All of these classes are available to the model under Equation[3](https://arxiv.org/html/2609.22959#S3.E3), but the correct classes usually receive low scores\. Rare\-class recall@5 is 0\.017, recall@10 is 0\.029, and mean reciprocal rank is 0\.042; recall@5 is zero in the lowest\-support quartile\. Validation\-selected focal, class\-balanced, and logit\-adjusted losses do not produce a stable improvement\.

Multi\-edit admissions, which contain several simultaneous medication changes, also remain difficult\. Among 13,560 such admissions, R\-GEAN exactly recovers all changes in 0\.0016 of cases\. It nevertheless achieves the strongest partial recovery, with addition recall of 0\.256 and removal recall of 0\.626\.

Removal probabilities are substantially less well calibrated than addition probabilities\. Removal ECE is 0\.1943, compared with an addition ECE of 0\.0323, and the removal Brier score is 0\.1370\([Guo et al\. 2017](https://arxiv.org/html/2609.22959#bib.bib15);[Pakdaman Naeini et al\. 2015](https://arxiv.org/html/2609.22959#bib.bib16);[Brier 1950](https://arxiv.org/html/2609.22959#bib.bib20)\)\. Isotonic calibration fitted on the validation set reduces removal ECE to 0\.0023 while leaving removal F1 nearly unchanged at 0\.6011\. Calibration therefore improves probability estimates rather than change recovery, and the raw probabilities should not be interpreted as clinical confidence\.

#### Removal\-label composition\.

R\-GEAN’s removal advantage is not limited to medications given only briefly\. True removals consist mainly of anti\-infectives \(38\.2%\) and cardiovascular agents \(20\.9%\), and 26\.1% of medication orders active at 24 hours last no more than one day\. In a post\-hoc analysis, removal classes are grouped by their median order duration in the test set\. This grouping is not used for training, threshold selection, or model selection\. Relative to RETAIN\-FullSet, R\-GEAN improves removal F1 for both classes with median duration≤48\\leq 48hours \(\+0\.099\+0\.099\) and longer\-duration classes \(\+0\.199\+0\.199\)\. Some removal labels still reflect the natural completion of short medication courses\.

#### Interaction burden\.

Pair\-normalized interaction burden is similar across models \(0\.968–0\.996; R\-GEAN 0\.9948\), providing no evidence of a safety advantage\. Removing the interaction term leads to overprediction, with 3\.9 additions per admission and addition F1 of 0\.172\. In matched diagnostic reruns, a training\-derived count\-matching regularizer achieves nearly the same composite as the interaction\-regularized model \(0\.4615 vs\. 0\.4618\), without using interaction information\. The TWOSIDES penalty therefore mainly limits the number of predicted additions; it does not provide evidence of safer medication combinations\.

#### Robustness and reproducibility\.

R\-GEAN performs broadly similarly across most age, sex, and admission\-type strata, although several small admission\-type groups show greater variation\. These subgroup results are internal stress tests and should not be interpreted as a comprehensive fairness or external\-validity analysis\. Comparisons with public models should be interpreted at the whole\-system level because the models differ in task adaptation and available inputs\. The matched shared model provides the more controlled evidence for separate addition and removal predictors\.

An end\-to\-end rerun of the data\-processing and evaluation pipeline reproduced the benchmark and reported results\. R\-GEAN has 465,924 trainable parameters, and training takes 35\.7 s on a single RTX 4090\. Further computational and reproducibility details are provided in the supplement\.

#### Scope and limitations\.

The benchmark captures net medication\-class changes between 24 hours after admission and discharge\. It does not represent a reconciled discharge medication list, every medication event during the admission, dose or route changes, within\-class substitutions, or treatment appropriateness\. Only 27\.7% of 708,149 medication start and stop events alter membership between the two snapshots\.

The cohort is drawn from a single health system and includes only patients with prior admissions\. Generalization to first admissions, later time periods, and other institutions remains untested\. The prescription data used here do not provide reliable explicit fields for PRN status, cancellations, or discontinuation events; these cases are handled using prescription intervals and medication\-mapping rules\.

The study did not include clinician review, external or temporal validation, or a comprehensive fairness analysis\.

## 8Conclusion

R\-GEAN predicts which ATC3 medication classes are added to or removed from the regimen active at 24 hours by discharge\. It achieves the highest edit composite among the evaluated models, with its advantage concentrated in removal prediction\. Rare additions and multi\-edit cases remain difficult\. Complete\-set and edit\-level metrics also produce different model rankings, supporting the use of both evaluation views\. These retrospective results describe observed prescribing in a single\-system cohort restricted to patients with prior admissions\.

## Ethical Statement

This benchmark is designed to test whether medication\-prediction models recover observed medication changes or mainly copy therapies that remain unchanged\. It is intended for research evaluation, model comparison, and failure analysis, not for medication recommendation or clinical decision support\.

MIMIC\-IV is de\-identified and was accessed under PhysioNet credentialing and its data use agreement\. Code and configurations will be released for research use; the data must be obtained separately through PhysioNet\.

Because the targets reflect historical prescribing, they may encode institutional practices and disparities and do not establish clinical appropriateness, efficacy, or safety\. R\-GEAN has not been clinically validated and must not be used for prescribing or patient\-facing decisions\.

## References

- Brier \(1950\)G\. W\. BrierVerification of forecasts expressed in terms of probability\.Monthly Weather Review78\(1\),pp\. 1–3\.Cited by:[§4](https://arxiv.org/html/2609.22959#S4.SSx3.p4.2),[§7](https://arxiv.org/html/2609.22959#S7.SS0.SSS0.Px2.p3.1)\.
- Choiet al\.\(2016\)E\. Choi, M\. T\. Bahadori, J\. Sun, J\. Kulas, A\. Schuetz, and W\. StewartRETAIN: an interpretable predictive model for healthcare using reverse time attention mechanism\.InAdvances in Neural Information Processing Systems,Vol\.29,pp\. 3504–3512\.Cited by:[§1](https://arxiv.org/html/2609.22959#S1.p3.1),[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px1.p1.1),[§5](https://arxiv.org/html/2609.22959#S5.SSx1.p2.1)\.
- Daliriet al\.\(2021\)S\. Daliri, M\. Bouhnouf, H\. W\. P\. C\. van de Meerendonk, B\. M\. Buurman, W\. J\. M\. Scholte op Reimer, M\. J\. Kooij, and F\. Karapinar\-ÇarkitLongitudinal medication reconciliation at hospital admission, discharge and post\-discharge\.Research in Social and Administrative Pharmacy17\(4\),pp\. 677–684\.Cited by:[§1](https://arxiv.org/html/2609.22959#S1.p1.1)\.
- Efron and Tibshirani \(1993\)B\. Efron and R\. J\. TibshiraniAn introduction to the bootstrap\.Chapman & Hall,New York\.Cited by:[§5](https://arxiv.org/html/2609.22959#S5.SSx3.p3.1)\.
- Guoet al\.\(2017\)C\. Guo, G\. Pleiss, Y\. Sun, and K\. Q\. WeinbergerOn calibration of modern neural networks\.InProceedings of the 34th International Conference on Machine Learning,Proceedings of Machine Learning Research, Vol\.70,pp\. 1321–1330\.Cited by:[§4](https://arxiv.org/html/2609.22959#S4.SSx3.p4.2),[§7](https://arxiv.org/html/2609.22959#S7.SS0.SSS0.Px2.p3.1)\.
- Holm \(1979\)S\. HolmA simple sequentially rejective multiple test procedure\.Scandinavian Journal of Statistics6\(2\),pp\. 65–70\.Cited by:[§5](https://arxiv.org/html/2609.22959#S5.SSx3.p3.1)\.
- Johnsonet al\.\(2024\)A\. Johnson, L\. Bulgarelli, T\. Pollard, B\. Gow, B\. Moody, S\. Horng, L\. A\. Celi, and R\. MarkMIMIC\-IV\.PhysioNet\.Note:Version 3\.1Cited by:[§3](https://arxiv.org/html/2609.22959#S3.SSx2.p1.1)\.
- Johnsonet al\.\(2023\)A\. E\. W\. Johnson, L\. Bulgarelli, L\. Shen, A\. Gayles, A\. Shammout, S\. Horng, T\. J\. Pollard, S\. Hao, B\. Moody, B\. Gow, L\. H\. Lehman, L\. A\. Celi, and R\. G\. MarkMIMIC\-IV, a freely accessible electronic health record dataset\.Scientific Data10,pp\. 1\.Cited by:[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px2.p1.1),[§3](https://arxiv.org/html/2609.22959#S3.SSx2.p1.1)\.
- Johnsonet al\.\(2016\)A\. E\. W\. Johnson, T\. J\. Pollard, L\. Shen, L\. H\. Lehman, M\. Feng, M\. Ghassemi, B\. Moody, P\. Szolovits, L\. A\. Celi, and R\. G\. MarkMIMIC\-III, a freely accessible critical care database\.Scientific Data3,pp\. 160035\.Cited by:[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px2.p1.1)\.
- Keet al\.\(2017\)G\. Ke, Q\. Meng, T\. Finley, T\. Wang, W\. Chen, W\. Ma, Q\. Ye, and T\. LiuLightGBM: a highly efficient gradient boosting decision tree\.InAdvances in Neural Information Processing Systems,Vol\.30,pp\. 3146–3154\.Cited by:[§5](https://arxiv.org/html/2609.22959#S5.SSx1.p3.1)\.
- Kimet al\.\(2024\)T\. Kim, J\. Heo, H\. Kim, K\. Shin, and S\. KimVITA: “carefully chosen and weighted less” is better in medication recommendation\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.38,pp\. 8600–8607\.Cited by:[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px1.p1.1)\.
- Kingma and Ba \(2015\)D\. P\. Kingma and J\. BaAdam: a method for stochastic optimization\.InInternational Conference on Learning Representations,Cited by:[§4](https://arxiv.org/html/2609.22959#S4.SSx3.p3.1)\.
- Nelsonet al\.\(2011\)S\. J\. Nelson, K\. Zeng, J\. Kilbourne, T\. Powell, and R\. MooreNormalized names for clinical drugs: RxNorm at 6 years\.Journal of the American Medical Informatics Association18\(4\),pp\. 441–448\.Cited by:[§3](https://arxiv.org/html/2609.22959#S3.SSx2.p5.1)\.
- Pakdaman Naeiniet al\.\(2015\)M\. Pakdaman Naeini, G\. F\. Cooper, and M\. HauskrechtObtaining well calibrated probabilities using bayesian binning\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.29,pp\. 2901–2907\.Cited by:[§4](https://arxiv.org/html/2609.22959#S4.SSx3.p4.2),[§7](https://arxiv.org/html/2609.22959#S7.SS0.SSS0.Px2.p3.1)\.
- Pungitore and Subbian \(2023\)S\. Pungitore and V\. SubbianAssessment of prediction tasks and time window selection in temporal modeling of electronic health record data: a systematic review\.Journal of Healthcare Informatics Research7\(3\),pp\. 313–331\.Cited by:[§1](https://arxiv.org/html/2609.22959#S1.p2.1)\.
- Shanget al\.\(2019\)J\. Shang, C\. Xiao, T\. Ma, H\. Li, and J\. SunGAMENet: graph augmented MEmory networks for recommending medication combination\.InProceedings of the AAAI Conference on Artificial Intelligence,Vol\.33,pp\. 1126–1133\.Cited by:[§1](https://arxiv.org/html/2609.22959#S1.p3.1),[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px1.p1.1),[§5](https://arxiv.org/html/2609.22959#S5.SSx1.p2.1)\.
- Tatonettiet al\.\(2012\)N\. P\. Tatonetti, P\. P\. Ye, R\. Daneshjou, and R\. B\. AltmanData\-driven prediction of drug effects and interactions\.Science Translational Medicine4\(125\),pp\. 125ra31\.Cited by:[§4](https://arxiv.org/html/2609.22959#S4.SSx3.p2.1)\.
- World Health Organization \(n\.d\.\)World Health OrganizationAnatomical therapeutic chemical \(ATC\) classification\.Note:ATC/DDD ToolkitAccessed July 25, 2026Cited by:[§3](https://arxiv.org/html/2609.22959#S3.SSx2.p5.1)\.
- Wuet al\.\(2022\)R\. Wu, Z\. Qiu, J\. Jiang, G\. Qi, and X\. WuConditional generation net for medication recommendation\.InProceedings of the ACM Web Conference 2022,pp\. 935–945\.Cited by:[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px1.p1.1)\.
- Yanget al\.\(2021a\)C\. Yang, C\. Xiao, L\. Glass, and J\. SunChange matters: medication change prediction with recurrent residual networks\.InProceedings of the Thirtieth International Joint Conference on Artificial Intelligence,pp\. 3728–3734\.Cited by:[§1](https://arxiv.org/html/2609.22959#S1.p3.1),[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px2.p1.1),[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px3.p1.1),[§5](https://arxiv.org/html/2609.22959#S5.SSx1.p2.1)\.
- Yanget al\.\(2021b\)C\. Yang, C\. Xiao, F\. Ma, L\. Glass, and J\. SunSafeDrug: dual molecular graph encoders for recommending effective and safe drug combinations\.InProceedings of the Thirtieth International Joint Conference on Artificial Intelligence,pp\. 3735–3741\.Cited by:[§1](https://arxiv.org/html/2609.22959#S1.p3.1),[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px1.p1.1),[§5](https://arxiv.org/html/2609.22959#S5.SSx1.p4.1)\.
- Yanget al\.\(2023\)N\. Yang, K\. Zeng, Q\. Wu, and J\. YanMoleRec: combinatorial drug recommendation with substructure\-aware molecular representation learning\.InProceedings of the ACM Web Conference 2023,pp\. 4075–4085\.Cited by:[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px1.p1.1)\.
- Zenget al\.\(2006\)K\. Zeng, O\. Bodenreider, J\. Kilbourne, and S\. J\. NelsonRxNav: a web service for standard drug information\.InAMIA Annual Symposium Proceedings,pp\. 1156\.Cited by:[§3](https://arxiv.org/html/2609.22959#S3.SSx2.p5.1)\.
- Zhanget al\.\(2017\)Y\. Zhang, R\. Chen, J\. Tang, W\. F\. Stewart, and J\. SunLEAP: learning to prescribe effective and safe treatment combinations for multimorbidity\.InProceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining,pp\. 1315–1324\.Cited by:[§1](https://arxiv.org/html/2609.22959#S1.p3.1),[§2](https://arxiv.org/html/2609.22959#S2.SS0.SSS0.Px1.p1.1)\.

## Supplementary Material

## Appendix ABenchmark construction and validity

### A\.1Mapping and cohort summary

Prescription strings are normalized through RxNorm, which unifies names and formulations of the same drug concept, and mapped to the Anatomical Therapeutic Chemical \(ATC\) system; ingredients with several candidate codes are resolved to the route\- and anatomy\-compatible ATC branch\. After applying the prespecified exclusion policy, records are mapped to the 78 ATC3 classes used for prediction\. The prediction vocabulary𝒱\\mathcal\{V\}comprises 78 ATC3 therapeutic classes defined by a prespecified clinical\-inclusion policy, all represented in the training cohort\.

Table 4:Summary of medication mapping and benchmark construction\. Coverage percentages use the denominators defined in the text\.The three coverage percentages use different denominators\. RxNorm entity coverage is the share of the 34,000 unique medication entities—keyed by normalized name, national drug code, generic sequence number, formulary code, product strength, and route—resolved through the national\-drug\-code\-to\-RxNorm and RxNorm\-consensus crosswalks \(21,979 of 34,000\)\. ATC coverage by record is the record\-weighted share of the 15,562,624 linked prescription records that carry an ATC code \(88\.6%\)\. Resolved eligible records \(99\.4%\) is the record\-weighted share that are either mapped or routed to a documented non\-regimen exclusion by the frozen policy, computed after policy exclusions\. Drug strings are normalized by trimming, upper\-casing, and collapsing internal whitespace, with no stemming or synonym substitution\. Entities with several candidate ATC codes are resolved by a route\-gated multi\-ATC correction to the route\- and anatomy\-compatible branch\. Long\-tail entities that remain unresolved are left unmapped, with none exceeding a 0\.1% record\-frequency threshold\. Mapped medications are collapsed to per\-admission ATC3 membership\. The frozen prediction vocabulary contains 78 ATC3 therapeutic classes selected under the prespecified clinical\-inclusion policy\. All 78 classes are represented in the training cohort\.

### A\.2Anchor and target construction

The anchor regimen contains the ATC3 medication classes recorded as active 24 hours after admission\. The target regimen contains the classes recorded as active at discharge, as determined from prescription start and stop times\. Because MIMIC\-IV does not provide a reconciled discharge medication list, the target regimen is an interval\-based approximation of the medication classes active at discharge\.

Multiple prescription records mapped to the same ATC3 class are collapsed to set membership at each landmark\. Dose and route changes do not create separate targets, and substitutions within the same ATC3 class are not represented\. Temporary exposures and stop–restart sequences that do not change membership between the two landmarks are not included in the net addition and removal labels\.

### A\.3Patient\-disjoint split and cohort selection

Patients are assigned to train, validation, and test sets in a70:10:2070\{:\}10\{:\}20ratio using a seeded random permutation of patient identifiers \(seed 2026\)\. Assignment is not stratified by calendar year, and all admissions from a patient remain in one split\. No patient appears in more than one split\.

Eligible admissions require at least one completed prior admission so that patient history is available\. The 24\-hour regimen is constructed only from the current admission\. Compared with otherwise eligible single\-admission adults, the retained cohort is older and has longer hospital stays \(Table[5](https://arxiv.org/html/2609.22959#A1.T5)\)\.

Table 5:Cohort selection relative to otherwise\-eligible single\-admission adults \(standardized mean differences\)\.
### A\.4Leakage and feature provenance

Current\-admission clinical features are gated by their*availability*time rather than event time\. An observation is included only if its recording time is at or before the 24\-hour anchor; values measured within the window but recorded later are excluded\. An order is marked as discontinued only when its stop time is at or before the anchor\. Table[6](https://arxiv.org/html/2609.22959#A1.T6)groups the input blocks by their availability rule; all active blocks pass the automated leakage checks\.

Table 6:Feature provenance, availability rules, branch usage, and automated leakage\-check results\.The addition loss also uses an external TWOSIDES interaction matrix as a training\-time regularizer\. The matrix is split\-independent and is not a patient\-level model input\.

The cohort is defined from the HOSP module\. Laboratory measurements are obtained fromhosp/labevents, whereas vital signs are obtained from linkedicu/charteventsrecords\. In the primary run, seven vital variables received train\-fitted transition bands and entered R\-GEAN through the addition\-branch transition representation;FiO2did not meet the minimum finite\-observation requirement\. Vital\-sign coverage was approximately 13% of admissions, and unavailable vital\-sign information was represented by no\-data transition states\.

### A\.5Action\-stratum definitions

Let the anchor and target sizes be the numbers of classes active at the 24\-hour landmark and at discharge, respectively, and let the addition and removal counts beadd=\|Y\+\|\\mathrm\{add\}=\|Y^\{\+\}\|andrem=\|Y−\|\\mathrm\{rem\}=\|Y^\{\-\}\|\. Each admission is assigned to one of seven strata by the conditions in Table[7](https://arxiv.org/html/2609.22959#A1.T7), evaluated in the predefined first\-match order shown\. The categories form an exhaustive, mutually exclusive partition under this precedence order\.

Table 7:Action strata and their first\-match precedence order\.The three\-edit boundary separating switch from multi\-edit admissions and the first\-match precedence order were fixed before test evaluation\.

## Appendix BBaseline and statistical details

### B\.1Baseline implementations

RETAIN and GAMENet are evaluated in FullSet and Edit forms as described in the main paper\. For the within\-admission adaptation, MICRON receives current\-admission diagnosis and procedure bags and the observed 24\-hour regimen as its previous medication state\. Its previous\-state clinical input is empty, and predictions are not propagated across admissions\. The shared model receives all R\-GEAN feature blocks plus a general clinical summary\. SafeDrug is adapted to ATC3 and reported as a sensitivity analysis, obtaining an edit composite of 0\.2816\. It is excluded from the primary comparison and rank\-correlation analysis\.

The Tree baseline is a LightGBM candidate\-pair classifier with 63 leaves, learning rate 0\.05, 50 minimum samples per leaf, feature and bagging fractions of 0\.8, and 300 estimators per direction\. It uses a 3:1 negative\-to\-positive training ratio and validation\-selected thresholds\.

### B\.2Bootstrap confidence intervals

Uncertainty uses a patient\-level paired bootstrap: patients are sampled with replacement, all admissions of each sampled patient are retained, and both compared models are evaluated on the identical resampled admissions so that differences are paired\. Each replicate recomputes the pooled metric from scratch \(B=10,000B=10\{,\}000\), and confidence intervals are the 2\.5th and 97\.5th percentiles of the replicate differences\. The two\-sided empiricalpp\-value uses the add\-one estimator2​\(1\+min⁡\(b−,b\+\)\)/\(B\+1\)2\\,\(1\+\\min\(b^\{\-\},b^\{\+\}\)\)/\(B\+1\), whereb−b^\{\-\}andb\+b^\{\+\}count replicates below and above zero; atB=10,000B=10\{,\}000its minimum attainable value is approximately0\.00020\.0002\. Holm correction is applied jointly across the eleven comparisons in Table[8](https://arxiv.org/html/2609.22959#A2.T8); because every comparison attains the empirical floor, the common Holm\-adjusted value is0\.00220\.0022, and all eleven are rejected\. Exact\-set accuracy, which appears in the table, is the fraction of admissions whose reconstructed discharge regimen exactly matches the observed discharge regimen\.

Table 8:R\-GEAN improvements over each comparator with 95% patient\-paired bootstrap confidence intervals\. Positive values favor R\-GEAN\.
### B\.3Composite\-weight sensitivity

R\-GEAN ranks first under all six prespecified weighting schemes \(Table[9](https://arxiv.org/html/2609.22959#A2.T9)\) and under the unweighted component mean\. Over 20,000 random simplex weightings it ranks first in 94\.1% of settings and within the top three in 99\.99% \(worst rank four\); within the edit\-centric region \(addition\-F1\+\+removal\-F1 weight≥0\.5\\geq 0\.5; 9,981 weightings\) it ranks first in 94\.0% and within the top three in 100%\. R\-GEAN is also Pareto\-optimal over the four score components\. Random weightings are drawn from a uniform Dirichlet distribution over the four components \(seed 2026, 20,000 samples over all eleven systems\); ties are broken by the minimum rank; and a system is Pareto\-optimal if no other system is at least as high on all four components and strictly higher on one\.

Table 9:Prespecified composite\-weight schemes over addition F1, removal F1, changed\-admission Jaccard, and action macro\-F1\.
### B\.4MICRON, DualNN, and R\-GEAN comparison

Table[10](https://arxiv.org/html/2609.22959#A2.T10)compares the prediction settings and model structures of the adapted MICRON baseline, DualNN, and R\-GEAN\. Under the shared within\-admission setting, R\-GEAN differs from the adapted MICRON through its disjoint candidate spaces and candidate\-specific exposure\.

Table 10:Comparison of the adapted MICRON baseline, DualNN, and R\-GEAN under the within\-admission prediction setting\. MICRON columns describe the adapted implementation evaluated here; DualNN is listed as originally proposed and was not re\-evaluated\.

## Appendix CRobustness and Reproducibility

### C\.1Multiseed results

Each model is trained independently under seeds 2026–2028, and predictions are not pooled\. Table[11](https://arxiv.org/html/2609.22959#A3.T11)reports the exact seed\-specific edit composites and their arithmetic means\. R\-GEAN achieves the highest edit composite under all three seeds\.

For the multiseed robustness analysis, R\-GEAN uses the thresholds fixed under the original multiseed protocol,τ\+=0\.30\\tau^\{\+\}=0\.30andτ−=0\.65\\tau^\{\-\}=0\.65, across all three seeds\. These differ from the validation\-reselected primary thresholds,τ\+=0\.25\\tau^\{\+\}=0\.25andτ−=0\.65\\tau^\{\-\}=0\.65, used for the headline test result\. Comparison models select thresholds from their corresponding validation predictions\. We therefore interpret the multiseed analysis as a ranking robustness check rather than a fully protocol\-matched threshold comparison\.

Table 11:Seed\-specific edit composites and arithmetic means\. Means are calculated from the full\-precision seed\-specific results\.
### C\.2Parameter\-matched shared control

We widen the shared model to approximately match R\-GEAN’s parameter count without consulting test results\. Across three seeds, the matched shared model improves over the original shared model by 0\.0029 but remains 0\.0274 below R\-GEAN on average \(Table[12](https://arxiv.org/html/2609.22959#A3.T12)\)\. At seed 2026, the paired difference is 0\.0225 \(95% CI\[0\.0208,0\.0242\]\[0\.0208,0\.0242\]\)\. This control supports direction\-specific predictors beyond parameter count, although it does not isolate all architectural differences\.

Table 12:Three\-seed parameter\-matched comparison\. Models were retrained under a common capacity\-control protocol, so the shared\-model values differ slightly from the primary multiseed results\.
### C\.3R\-GEAN computational footprint

R\-GEAN contains 465,924 trainable parameters\. For the primary recorded run on a single NVIDIA RTX 4090 \(PyTorch 2\.5\.1, Python 3\.11\.8\), optimization took 31\.3 s for the addition branch and 4\.4 s for the removal branch, for 35\.7 s in total \(Table[13](https://arxiv.org/html/2609.22959#A3.T13)\)\. These measurements cover branch optimization only; preprocessing, data loading, validation, and inference are not included\. They describe the implementation footprint and are not intended as a controlled speed comparison with the baselines\.

Table 13:R\-GEAN parameter counts and recorded branch training times for the primary seed\-2026 run\.An end\-to\-end rerun of the data\-processing and evaluation pipeline reproduced the benchmark cohort, the 78\-class vocabulary, and the reported primary evaluation results\.

## Appendix DDiagnostic analyses

The primary comparison and confirmatory family were prespecified for seed 2026\. The analyses in this section are secondary controls and exploratory diagnostics on the same test split and are not treated as confirmatory\.

### D\.1Set\-level and edit\-level rankings

Models receive different rankings on the reconstructed discharge regimen and on the additions and removals directly \(Table[14](https://arxiv.org/html/2609.22959#A4.T14)\)\. The rank correlation between resulting\-set micro\-F1 and the edit composite is weak \(Spearmanρ=0\.20\\rho=0\.20,n=10n=10; no ties occur\)\. Spearman correlation is computed over the ten systems shown; SafeDrug is excluded because it is reported only as a sensitivity analysis\.

Table 14:Set\-level and edit\-level ranks for the ten systems included in the rank\-correlation analysis\. Rank 1 is best\.
### D\.2Component ablations

Table[15](https://arxiv.org/html/2609.22959#A4.T15)reports branch\-specific ablations with the other branch held fixed\. Candidate exposure contributes most to removal performance, whereas the interaction regularizer and prior history contribute most to addition performance\. Removing the class\-level priors slightly increases the aggregate composite but lowers rare\-addition recall@5 from approximately 0\.017 to 0\.002\.

Table 15:Complete component ablations on the test set\. The unmodified prediction direction is held fixed\.The final model retains the prespecified class\-level priors because they improve rare\-addition ranking, although removing them slightly increases the aggregate composite\. This secondary ablation was conducted after the primary architecture and test evaluation had been locked\.

### D\.3Cardinality and interaction regularization

The interaction\-derived regularizer mainly controls addition over\-prediction\. Table[16](https://arxiv.org/html/2609.22959#A4.T16)compares it with generic cardinality controls: a train\-derived count\-matching regularizer, using no interaction structure, reproduces the predictive effect of the interaction\-derived term, and the pair\-normalized interaction burden does not fall when the term is added\. We therefore read the term as over\-prediction \(cardinality\) control rather than interaction\-specific predictive information\.

The interaction termΩddi\\Omega\_\{\\mathrm\{ddi\}\}is a symmetric78×7878\\times 78class\-level matrix derived from the external TWOSIDES resource, remapped from drug ingredients to the 78 ATC3 classes, with zero diagonal and 2,918 unordered interacting class pairs, corresponding to 5,836 nonzero off\-diagonal matrix entries\. The addition penalty is∑i,jai​Ωi​j​Rj\\sum\_\{i,j\}a\_\{i\}\\,\\Omega\_\{ij\}\\,R\_\{j\}, whereaais the vector of predicted addition probabilities andR=min⁡\(1,MA\+a\)R=\\min\(1,\\,M\_\{A\}\+a\)is the addition\-adjusted regimen formed from the anchor regimenMAM\_\{A\}and the predicted additions\. The penalty therefore covers interactions between predicted additions and both the already\-present anchor medications and other predicted additions\. The pair\-normalized interaction burden is the expected number of interacting pairs in the predicted discharge regimen divided by the number of unordered regimen pairs\. The L1 expected\-count control penalizes the mean predicted addition count; the anchor\-size count\-matching control penalizes deviation from a train\-derived target countkik\_\{i\}equal to the mean number of true additions in the admission’s anchor\-size bin, using no target or action information\.

Table 16:Addition\-branch regularization \(removal branch fixed\): a count\-matching control reproduces the predictive effect of the interaction\-derived term\. Pair\-normalized interaction burden is 0\.983 without the term and 0\.994 with it\.
### D\.4Rare additions and calibration

Across the five models with stored rare\-class F1 results, performance is low for rare additions, and R\-GEAN attains the lowest rare\-addition F1 \(Table[17](https://arxiv.org/html/2609.22959#A4.T17)\)\. Rare additions are also poorly ranked before thresholding: recall@5 is 0\.017 for rare classes and zero in the lowest\-support quartile \(Table[18](https://arxiv.org/html/2609.22959#A4.T18)\)\. Recall@kkis the mean over true additions of the indicator that the class ranks within the topkkcandidates; MRR is the mean reciprocal rank; and macro\-AUPRC is the unweighted mean of per\-class average precision over candidate positions\. Classes with no test additions contribute no ranking events and are excluded from macro\-AUPRC\. Across the validation comparisons, focal, class\-balanced, and logit\-adjusted losses did not yield a stable improvement\. In the matched test rerun, the validation\-selected logit\-adjusted variant leaves rare\-class recall@5 at zero and lowers the composite from 0\.4629 to 0\.4593\.

Table 17:Addition F1 across the 39 classes in the bottom half of training\-set addition support\.Validation\-only isotonic calibration substantially reduces removal ECE while leaving F1 nearly unchanged \(Table[19](https://arxiv.org/html/2609.22959#A4.T19)\)\. Calibration uses 15 equal\-width probability bins; expected calibration error is computed at the candidate level, separately for the addition and removal directions\. Isotonic calibrators are fit on the validation candidate predictions only, one per direction, and applied once to the fixed test predictions; the reported F1 uses a threshold re\-selected on validation after calibration, and the Brier score is averaged over candidate cells\. Calibration therefore improves probability quality rather than edit recovery; raw probabilities should not be interpreted as clinical confidence\.

Table 18:Addition ranking quality by class\-frequency group\.Table 19:Validation\-only calibration\. Calibration improves probability quality with essentially unchanged thresholded F1\.
### D\.5Subgroup stress tests

Table[20](https://arxiv.org/html/2609.22959#A4.T20)reports performance across age band, sex, and admission type\. Performance is broadly similar across most age, sex, and admission\-type strata, although several small admission\-type groups show greater variation\. Age bands and admission\-type categories follow the recorded MIMIC\-IV fields, and each admission contributes to one subgroup per dimension\. These results are descriptive internal stress tests and do not constitute a comprehensive fairness or external\-validity analysis\.

Table 20:R\-GEAN performance by age band, sex, and admission type on the test split \(internal stress tests\)\.
### D\.6Removal\-label composition

True removals are dominated by anti\-infectives \(38\.2%\) and cardiovascular agents \(20\.9%\)\. Among medication orders active at 24 hours, 26\.1% have recorded durations of no more than one day\. To test whether the removal advantage is merely due to short courses ending, we performed a post\-hoc stratification of removal classes using their median anchor\-order duration on the test split \(Table[21](https://arxiv.org/html/2609.22959#A4.T21)\)\. This grouping was not used for training, threshold selection, or model selection\. R\-GEAN’s removal\-F1 advantage over RETAIN\-FullSet holds for both short\- and longer\-duration classes and is in fact larger for the latter, so it is not an artifact of short orders \(GAMENet\-FullSet removal F1 is 0\.599 and 0\.256 for the two strata\)\.

Table 21:Removal F1 by class order\-duration stratum\. Classes are grouped by their median anchor\-order duration on the test split for this post\-hoc diagnostic; the grouping was not used for training, threshold selection, or model selection\.
### D\.7Snapshot\-event coverage

The benchmark labels capture net differences between the 24\-hour and discharge snapshots rather than every intervening medication event\. Table[22](https://arxiv.org/html/2609.22959#A4.T22)classifies all 708,149 medication starts and stops between these landmarks\. Represented additions and removals directly alter snapshot membership; the remaining events are transient exposures, stop–restart sequences, or opposite\-direction events within classes that still receive a net edit label\.

Table 22:Complete mutually exclusive taxonomy of medication start and stop events occurring between the 24\-hour anchor and discharge\. Net snapshot labels are directly represented by the first two rows; the final two rows are opposite\-direction transitions of edit\-labeled classes with multiple within\-window episodes\.

Similar Articles

Claim-Selective Certification for High-Risk Medical Retrieval-Augmented Generation

arXiv cs.CL

This paper proposes claim-selective certification for high-risk medical retrieval-augmented generation (RAG), decomposing responses into verifiable claims and scoring them against evidence to produce actions (full, partial, conflict, abstain) using an intent-aware selector, achieving low unsupported-claim risk and high action accuracy.