Table of Contents
Fetching ...

HypeMed: Enhancing Medication Recommendations with Hypergraph-Based Patient Relationships

Xiangxu Zhang, Xiao Zhou, Hongteng Xu, Jianxun Lian

Abstract

Medication recommendations aim to generate safe and effective medication sets from health records. However, accurately recommending medications hinges on inferring a patient's latent clinical condition from sparse and noisy observations, which requires both (i) preserving the visit-level combinatorial semantics of co-occurring entities and (ii) leveraging informative historical references through effective, visit-conditioned retrieval. Most existing methods fall short in one of both aspects: graph-based modeling often fragments higher-order intra-visit patterns into pairwise relations, while inter-visit augmentation methods commonly exhibit an imbalance between learning a globally stable representation space and performing dynamic retrieval within it. To address these limitations, this paper proposes HypeMed, a two-stage hypergraph-based framework unifying intra-visit coherence modeling and inter-visit augmentation. HypeMed consists of two core modules: MedRep for representation pre-training, and SimMR for similarity-enhanced recommendation. In the first stage, MedRep encodes clinical visits as hyperedges via knowledge-aware contrastive pre-training, creating a globally consistent, retrieval-friendly embedding space. In the second stage, SimMR performs dynamic retrieval within this space, fusing retrieved references with the patient's longitudinal data to refine medication prediction. Evaluation on real-world benchmarks shows that HypeMed outperforms state-of-the-art baselines in both recommendation precision and DDI reduction, simultaneously enhancing the effectiveness and safety of clinical decision support.

HypeMed: Enhancing Medication Recommendations with Hypergraph-Based Patient Relationships

Abstract

Medication recommendations aim to generate safe and effective medication sets from health records. However, accurately recommending medications hinges on inferring a patient's latent clinical condition from sparse and noisy observations, which requires both (i) preserving the visit-level combinatorial semantics of co-occurring entities and (ii) leveraging informative historical references through effective, visit-conditioned retrieval. Most existing methods fall short in one of both aspects: graph-based modeling often fragments higher-order intra-visit patterns into pairwise relations, while inter-visit augmentation methods commonly exhibit an imbalance between learning a globally stable representation space and performing dynamic retrieval within it. To address these limitations, this paper proposes HypeMed, a two-stage hypergraph-based framework unifying intra-visit coherence modeling and inter-visit augmentation. HypeMed consists of two core modules: MedRep for representation pre-training, and SimMR for similarity-enhanced recommendation. In the first stage, MedRep encodes clinical visits as hyperedges via knowledge-aware contrastive pre-training, creating a globally consistent, retrieval-friendly embedding space. In the second stage, SimMR performs dynamic retrieval within this space, fusing retrieved references with the patient's longitudinal data to refine medication prediction. Evaluation on real-world benchmarks shows that HypeMed outperforms state-of-the-art baselines in both recommendation precision and DDI reduction, simultaneously enhancing the effectiveness and safety of clinical decision support.
Paper Structure (33 sections, 16 equations, 8 figures, 12 tables, 2 algorithms)

This paper contains 33 sections, 16 equations, 8 figures, 12 tables, 2 algorithms.

Figures (8)

  • Figure 1: Overview of Bob's EHR spanning four medical visits. Each visit includes diagnosis, procedure, and medication codes, illustrating the progression of related respiratory conditions over time. Note that the medication section in Visit-4 is left unfilled, indicating it as the target for medication recommendation.
  • Figure 2: An example of a hypergraph with four nodes and two hyperedges: $e_1$ connects nodes $n_1$, $n_2$, and $n_3$, while $e_2$ connects nodes $n_3$ and $n_4$.
  • Figure 3: Overall architecture of HypeMed. HypeMed comprises two stages: the Medical Entity Relevance Representation Stage (MedRep) and the Similar Visit Enhanced Medication Recommendation Stage (SimMR). MedRep focuses on encoding intra-visit set-level combinatorial semantics into a globally consistent, retrieval-friendly embedding space. SimMR integrates longitudinal history and visit-conditioned retrieved similar visits to refine latent condition estimation.
  • Figure 4: The detailed architecture of the Knowledge-aware Hypergraph Encoder (KHGE). The encoder consists of a Local Message Passing Network (LMPN) and a Knowledge-aware Global Attention Network (KGAN). The LMPN focuses on message propagation over the medical hypergraph, while the KGAN integrates medical knowledge into a global self-attention mechanism. The two outputs are combined through a feed-forward fusion layer with residual connections.
  • Figure 5: Visualization of adaptive channel weighting and its association with model performance across different visit lengths. Blue and orange dots represent per-visit gate weights for the history and similarity channels, respectively. Black and purple lines indicate the Spearman correlations ($\rho$) between Jaccard performance and each channel’s weight, computed within visit-length groups. To ensure statistical reliability, visit-length groups with fewer than 20 samples were excluded.
  • ...and 3 more figures