Self-Supervised Representation Learning for Longitudinal Polypharmacy Patterns
Abstract
Polypharmacy, commonly defined as the concurrent use of multiple medications, is increasingly prevalent in aging populations and is associated with adverse health outcomes. Motivated by longitudinal studies of aging people with HIV (PWH), we study how medication use evolves over time and characterizes multimorbidity patterns. Longitudinal medication data present substantial methodological challenges, including high dimensionality, sparsity, irregular observation times, and structured pharmacologic relationships among medications. Existing approaches are typically task-specific and lack a unified framework for learning general-purpose representations of medication trajectories. We propose LOPEL (LOngitudinal Polypharmacy Embedding Learning), a two-stage self-supervised framework for learning low-dimensional representations of longitudinal medication data. In the first stage, visit-level embeddings are learned using a Gaussian process model that incorporates pharmacologic similarity through the Anatomical Therapeutic Chemical hierarchy. In the second stage, subject-level embeddings are constructed by modeling trajectories over time and defining similarity through a Wasserstein-based representation capturing temporal dynamics and uncertainty. Simulation studies demonstrate that LOPEL accurately recovers latent structure under realistic conditions with high-dimensional sparsity and irregular sampling. In an application to aging cohorts of PWH, LOPEL identifies clinically meaningful subgroups that differ in the timing, composition, and progression of medication use, highlighting heterogeneity relevant for risk stratification and clinical management.
Keywords
Cite
@article{arxiv.2608.06743,
title = {Self-Supervised Representation Learning for Longitudinal Polypharmacy Patterns},
author = {Yunshan Duan and Eero Korpela and Yanxun Xu},
journal= {arXiv preprint arXiv:2608.06743},
year = {2026}
}