Abstract
Objective
The analysis of care trajectories derived from electronic health records and claims data has become increasingly common in biomedical informatics. This has enabled large-scale studies of care processes, yet widely used binary code representations result in high-dimensional, sparse data that fail to capture semantic relationships between medical concepts. Learning dense vector representations (embeddings) has emerged as a promising approach to address these limitations. We aimed to construct and share joint embeddings for the International Classification of Diseases (ICD-10) and the Anatomical Therapeutic Chemical (ATC) classification system, providing reusable semantic representations of diagnoses and treatments from real-world claims data.
Materials and Methods
Using claims records from 1.5 million patients, we defined code co-occurrences within temporal windows and constructed a Positive Pointwise Mutual Information (PPMI) matrix spanning ICD-10 and ATC codes. Singular Value Decomposition (SVD) was applied to derive a low-dimensional embedding space. Evaluation combined UMAP visualization, nearest-neighbor retrieval, and a code-level classification task based on ICD chapters and ATC classes.
Results
The embeddings reflected the hierarchical organization of ICD-10 and ATC and revealed associations across coding systems, including clinically relevant diagnosis-treatment relationships. The classification task achieved mean AUCs of 0.93 for ICD-10 and 0.90 for ATC, indicating strong grouping of semantically related codes.
Discussion
The embeddings provide a reusable, code-level semantic representation that can support code retrieval, reduce manual code grouping, and be aggregated into patient-level features without training a task-specific model.
Conclusion
We release the first openly available joint ICD-10–ATC embedding space derived from real-world claims data, providing a reusable resource for biomedical informatics research.
Keywords: electronic health records, knowledge representation, medical codes, ICD-10, anatomical therapeutic chemical classification system
Introduction
The use of electronic health records (EHRs) and insurance claims data for secondary research has increased in recent years.1 The routine collection of data by insurance companies and national health systems provides information to study care trajectories. Claims databases contain the coded history of patient medical events, along with their associated timestamps. These events include diagnoses, prescribed treatments, procedures, medical devices, and are described using medical codes from classification systems and terminologies, such as ICD-10, ATC, and RxNorm.
Modeling patients’ care pathways within large-scale health data is of major interest, as it can help address important questions, such as which trajectories are associated with better outcomes, the natural history of diseases, or adherence to clinical recommendations. However, extracting such pathways remains a challenge given the complexity of claims databases. The temporal structure, heterogeneity, and sparsity of claims data pose significant methodological challenges,2 particularly due to the large number of medical codes used to describe clinical events. This high cardinality problem makes prior selection and grouping of codes necessary, which can be time-consuming and error-prone. In addition, many codes are related to the same underlying medical concept, eg the ICD-10 code for type 2 diabetes is related to the ATC code for metformin. These semantic relationships are usually not captured by traditional analysis tools.
A variety of statistical learning methods have been applied to analyze care trajectories, including feature-based, distance-based, and model-based methods.3 Feature-based approaches have been applied, for example, by Righolt et al4 to study metformin prescription patterns. Distance-based analyses have been used by Vanasse et al5 to investigate care trajectories in chronic obstructive pulmonary disease. Model-based strategies, such as mixtures of Hidden Markov Models, were applied by Hilton et al6 to characterize subgroups of children with asthma.
While these approaches have provided valuable insights, they share a key limitation: they usually require manual selection of medical codes or key elements of the care pathway. Given the large number of codes and events in claims and EHR data, this requirement severely restricts scalability and risks overlooking clinically meaningful patterns. A central reason for this limitation lies in the sparse vector representations commonly used to encode medical codes, such as bag-of-words or TF-IDF schemes.7,8 In such representations, codes are treated as independent features, ignoring their semantic relationships. As a result, clinically related events or pathways may appear unrelated, limiting meaningful comparison.
Recent work has therefore explored dense vector representations (embeddings) to represent medical codes.9 These approaches map each code to a low-dimensional vector such that semantically related codes are positioned close to one another in the latent space. Because they can be learned from standardized code co-occurrences rather than free text, such embeddings are not tied to a specific natural language. These embeddings capture semantic relationships between codes and can serve as inputs for downstream tasks. In addition, they facilitate exploration of code relationships and enable similarity-based retrieval of clinically related medical concepts.
In many recent works, representations are learned within predictive models, where embeddings are constructed in the hidden layers of neural networks and optimized for a specific outcome.10 While effective, the resulting representations are inherently task-specific and may not transfer easily across applications without retraining.11 In contrast, unsupervised embeddings are learned from large collections of unlabeled care sequences independently of a prediction objective. As a result, they capture more general semantic structure in the data and can be reused as feature representations across downstream tasks.12–14
A number of works have applied unsupervised methods to obtain embeddings for medical codes. Kartchner et al15 used GloVe16 on diagnosis codes, Choi et al17 applied Skip-Gram18 to ICD-9 and CPT procedure codes, and Hong et al19 employed PMI factorization to embed PheCodes and RxNorm codes in a shared space.
Despite these advances, there are currently, to our knowledge, no pre-trained, open-source embeddings that jointly represent codes from the International Classification of Diseases, Tenth Edition (ICD-10) and the Anatomical Therapeutic Chemical (ATC) classification system, 2 standardized coding systems widely used in EHR and claims data. For this reason, the objective of this work was to obtain unsupervised, task-agnostic, static embeddings that capture semantic relationships across both coding systems. These representations can contribute to digital health applications such as phenotyping, risk prediction, and treatment pattern analysis, by providing reusable feature representations that reduce the need for manual code grouping. In particular, they enable patient-level representations through simple aggregation of code embeddings.
This work is organized as follows. We first present the embedding method. We then describe the evaluation process, combining qualitative analyses of the embedding space with quantitative assessment through code-level classification tasks. In addition, a patient-level classification example based on longitudinal claims data is provided in the Supplementary Material to illustrate how the embeddings can be used in a real-world setting. Finally, we discuss the main findings, limitations, and directions for future work.
Methods
This section describes the methodological approach, comprising 3 components: (i) the claims data structure we consider, (ii) construction of code embeddings from claims data using Singular Value Decomposition on the Positive Pointwise Mutual Information matrix (PPMI-SVD), and (iii) their evaluation through qualitative and quantitative analyses.
Claims data structure
We consider claims data organized as patient-level sequences of time-stamped medical events. Each event corresponds to a diagnosis, treatment, procedure, or device, encoded using standard medical classification systems. For embedding computation, we use only the event codes and their temporal ordering.
Embedding through PPMI-SVD
The PPMI-SVD approach aims to capture semantic relationships between medical codes through their co-occurrence patterns. Each embedding vector represents the association profile of a code with all others, so codes are considered similar when these profiles are alike. This reflects second-order similarity rather than direct correlation. Mutually exclusive events such as alternative treatments for the same condition may be embedded close together if they occur in comparable clinical contexts. Additional details on the data structure and co-occurrence computation are provided in File S1.
PPMI matrix construction
Let denote the number of times that codes and co-occur within the same temporal context window across all care sequences. Let and represent the marginal counts of codes and , respectively.
The total number of co-occurrence observations is given by:
These counts provide empirical estimates of the underlying probabilities:
The Pointwise Mutual Information (PMI) between codes and is defined as:
A higher PMI indicates that 2 codes co-occur more often than expected by chance, while a negative PMI implies the opposite. To retain only informative associations, we use the Positive PMI (PPMI):
The resulting PPMI matrix is a square, symmetric matrix where each entry encodes the degree of association between 2 medical codes. In practice, several temporal context window sizes, ranging from same-day to several months, were tested, and performance remained stable across the tested values. We retained a 10-day window as a short-term clinical context comparable to the scale of hospital-stay episodes.
Matrix factorization through SVD
Although the PPMI matrix captures semantic information, it remains high-dimensional and sparse: its size equals the number of distinct codes, and entries are zero for code pairs that never co-occur.
To obtain compact representations, we apply Singular Value Decomposition (SVD). The PPMI matrix is factorized as:
where and are orthogonal matrices and is the diagonal matrix of singular values.
Truncating to the top singular values gives and . The embedding matrix is then defined as:
where each row corresponds to the embedding vector of code . Dimensionality d = 150 was chosen for our final representations, as the leading singular values capture most of the information contained in the PPMI matrix (File S2).
Evaluation of resulting embeddings
Evaluating the quality of the embeddings is challenging, as no gold standard exists for a joint representation of ICD-10 and ATC codes. We therefore combined 2 complementary approaches. The qualitative evaluation assessed the medical coherence of the latent space using visualization and neighborhood analyses. The quantitative evaluation assessed whether embeddings capture coding system-level information by predicting ICD-10 chapters and ATC classes in a supervised classification task. In addition, a patient-level classification example based on longitudinal claims data is provided in File S3 to illustrate how code embeddings can be aggregated to construct patient-level representations for amyotrophic lateral sclerosis (ALS) prediction.
Qualitative assessment through neighborhood analysis and UMAP visualization
Let denote the embedding vectors associated with the distinct medical codes, each . Pairwise similarity between codes is measured using cosine similarity:
which defines the symmetric similarity matrix . On this basis, we carried out 3 complementary exploratory analyses:
We applied UMAP20 to obtain a 2-dimensional representation of the embeddings. UMAP preserves neighborhood relations defined by , allowing both global clusters and local semantic patterns to be visualized.
We examined local structure by retrieving the nearest neighbors of randomly selected codes according to cosine similarity, to assess whether proximity in the embedding space reflects clinically meaningful relations.
We constructed a semantic network in which nodes represent codes and edges connect pairs with similarity above a threshold . This sparse graph provides an interpretable, network-based view of local semantic structure that complements the UMAP projection and nearest-neighbor analysis.
Sampling variability and neighborhood stability analysis
Since co-occurrence patterns in claims data can fluctuate substantially, in particular for rare codes, we evaluated the sampling-driven variability of our embeddings. To do so, we trained 2 additional embedding spaces on non-overlapping subsamples of the original data. We then assessed how stable the local neighborhoods remain across both spaces. For each code , we computed the Neighborhood Stability, defined as the proportion of its -nearest neighbors preserved across the 2 spaces:
where and denote the top- neighbors of in the first and second embedding spaces. A value of 1 indicates identical neighborhoods, whereas 0 indicates no shared neighbors. Neighborhood Stability was examined as a function of code frequency.
Quantitative assessment through code chapter classification
While exploratory analysis gives a general idea of the resulting embeddings’ coherence, a common approach for embedding evaluation is to use them as input to a supervised task. We performed a code classification task, aiming to predict the ICD-10 chapter or ATC class of a code, given its embedding as input.
Code classification was performed using a multinomial logistic regression model. Separate models were trained for ICD-10 and ATC codes. In this setting, predictive performance reflects the extent to which codes from the same chapter or class form coherent groups and can be discriminated by a linear classifier in the embedding space. Since the purpose of this task was to assess whether embeddings encode semantic information, no attempt was made to optimize predictive performance beyond this simple baseline.
Model performance was evaluated using repeated stratified 11 × 10-fold cross-validation (10 folds repeated 11 times with different random seeds). For each fold, class-probability predictions were obtained, and one-vs-rest AUC values were computed for every class. Performance was summarized using the mean AUC and its standard deviation (SD) across all 110 folds, providing a robust estimate of how consistently the embeddings capture the hierarchical organization of ICD-10 and ATC. Figure 1 illustrates the overall embedding computation and evaluation pipeline.
Figure 1.

Overview of the proposed pipeline: (1) Data preprocessing: raw logs are filtered, converted into timed sequences of codes; (2) Embedding computation: co‐occurrence counts are converted into a pointwise mutual information matrix and factorized to produce low‐dimensional ICD-10/ATC code embeddings; (3) Evaluation: embedding quality is assessed using UMAP visualization, nearest‐neighbor retrieval, and supervised ICD-10 chapter/ATC class prediction.
Results
Dataset description
We computed the embeddings using the Échantillon du Système National des Données de Santé (ESND),21 a French national claims database covering all reimbursed healthcare consumption for a representative sample of 1.5 million individuals over a 15-year period. The ESND provides comprehensive coverage of diagnoses (ICD-10), medications (ATC), procedures, medical devices, and laboratory tests, offering the contextual information needed to learn robust code representations.
For sampling-variability analysis, we used 2 non-overlapping subsamples of the ESND, comprising 200 000 patient sequences each. They were used exclusively to compute neighborhood stability. The final embeddings released in this work were obtained from the full 1.5 million sequences.
Individual-level data from the ESND are pseudonymized and were accessed through the permanent authorization granted to the French National Institute for Research in Digital Science and Technology (Inria) by the Caisse Nationale de l’Assurance Maladie (CNAM), within the framework of the Système National des Données de Santé. Use of these data is limited to research and general-interest purposes in accordance with Article L.1461-1 of the Code de la santé publique. All processing complies with the General Data Protection Regulation (GDPR) and the French Data Protection Act.
Embeddings were obtained for codes belonging to the ESND dataset (N = 37 979). However, we only performed evaluation on ICD-10 codes (N = 10 580) and ATC codes (N = 1526), as the others are based on French classification systems. Additional details on code counts and code frequency distributions are provided in File S4.
Code embedding evaluation
Exploratory analysis
To assess whether the embeddings capture clinically meaningful structure, we examined their organization in the latent space. Semantically related codes are expected to cluster together, forming regions corresponding to broad medical concepts.
UMAP visualization
The UMAP projection was used to visualize the global and local structure of the embedding space for a subset of codes (Figure 2).
Figure 2.

UMAP projection of a representative sample of ICD-10 and ATC code embeddings in 2 dimensions. Each code is colored with respect to its ICD-10 Chapter or ATC Class. Distinct clusters correspond to relevant semantic groupings within and across chapters, illustrating how embeddings capture both intra- and inter-chapter relationships.
On the broadest scale, codes belonging to the same ICD-10 chapter or ATC class tend to group within the same neighborhood of the embedding space, forming large clusters that reflect broad medical themes. For example, codes from the ICD-10 Neoplasms chapter, such as C79.6 (Secondary malignant neoplasm of ovary) and C16.9 (Malignant neoplasm of the stomach, unspecified), occupy the same region. Similarly, codes from ATC class N (Nervous System), including N03AA03 (Primidone) and N06AA17 (Amoxapine), cluster together. This large-scale organization, which reproduces established ICD-10 and ATC groupings, indicates that the embeddings capture semantic structure consistent with existing medical classifications.
At a finer scale, the latent space contains smaller clusters that correspond to specific medical subtopics and cross-chapter associations. Neoplasm-related codes, for example, form distinct regions according to anatomical site, and these regions also include non-neoplasm codes associated with the same locations. Codes related to sinus tumors, such as C31.2 (Malignant neoplasm of frontal sinus), appear near sinus-related respiratory codes like J32.3 (Chronic sphenoidal sinusitis) and J33.0 (Polyp of nasal cavity). Similarly, D14.1 (Benign neoplasm of larynx) is located close to J37.0 (Chronic laryngitis) and J38.6 (Stenosis of larynx).
This pattern extends beyond neoplasm sites. Codes such as H68.0 (Eustachian salpingitis) and H65.9 (Unspecified nonsuppurative otitis media) cluster near J35.3 (Hypertrophy of tonsils with hypertrophy of adenoids) and J31.2 (Chronic pharyngitis), despite belonging to different ICD-10 chapters. These local structures show that relationships between conditions of the middle ear and lymphoid organs are accurately reflected in the embedding space.
Overall, these small-scale clusters, together with the large-scale organization observed earlier, demonstrate that the embeddings capture both hierarchical structure and clinically meaningful cross-chapter associations.
Nearest-neighbor search
We assessed the local coherence of the embedding space and its ability to retrieve clinically related codes across multiple coding systems by examining the nearest neighbors of 4 ICD-10 codes. For each target code, we identified the 5 closest neighbors using cosine similarity; neighbors could belong to ICD-10, ATC, or a French procedure classification (Table 1). Each neighborhood can be visualized as a local semantic network; Figure 3 shows the subnetwork for B16.9 (Acute hepatitis B).
Table 1.
Five nearest neighbors (by cosine similarity) for 4 example ICD-10 codes.
| Target Code | Related Diagnoses (ICD-10) | Related Treatments (ATC) | Related procedures (French classification system) |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Neighbors were selected from ICD-10, ATC, and a French classification system for procedure codes.
Figure 3.

Semantic subnetwork for ICD-10 code B16.9 (acute hepatitis B): nodes represent the target code and its closest neighbors with respect to cosine similarity across ICD-10, ATC, and the French classification system for procedures (threshold = 0.5).
The neighborhood of B16.9 includes ICD-10 codes for related viral hepatitis conditions such as B18.0 (Chronic viral hepatitis B with delta-agent), B18.1 (Chronic viral hepatitis B without delta-agent), and B15.9 (Hepatitis A without hepatic coma). It also retrieves ATC codes for medications frequently prescribed in hepatitis care, including J05AP08 (Sofosbuvir), A07AA11 (Rifaximin), J05AP01 (Ribavirin), and J06BB04 (Hepatitis B immunoglobulin). These treatments span several ATC chapters, indicating that the embeddings recover semantic relationships across coding systems rather than relying solely on hierarchical proximity. Procedure codes related to liver assessment, such as histopathological examination of liver biopsy specimens and ultrasound imaging of the liver and biliary ducts, are also retrieved, demonstrating alignment across diagnostic, therapeutic, and procedural concepts.
Across all 4 examples, the nearest-neighbor search consistently recovers clinically meaningful diagnosis-treatment-procedure relationships. This automated recovery of clinically related codes illustrates how the embeddings support cross-system integration by linking diagnoses, treatments, and procedures across distinct classification systems.
Sampling variability and neighborhood stability
We next examined how robust these local structures are to sampling variability. A clear link between code frequency and neighborhood stability is shown in Figure 4. Stability, defined as the proportion of top-10 neighbors retained across 2 embedding spaces learned on independent subsamples, is consistently higher for common codes. Mean stability computed on the top 5% most frequent codes was approximately 50%, whereas it dropped near 25% when considering the entire code vocabulary. As expected, rare codes are subject to sampling noise: because they appear in very few patients, unrelated co-occurring conditions in even a single individual can disproportionately affect their neighborhood, unlike frequent codes whose structure averages over many observations. This trend is observed for any value of k between 5 and 30 (File S5).
Figure 4.

Mean neighborhood stability across quantile-based frequency thresholds (). Each point reports the mean stability over all codes whose frequencies fall above the corresponding quantile threshold (eg the top 5% most frequent codes for 5%). Increasing the threshold progressively relaxes the frequency cutoff, leading to lower overall stability as rarer codes are added.
Quantitative assessment—classification task
To derive a numerical indicator of embedding quality, we trained a multinomial logistic regression model to predict the ICD-10 chapter or ATC class of a code from its embedding vector. Higher predictive performance indicates better alignment of embeddings with these classification systems.
Tables 2 and 3 report the AUC scores from the multinomial logistic regression model, broken down by class. We obtained a weighted average AUC of 0.93. The lowest AUC was 0.81, corresponding to Chapter R00-R99 (Symptoms, signs and abnormal clinical and laboratory findings, not elsewhere classified), while the highest AUC was close to 1, achieved for Chapter P00-P96 (Certain conditions originating in the perinatal period).
Table 2.
AUC performance (+ standard deviation) for the classification task across all ICD-10 chapters.
| Chapter | Name | Mean AUC (SD) | N |
|---|---|---|---|
| A00-B99 | Certain infectious and parasitic diseases | 0.93 (0.02) | 590 |
| C00-D49 | Neoplasms | 0.97 (0.01) | 741 |
| D50-D89 | Blood and blood-forming organs diseases | 0.94 (0.04) | 163 |
| E00-E89 | Endocrine, nutritional and metabolic diseases | 0.94 (0.02) | 339 |
| F01-F99 | Mental and behavioral disorders | 0.95 (0.02) | 390 |
| G00-G99 | Diseases of the nervous system | 0.93 (0.02) | 337 |
| H00-H59 | Diseases of the eye and adnexa | 0.97 (0.02) | 260 |
| H60-H95 | Diseases of the ear and mastoid process | 0.97 (0.03) | 111 |
| I00-I99 | Diseases of the circulatory system | 0.95 (0.02) | 391 |
| J00-J99 | Diseases of the respiratory system | 0.95 (0.03) | 216 |
| K00-K95 | Diseases of the digestive system | 0.96 (0.02) | 441 |
| L00-L99 | Diseases of the skin and subcutaneous tissue | 0.93 (0.03) | 302 |
| M00-M99 | Diseases of the musculoskeletal system and connective tissue | 0.95 (0.01) | 535 |
| N00-N99 | Diseases of the genitourinary system | 0.96 (0.01) | 425 |
| O00-O99 | Pregnancy, childbirth and the puerperium | 0.99 (<0.01) | 417 |
| P00-P96 | Certain conditions originating in the perinatal period | >0.99 (<0.01) | 331 |
| Q00-Q99 | Congenital malformations and chromosomal abnormalities | 0.96 (0.01) | 587 |
| R00-R99 | Symptoms, abnormal clinical findings, not elsewhere classified | 0.81 (0.04) | 330 |
| S00-T98 | Injury, poisoning and other consequences of external causes | 0.91 (0.01) | 1204 |
| U00-U91 | Codes for special purposes | 0.84 (0.11) | 38 |
| V00-Y99 | External causes of morbidity and mortality | 0.93 (0.01) | 1720 |
| Z00-Z99 | Factors influencing health status and contact with health services | 0.84 (0.03) | 625 |
Table 3.
AUC performance (+ standard deviation) for the classification task across ATC classes.
| Class | Name | AUC (SD) | N |
|---|---|---|---|
| A | Alimentary tract and metabolism | 0.86 (0.05) | 183 |
| B | Blood and blood-forming organs | 0.82 (0.09) | 72 |
| C | Cardiovascular system | 0.9 (0.04) | 169 |
| D | Dermatologicals | 0.94 (0.05) | 75 |
| G | Genito-urinary system and sex hormones | 0.92 (0.04) | 91 |
| H | Systemic hormonal preparations, excluding sex hormones and insulins | 0.85 (0.12) | 38 |
| J | Anti-infectives for systemic use | 0.91 (0.04) | 180 |
| L | Antineoplastic and immunomodulating agents | 0.93 (0.03) | 203 |
| M | Musculo-skeletal system | 0.88 (0.08) | 63 |
| N | Nervous system | 0.92 (0.04) | 197 |
| P | Antiparasitic products, insecticides | 0.88 (0.17) | 24 |
| R | Respiratory system | 0.94 (0.04) | 109 |
| S | Sensory organs | 0.97 (0.03) | 77 |
| V | Various | 0.85 (0.09) | 45 |
Overall, predictive performance was higher for chapters that group codes around a well-defined medical concept such as C00-D49 (Neoplasms), H00-H59 (Diseases of the eye and adnexa), or K00-K95 (Diseases of the digestive system) than for chapters that aggregate more heterogeneous conditions, such as Chapter R00-R99.
These results support the idea that the semantic and hierarchical structure of the ICD-10 is effectively encoded within the embedding space.
For ATC classes, predictive performance was slightly lower, with a weighted average AUC of 0.90. The lowest AUC was 0.82, observed for Class B (Blood and blood-forming organs), and the highest was 0.94 for Class D (Dermatologicals). While these results remain strong overall, they suggest that the hierarchical structure of the ATC classification may be more challenging to capture in the embedding space.
Overall, AUC scores above 0.82 for all chapters and classes indicate that hierarchical relations encoded in ICD-10 and ATC were well represented in the latent space.
Misclassified codes
Examining misclassified codes provides additional insight into the semantic coherence of the learned embeddings. Several apparent errors made by the classifier are in fact clinically meaningful. This is particularly evident for ICD-10 codes in Chapter R00-R99 (Symptoms, signs and abnormal clinical and laboratory findings, not elsewhere classified). Because this chapter groups heterogeneous signs and symptoms spanning multiple organ systems, the classifier often assigns these codes to chapters that better reflect their underlying physiological or clinical context.
For example, R73.0 (Abnormal glucose tolerance test), R77.0 (Abnormality of albumin), and R73.9 (Hyperglycemia, unspecified) are predicted as belonging to E00-E89 (Endocrine, nutritional and metabolic diseases). Similarly, R25.2 (Cramps and spasms) and R25.3 (Fasciculation) are mapped to G00-G99 (Diseases of the nervous system). Finally, R00.2 (Palpitations) and R00.8 (Other abnormalities of heartbeat) are assigned to I00-I99 (Diseases of the circulatory system). In each case, the predicted chapter is clinically consistent with the underlying meaning of the code.
These semantically consistent reassignments indicate that the embeddings capture clinically meaningful relationships that are not fully reflected in the ICD-10 hierarchy. In several instances, the latent-space organization provides groupings that align more closely with clinical understanding than those defined by high-level ICD-10 categories, which are constrained by a single-parent hierarchical organization. This highlights that the embeddings encode complementary semantic structure and illustrates the inherent constraints of rigid, single-parent hierarchical classification systems.
Discussion
In this work, we introduced unsupervised embeddings for ICD-10 and ATC codes derived from 1.5 million longitudinal patient records. By leveraging 15 years of claims data containing diagnoses, treatments, procedures, and medical devices, we obtained dense representations that reproduce established hierarchical groupings while also capturing clinically grounded semantic relationships. Embedding diagnosis and treatment codes in a shared space enables downstream models to incorporate diagnosis-treatment links without manual feature engineering, and nearest-neighbor searches allow users to retrieve related codes across multiple coding systems.
Our goal was to develop general-purpose, task-agnostic embeddings that capture clinical relationships present in a broad population. These vectors can serve as reusable representations for a range of digital health applications, including risk prediction, automated phenotyping, care-trajectory analysis, and large-scale population studies. In particular, they enable the construction of patient-level features through direct aggregation of code embeddings, providing compact representations that can be readily integrated into standard statistical models, as illustrated by the patient-level classification example. All embeddings are publicly released through a GitHub repository (https://github.com/cfaujour/ICD10-ATC-Embeddings) to facilitate reproducibility and community reuse.
Because they are learned from standardized medical codes rather than free text, the embeddings are independent of natural language and may be reused in settings where ICD-10 and ATC are used, without language-specific preprocessing. However, although ICD-10 and ATC are international coding systems, the embeddings were learned from a single national claims database and may reflect French coding practices, reimbursement rules, and patterns of care. Their use in other healthcare systems remains relevant, although local validation may help assess transferability to settings with different coding or care practices.
A central methodological decision was to adopt a co-occurrence-based embedding approach rather than prediction-based methods. While most unsupervised NLP methods are designed for strictly ordered token sequences, EHR and claims data contain many simultaneous events. Sequential approaches such as Word2Vec17 require imposing an arbitrary order, which may distort clinical semantics. In contrast, the PPMI-SVD framework aggregates co-occurrences within temporal windows and naturally accommodates simultaneous codes. Given the theoretical link between Word2Vec and PMI factorization via SVD,22 this approach provides a theoretically grounded and computationally efficient alternative well suited to claims data.
Despite strong evidence from UMAP visualization, neighborhood analyses, and chapter-level classification, evaluating embedding quality remains challenging in the absence of a gold standard for clinical code semantics. Classification AUCs confirm that hierarchical structure is well captured, but they do not directly assess finer-grained associations such as diagnosis-treatment links. Prior work has highlighted the limitations of intrinsic and extrinsic embedding evaluations.23 Manually curated benchmarks (eg expert-validated ICD-ATC links or guideline-based code pairings) could provide more targeted evaluation, though assembling such resources would be time-consuming and may vary across clinical contexts.
While many recent approaches learn contextualized representations within predictive models or sequence reconstruction frameworks,24 we instead assign a single, consistent vector to each medical code. This design provides a reusable code-level representation that can be directly applied across datasets and analyses, separating representation learning from downstream modeling and leaving the composition of code-level embeddings to the user.
These embeddings can be incorporated into patient-level sequence models, such as recurrent, convolutional, or attention-based architectures,25–27 where temporal order, event timing, and irregular intervals play an important role in modeling disease trajectories.28 Beyond predictive models, these representations can also be used directly for similarity analysis, exploratory studies, and feature construction in large-scale observational data. Integrating interpretability methods, such as attention visualization29 and attribution techniques,30 remains essential for ensuring clinical relevance and transparency.
Conclusion
We obtained and publicly released unsupervised, task-agnostic embeddings learned from large-scale real-world claims data, jointly representing ICD-10 diagnoses and ATC medications in a shared space. These embeddings capture both the hierarchical organization of each system and clinically meaningful relationships between diagnoses and treatments. By providing a reusable semantic representation shared across ICD-10 and ATC, this work supports exploratory analysis and downstream analytic applications without requiring manual code grouping. The released embeddings provide a community resource for biomedical informatics research and a foundation for future patient-level modeling applications.
Supplementary Material
Contributor Information
Corentin Faujour, CEMKA, 92340 Bourg-la-Reine, France; Université Paris Cité, Inria, Inserm, HeKA, 75015 Paris, France.
Stéphane Bouée, CEMKA, 92340 Bourg-la-Reine, France.
Corinne Emery, CEMKA, 92340 Bourg-la-Reine, France.
Anne-Sophie Jannot, Université Paris Cité, Inria, Inserm, HeKA, 75015 Paris, France; French National Rare Disease Registry (BNDMR), Greater Paris University Hospitals (AP-HP), 75012 Paris, France.
Author contributions
Corentin Faujour (Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Validation, Visualization, Writing—original draft, Writing—review & editing), Anne-Sophie Jannot (Conceptualization, Methodology, Resources, Supervision, Writing—review & editing), Stéphane Bouée (Conceptualization, Methodology, Supervision, Writing—review & editing), and Corinne Emery (Conceptualization, Methodology, Supervision, Writing—review & editing)
Supplementary material
Supplementary material is available at Journal of the American Medical Informatics Association online.
Funding
This work was supported by a CIFRE doctoral fellowship funded by the French National Association of Research and Technology (ANRT). This work benefited from a government grant managed by the Agence Nationale de la Recherche under the France 2030 program, reference 22-PESN-0013.
Conflicts of interest
The authors have no conflicts of interest to report.
Data availability
The original care-trajectory data used to generate the embeddings cannot be shared due to legal, ethical, and regulatory restrictions related to patient privacy. The embeddings produced in this study are openly available to support reproducibility and further research. A synthetic dataset that reproduces the structure of the care trajectories, together with all source code used for embedding computation and exploratory analyses, is publicly accessible in the project’s GitHub repository (https://github.com/cfaujour/ICD10-ATC-Embeddings).
References
- 1. Shah SM, Khan RA. Secondary use of electronic health record: opportunities and challenges. IEEE Access. 2020;8:136947-136965. 10.1109/ACCESS.2020.3011099 [DOI] [Google Scholar]
- 2. Xie F, Yuan H, Ning Y, et al. Deep learning for temporal data representation in electronic health records: a systematic review of challenges and methodologies. J Biomed Inform. 2022;126:103980. 10.1016/j.jbi.2021.103980 [DOI] [PubMed] [Google Scholar]
- 3. Flothow A, Novelli A, Sundmacher L. Analytical methods for identifying sequences of utilization in health data: a scoping review. BMC Med Res Methodol. 2023;23:212. 10.1186/s12874-023-02019-y [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4. Righolt CH, Zhang G, Mahmud SM. Classification of drug use patterns. Pharmacol. Res. Perspect. 2020;8:e00687. 10.1002/prp2.687 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5. Vanasse A, Courteau J, Courteau M, et al. Healthcare utilization after a first hospitalization for COPD: a new approach of state sequence analysis based on the “6W” multidimensional model of care trajectories. BMC Health Serv Res. 2020;20:177. 10.1186/s12913-020-5030-0 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6. Hilton R, Zheng Y, Fitzpatrick A, Serban N. Uncovering longitudinal healthcare behaviors for millions of Medicaid enrollees: a multistate comparison of pediatric asthma utilization. Med Decis Making. 2018;38:107-119. 10.1177/0272989X17731753 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7. Johnson JM, Khoshgoftaar TM. Encoding high-dimensional procedure codes for healthcare fraud detection. SN Comput Sci. 2022;3:362. 10.1007/s42979-022-01252-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8. Lu H.M. Quasi-orthonormal encoding for machine learning applications. In: Proc. SciPy 2020, Austin, TX, 2020:11-17. 10.25080/Majora-342d178e-002 [DOI]
- 9. Beam AL, Kompa B, Schmaltz A, et al. Clinical concept embeddings learned from massive sources of multimodal medical data. In: Biocomputing 2020, Kohala Coast, HI, World Scientific, 2019:2019:295-306. 10.1142/9789811215636_0027 [DOI] [PMC free article] [PubMed]
- 10. Collobert R, Weston J, Bottou L, Karlen M, Kavukcuoglu K, Kuksa P. Natural language processing (almost) from scratch. J Mach Learn Res. 2011;12:2493-2537. [Google Scholar]
- 11. Bengio Y, Courville A, Vincent P. Representation learning: a review and new perspectives. IEEE Trans Pattern Anal Mach Intell. 2013;35:1798-1828. 10.1109/TPAMI.2013.50 [DOI] [PubMed] [Google Scholar]
- 12. Ericsson L, Gouk H, Hospedales TM. How well do self-supervised models transfer? In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR 2021), Nashville, TN: IEEE Computer Society; 2021:5410-5419. 10.1109/CVPR46437.2021.00537 [DOI]
- 13. Chen T, Kornblith S, Swersky K, Norouzi M, Hinton G. Big self-supervised models are strong semi-supervised learners. In: Advances in Neural Information Processing Systems (NeurIPS 2020), Vancouver, BC: Curran Associates, Inc., 2020:22243–22255.
- 14. VanBerlo B, Hoey J, Wong A. A survey of the impact of self-supervised pretraining for diagnostic tasks in medical X-ray, CT, MRI, and ultrasound. BMC Med Imaging. 2024;24:79. 10.1186/s12880-024-01253-0 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15. Kartchner D, Christensen T, Humpherys J, et al. Code2Vec: embedding and clustering medical diagnosis data. In: Proceedings of the 2017 IEEE International Conference on Healthcare Informatics (ICHI), Park City, UT, 386-390 (IEEE, 2017).
- 16. Pennington J, Socher R, Manning C. GloVe: global vectors for word representation. In: Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar, 1532-1543 (ACL, 2014).
- 17. Choi E, Bahadori MT, Searles E, et al. Multi-layer representation learning for medical concepts. In: Proceedings of the 22nd ACM SIGKDD Int Conf Knowledge Discovery and Data Mining (KDD 2016), San Francisco, CA, 1495-1504 (2016).
- 18. Mikolov T, Sutskever I, Chen K, Corrado G, Dean J. Distributed representations of words and phrases and their compositionality. In: Advances in Neural Information Processing Systems. Lake Tahoe, NV: Curran Associates, Inc., 2013:3111–3119.
- 19. Hong C, Rush E, Liu M, et al. ; VA Million Veteran Program. Clinical knowledge extraction via sparse embedding regression (KESER) with multi-center large scale electronic health record data. Npj Digit Med. 2021;4:151. 10.1038/s41746-021-00519-z [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20. McInnes L, Healy J, Saul N, Großberger L. UMAP: uniform manifold approximation and projection. JOSS. 2018;3:861. 10.21105/joss.00861 [DOI] [Google Scholar]
- 21. Moulis G, Lapeyre-Mestre M, Palmaro A, et al. French health insurance databases: what interest for medical research? Rev Med Interne. 2015;36:411-417. 10.1016/j.revmed.2014.11.009 [DOI] [PubMed] [Google Scholar]
- 22. Levy O, Goldberg Y. Neural word embedding as implicit matrix factorization. Adv Neur Info Proc Syst. 2014;27:2177-2185. [Google Scholar]
- 23. Zhai M, Tan J, Choi J. Intrinsic and extrinsic evaluations of word embeddings. Aaai. 2016;30:4282-4283 10.1609/aaai.v30i1.9959 [DOI] [Google Scholar]
- 24. Zeng X., Lin S., Liu C. Transformer-based unsupervised patient representation learning based on medical claims for risk stratification and analysis. In: Proceedings of the ACM Conf Bioinformatics Comput Biol Health Inform (BCB 2021). Gainesville, FL: Association for Computing Machinery; 2021:1-9 10.1145/3459930.3469519 [DOI]
- 25. Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need. Adv Neur Info Proc Syst. 2017;31:6000-6010. [Google Scholar]
- 26. Hochreiter S, Schmidhuber J. Long short-term memory. Neural Comput. 1997;9:1735-1780. 10.1162/neco.1997.9.8.1735 [DOI] [PubMed] [Google Scholar]
- 27. Shmatko A, Jung AW, Gaurav K, et al. Learning the natural history of human disease with generative transformers. Nature. 2025;647:248-256. 10.1038/s41586-025-09529-3 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28. Elman JL. Finding structure in time. Cogn Sci. 1990;14:179-211. 10.1207/s15516709cog1402_1 [DOI] [Google Scholar]
- 29. An J, Joe I. Attention map-guided visual explanations for deep neural networks. Appl Sci. 2022;12:3846. 10.3390/app12083846 [DOI] [Google Scholar]
- 30. Sundararajan M, Taly A, Yan Q. Axiomatic attribution for deep networks. In: Proceedings of the 34th International Conference on Machine Learning. (eds Precup D., Teh Y. W.) 70, 3319-3328 (PMLR, 2017). [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The original care-trajectory data used to generate the embeddings cannot be shared due to legal, ethical, and regulatory restrictions related to patient privacy. The embeddings produced in this study are openly available to support reproducibility and further research. A synthetic dataset that reproduces the structure of the care trajectories, together with all source code used for embedding computation and exploratory analyses, is publicly accessible in the project’s GitHub repository (https://github.com/cfaujour/ICD10-ATC-Embeddings).
