Source-linked AI summary

HEM-Med: A Hierarchical Agentic Memory Framework for Safe Multi-Center Medication Recommendation

Min Xiao, Jin Li, Shoujin Wang, Yeguang Zhen, Yishuo Li, Wenpeng Lu

arXiv:2610.20191v2cs.AIcs.IR

TL;DR

Existing multi-center medication recommendation methods can entangle transferable clinical experience with hospital-specific prescribing patterns and overlook medication safety constraints. HEM-Med separates these types of experience and uses retrieval with safety-aware set decoding; on eICU, it surpasses transfer and general LLM baselines in accuracy and achieves the highest SafeScore.

  • Problem

    Existing multi-center methods may entangle transferable clinical experience with hospital-specific prescribing patterns and overlook treatment needs, DDI risks, and local formulary availability.

    Source: §I · p. 2
  • Method

    HEM-Med disentangles cross-hospital experience from hospital-specific residual patterns and combines dual-level retrieval with DDI-aware medication-set decoding.

    Source: §I · p. 2
  • Results

    HEM-Med surpasses transfer and general LLM baselines in accuracy and achieves the highest SafeScore, while eICU experiments show improved recommendation accuracy with competitive medication safety.

    Source: §I · p. 2, D. Result Analysis · p. 5
  • Takeaways & Limitations

    HEM-Med provides multi-center medication recommendations that account for hospital-specific prescribing patterns and medication safety constraints.

    Source: §VI · p. 6

Abstract

from arXiv · show

Medication recommendation (MR) is critical for clinical decision support. While existing MR methods are mostly designed for single-center learning, where only one independent hospital is involved, multi-center MR with hospitals of different scales has become increasingly demanding in practice. In multi center settings, abundant data from large medical centers can improve recommendation performance for low-resource centers. Despite a few preliminary attempts on this task, two critical gaps remain. Gap 1: Existing multi-center methods fail to disentangle transferable cross-hospital clinical experience from hospital-specific prescribing patterns, limiting clinical feasibility and physician acceptance. Gap 2: They commonly overlook multi label safety constraints of MR, including drug-drug interaction risks and local formulary feasibility, which are essential for safe real-world deployment. To address these gaps, we propose HEM-Med, a novel hierarchical agentic memory framework for multi-center MR. To address Gap 1, we design a disentangled hierarchical memory module that builds patient-level medication context attribution records and disentangles them into cross hospital experience memory and hospital-specific residual memory. To address Gap 2, we introduce a safety-aware medication set generation module, which integrates dual-level experience retrieval with safety-aware set decoding to produce clinically relevant, safer, and locally adaptive medication recommendations. Experiments on a real-world multi-center eICU dataset show that HEM-Med outperforms representative transfer learning, LLM-based, and MR baselines in terms of both recommendation accuracy and safety.

I. INTRODUCTION

Multi-center medication recommendation seeks to address limits of single-center learning, but existing approaches can entangle transferable clinical experience with hospital-specific prescribing patterns and overlook safety constraints. HEM-Med separates these kinds of experience and combines dual-level retrieval with safety-aware medication-set generation.

A. Medication Recommendation

  • Single-center medication recommendation methods rely on local data and may perform poorly in low-resource hospitals because of data sparsity and cold-start issues.Representative methods include GAMENet, SafeDrug, and DKGM –.Source: §I · p. 1

I. INTRODUCTION

  • Existing multi-center methods may transfer entangled prescribing knowledge that reflects hospital resources, protocols, and preferences, while overlooking treatment needs, DDI risks, and local formulary availability.Such transfer may cause negative transfer, and ignoring safety constraints may yield inappropriate or unsafe medication combinations.Source: §I · p. 2
  • HEM-Med separates transferable cross-hospital clinical experience from hospital-specific prescribing patterns and adds safety-aware medication-set generation for multi-center recommendation.Its generation module combines dual-level retrieval with DDI-aware decoding to produce clinically relevant, safer, and locally adaptive recommendations.Source: §I · p. 2
  • Experiments on the eICU dataset show that HEM-Med improves recommendation accuracy while maintaining competitive medication safety.The introduction identifies this as an evaluation on a real-world multi-center dataset.Source: §I · p. 2

A. Medication Recommendation

  • Multi-center transfer addresses the single-center setting, but existing methods still face entangled knowledge and insufficient safety awareness.The paper frames these as two gaps for multi-center medication recommendation.Source: A. Medication Recommendation · p. 2, §I · p. 2

B. Cross-Domain Transfer and Multi-Center Learning

Prior cross-domain and multi-center transfer methods share knowledge to address data sparsity, while LLM-based approaches use semantic reasoning and retrieval or tools. This paper also describes multi-center ICU records, clinical anchors, and drug-interaction knowledge as components of the problem setting.

B. Cross-Domain Transfer and Multi-Center Learning

  • General cross-domain recommendation aligns domain representations, while TEMPT uses pre-training and prompt-tuning; neither approach explicitly resolves the stated combination-therapy, DDI, and consensus–preference concerns.The passage describes these concerns as limitations of general CDR and medical transfer approaches.Source: B. Cross-Domain Transfer and… · p. 2

C. LLM Agents and Knowledge-Augmented Healthcare

  • LLM-based clinical decision support includes multi-agent collaboration and retrieval- or tool-augmented reasoning, but prompt-based integration often lacks separation of general safety principles from hospital-specific execution rules.Examples include MedAgents and MDTeamGPT, [26], and ClinicalGPT, TxAgent, JointCoder, and SOAPTriage [27]–.Source: C. LLM Agents and Knowledge-Augmented… · p. 2

A. Multi-Center Electronic Health Records Data

  • Multi-center EHR data consist of independent ICU records from multiple hospitals, with diagnoses, procedures, abnormal laboratory signals, and medications represented as vocabularies.Each record associates observed clinical information and medications with a hospital identifier.Source: A. Multi-Center Electronic Health… · p. 2

B. Clinical Anchors

  • Clinical anchors are observed diagnoses, procedures, and abnormal laboratory signals, each representing a typed clinical signal.Source: B. Clinical Anchors · p. 2

C. Drug-Drug Interaction Knowledge

  • The drug-interaction knowledge is represented as a graph whose medication-pair edges indicate potential interactions and carry severity scores.The graph uses the standardized medication vocabulary as its nodes.Source: C. Drug-Drug Interaction Knowledge · p. 2

D. Medication Recommendation

HEM-Med combines consensus–residual memory disentanglement with safety-aware recommendation, while building auditable patient-level medication-context records through constrained attribution.

D. Medication Recommendation

  • The model estimates conditional medication relevance scores from observed clinical context and decodes them into a recommended medication set.The input is defined for the current EHR instance.Source: D. Medication Recommendation · p. 3

IV. METHOD

  • HEM-Med separates historical medication–context experience into cross-hospital consensus and hospital-specific residual memories, then combines dual-level retrieval with safety-aware recommendation.The recommendation pipeline includes experience-aware reranking, DDI-aware set decoding, and safety review.Source: §IV · p. 3

A. Patient-Level Attribution Memory

  • HEM-Med builds auditable L3 patient-level memory because raw ICU EHRs lack explicit medication links to diagnoses, procedures, or laboratory abnormalities.The records use constrained DeepSeek-assisted attribution.Source: A. Patient-Level Attribution Memory · p. 3
  • For each training stay and observed medication, HEM-Med constructs a stay–medication query using the hospital and observed clinical context.The context comprises diagnoses, procedures, and abnormal laboratory signals.Source: A. Patient-Level Attribution Memory · p. 3
  • Constrained attribution selects at most one observed context anchor without adding external indications or clinical facts.When context is insufficient, attribution is empty and remains an empirical hypothesis rather than verified intention, indication, or causation.Source: A. Patient-Level Attribution Memory · p. 3
  • Three clinicians reviewing 300 randomly sampled L3 records yielded Fleiss’ κ of 0.813 for anchor selection and 0.726 for attribution assessment.Source: A. Patient-Level Attribution Memory · p. 3

B. Consensus and Residual Memory Disentanglement

HEM-Med separates cross-hospital consensus associations from hospital-specific residual patterns, while retaining weaker associations at reduced retrieval weight.

B. Consensus and Residual Memory Disentanglement

  • HEM-Med separates patient-level records into cross-hospital experience and hospital-specific residual memories.Source: B. Consensus and Residual Memory… · p. 3
  • Cross-hospital consensus memory retains anchor–medication associations meeting support, frequency, and hospital-coverage constraints.The support vector includes anchor and co-occurrence counts and their hospital coverage; retained associations must also meet a conditional-frequency threshold.Source: B. Consensus and Residual Memory… · p. 3
  • Hospital-specific residual memory retains locally supported associations whose residual deviation meets predefined thresholds, complementing consensus memory with local prescribing patterns.Residual patterns are classified as amplified, suppressed, or localized.Source: B. Consensus and Residual Memory… · p. 3
  • Weak L1 and L2 associations are retained to support recall for long-tail medications and rare contexts, but are down-weighted so they cannot dominate strong experience.Weak L1 reflects relaxed cross-hospital criteria; weak L2 reflects relaxed local support, frequency, and residual-deviation criteria.Source: B. Consensus and Residual Memory… · pp. 3–4

C. Candidate Generation

Candidate generation retrieves medication–context experience from cross-hospital and hospital-specific memories, combines it with prior statistics and safety-aware scoring, and passes top-ranked candidates to reranking.

C. Candidate Generation

  • For the current hospital and clinical anchors, HEM-Med retrieves experience from cross-hospital and hospital-specific memories to form a candidate medication pool.Source: C. Candidate Generation · p. 4
  • The memory-based experience score aggregates the L1 and L2 experience scores.Prior statistics also score medications using global, hospital, anchor, and hospital–anchor frequencies to reduce bias toward globally frequent medications.Source: C. Candidate Generation · p. 4
  • Initial candidate scoring compensates for under-retrieval and applies a soft DDI-based safety penalty before ranking medications.Source: C. Candidate Generation · p. 4
  • The top-ranked medications form a retained-size candidate pool that is passed to the learned experience reranker for calibration and selection.Source: C. Candidate Generation · p. 4

D. Experience Reranking and Safety Review

HEM-Med calibrates candidate medication probabilities and predicts set size, then uses safety-constrained set decoding to account for DDI risk and redundancy.

D. Experience Reranking and Safety Review

E. Model Training

HEM-Med trains complementary medication-level and set-level predictors, then combines their outputs only during inference for calibrated reranking and DDI-aware decoding.

E. Model Training

  • Weighted binary cross-entropy trains medication-level predictions, with medication-specific weights addressing frequency imbalance.Each candidate medication receives a binary label based on whether it appears in the ground-truth set.Source: E. Model Training · p. 5
  • A pairwise ranking loss uses positive–negative medication pairs to improve candidate ranking.Pairs comprise a ground-truth medication in the candidate pool and a candidate medication absent from the ground-truth set.Source: E. Model Training · p. 5
  • The set-size predictor is trained to predict the ground-truth medication-set size rather than relying on a Top-K threshold.Its target is the size of the ground-truth medication set.Source: E. Model Training · p. 5
  • Pointwise, pairwise, therapeutic-class, and medication-count submodules are trained separately and combined only at inference for calibrated reranking and DDI-aware set decoding.DDI knowledge contributes candidate-level safety penalties and final decoding, not additional supervision.Source: E. Model Training · p. 5

V. EXPERIMENT

The experiments use a processed multi-center eICU ICU cohort and evaluate medication-set overlap, ranking, safety, and the accuracy–safety trade-off.

A. Dataset

  • The processed eICU cohort contains over 200,000 de-identified ICU admissions, and ground-truth medication sets have an approximately 11.66% DDI Rate.Table I reports processed-dataset statistics.Source: A. Dataset · p. 5, Table I · p. 5

B. Evaluation Metrics

  • Evaluation measures set overlap with Jaccard and F1, ranking with PRAUC, and safety with DDI Rate, the proportion of potentially interacting predicted medication pairs.The measures follow prior studies,,.Source: B. Evaluation Metrics · p. 5
  • SafeScore summarizes overall performance, with higher values indicating a better accuracy–safety trade-off.Source: B. Evaluation Metrics · p. 5

C. Implementation Details

On eICU, HEM-Med surpasses transfer and general LLM baselines in accuracy and achieves the highest SafeScore; its implementation uses a held-out split and fixed test settings.

C. Implementation Details

  • The data are split into training, validation, and test sets at an 8:1:1 ratio, with memory statistics and prior distributions built only from training data to avoid leakage.Memory-construction thresholds are reliability filters rather than primary model-selection hyperparameters.Source: C. Implementation Details · p. 5
  • The final experiments use candidate depth 60 and weak-experience decay factor 0.42; all baselines share the data split, medication vocabulary, DDI file, and random seed.Other parameters are validation-selected and fixed during testing.Source: C. Implementation Details · p. 5

D. Result Analysis

  • Baselines include transfer-learning, general LLM, and medication-recommendation methods, evaluated across 10 bootstrap samples at a 0.8 sampling ratio.Reported metrics are means and standard deviations.Source: D. Result Analysis · p. 5
  • HEM-Med surpasses transfer and general LLM baselines in accuracy and achieves the highest SafeScore, while improving the accuracy–safety trade-off over SafeDrug.Table II reports the main eICU experimental results.Source: D. Result Analysis · pp. 5–6, Table II · p. 6

E. Ablation Study

Ablations, parameter analyses, and ICU case comparisons probe HEM-Med’s components and behavior; the conclusion identifies richer safety constraints and prospective validation as future work.

E. Ablation Study

  • Removing memory decoupling, DDI-aware decoding, experience reranking, or weak auxiliary memory degrades performance, while full HEM-Med achieves the best overall performance.The ablations support the contributions of each of these components.Source: E. Ablation Study · p. 6

F. Parameter Analysis

  • At candidate depth 60, weak-experience weight 0.42 performs best; higher weight degrades performance, while a larger candidate depth adds noisy candidates and false positives.A smaller candidate depth may miss relevant medications before reranking; the selected depth and weight are both 60 and 0.42.Source: F. Parameter Analysis · p. 6, Figure 3 · p. 6

G. Case Study

  • Across two clinically similar stays from different hospitals, HEM-Med matches medication sets while preserving shared electrolyte medications and identifying case-specific Furosemide and Hydralazine needs.The cases illustrate integration of cross-hospital common knowledge, hospital-specific experience, and safety-aware decoding.Source: G. Case Study · p. 6, Table IV · p. 7

VI. CONCLUSION

  • The conclusion reports improved recommendation accuracy while maintaining medication safety on real-world multi-center eICU data, and proposes richer clinical constraints, finer-grained medication safety knowledge, and prospective validation as future work.Source: §VI · p. 6
Loading 2610.20191v2…