Chao Pang, Xinzhuo Jiang, Nishanth Parameshwar Pavinkurve, Krishna S. Kalluri, Elise L. Minto, Jason Patterson, Linying Zhang, George Hripcsak, Gamze Gürsoy, Noémie Elhadad, Karthik Natarajan
10 min
Researchers often face significant barriers to accessing real-world Electronic Health Records (EHR) due to privacy, security, and institutional restrictions. While synthetic data offers a solution, existing generative models—such as GANs—often rely on tabular formats that fail to capture the critical temporal dependencies (e.g., medication schedules, visit intervals, and disease progression) necessary for clinical research. This paper introduces CEHR-GPT, a framework designed to generate high-fidelity, time-series synthetic EHR data that maintains clinical validity and adheres to standardized data formats.
The authors treat patient sequence generation as a language modeling problem. They extend a patient representation previously developed for CEHR-BERT to include demographic information, visit types, discharge facilities, and precise temporal intervals. The framework converts OMOP-formatted EHR data into structured sequences, where visit blocks are separated by artificial time tokens (ATT). An inpatient-specific time token (IATT) is used to capture the duration of hospital stays. A standard GPT model is then trained on these sequences using a next-word prediction objective. Once trained, the model generates new sequences that are decoded back into the OMOP Common Data Model, ensuring the synthetic output is compatible with existing clinical research tools.
CEHR-GPT successfully generates synthetic patient timelines that maintain the statistical characteristics of the source data, including visit distributions, co-occurrence relationships, and temporal intervals. By utilizing a language model architecture, the authors avoid the training instability and mode collapse common in GAN-based approaches. The resulting synthetic data preserves the temporal integrity required for complex clinical tasks, such as predicting 30-day readmissions or disease progression. Furthermore, privacy evaluations indicate that the synthetic data carries a low risk of re-identification, making it a viable tool for broader research dissemination.
This framework bridges the gap between generative AI and clinical data standards. By producing synthetic data in the OMOP format, CEHR-GPT allows researchers to perform external validation of machine learning models and conduct population-level analyses without requiring access to sensitive, restricted patient data. This approach significantly lowers the barrier to entry for clinical machine learning research while upholding data privacy and temporal accuracy.
Synthetic Electronic Health Records (EHR) have emerged as a pivotal tool in advancing healthcare applications and machine learning models, particularly for researchers without direct access to healthcare data. Although existing methods, like rule-based approaches and generative adversarial networks (GANs), generate synthetic data that resembles real-world EHR data, these methods often use a tabular format, disregarding temporal dependencies in patient histories and limiting data replication. Recently, there has been a growing interest in leveraging Generative Pre-trained Transformers (GPT) for EHR data. This enables applications like disease progression analysis, population estimation, counterfactual reasoning, and synthetic data generation. In this work, we focus on synthetic data generation and demonstrate the capability of training a GPT model using a particular patient representation derived from CEHR-BERT, enabling us to generate patient sequences that can be seamlessly converted to the Observational Medical Outcomes Partnership (OMOP) data format.
Sam: That is the primary innovation. And by formatting everything according to a widely-used medical data standard, the synthetic records are ready for researchers to use immediately—without anyone ever touching a real patient's private file.
Alex: But how do they actually know if the synthetic data is *good*?
Sam: They developed a custom metric they call the Loss of Temporal Information—think of it as a "timer-accuracy" score. It measures how much of the original, precise timeline is preserved when you convert a patient's history into a sequence for the AI. A high score means the timeline has collapsed, making it impossible to study time-sensitive events.
Alex: And how did their approach do on that score?
Sam: Their day-by-day marker approach had the lowest loss compared to other methods. They tested this concretely by looking at whether synthetic patients correctly fell within a thirty-day hospital readmission window—a standard measure of care quality. Other models that didn't preserve the timeline failed this test badly, because when you lose the duration of an inpatient stay, the AI misinterprets when a patient was actually at risk.
Alex: So those other models were generating patients who simply couldn't exist in reality.
Sam: Exactly. It's like trying to bake a cake but losing the instructions for how long it needs to be in the oven. You end up with something that looks like a cake from the outside, but it hasn't actually cooked properly.
Alex: There's a subtlety there, though. Could a model look good on simpler measures even if the timeline is wrong?
Sam: Yes, and that's an important caution the paper raises. Some measures—like the general distribution of diseases across a population—are not sensitive to timing at all. You could have a synthetic dataset that looks convincing in a simple chart but fails completely for any task that requires forecasting or sequencing. The model can be "right" about the wrong things.
Alex: What about privacy? How do they make sure the model isn't just memorizing real patients and reproducing them?
Sam: They run what are called membership inference attacks. Imagine a detective who is given a synthetic record and tries to figure out whether a specific real person's data was used to train the model. If the model has simply memorized its training data, that detective would succeed regularly. The study found their model maintains a low risk score on this test, which suggests it has genuinely learned the general patterns of care rather than storing individual patient histories.
Alex: So it learns the rules of the language, not the specific sentences.
Sam: That's a good way to put it. Though the paper does note that the model can occasionally amplify errors already present in the source data—so it's only as reliable as the records it was trained on.
Alex: What are the practical limits of the system?
Sam: The main constraint is what you might call the AI's short-term memory. The model can only process a certain amount of patient history at once, so it struggles with long, complex chronic illnesses—it runs out of room before it can take in the full story. This creates a tendency to over-represent common, short-term patterns while missing the rarer events that are often medically significant.
Alex: Like a student who memorizes the popular chapters but skips the footnotes.
Sam: Exactly. To address this, the researchers use a technique called adaptive regularization. If the model is leaning too heavily on a common concept, the system automatically reduces its influence during training, nudging the model to pay more attention to the rare events it would otherwise overlook.
Alex: And what about time resolution? Daily intervals seem fairly coarse for something like intensive care.
Sam: That's one of the limitations the paper explicitly flags. For critical care settings, where decisions happen hour by hour, daily markers aren't precise enough. Finer time resolution is identified as a clear next step. They also note that the model currently doesn't include death events, which would be a meaningful addition for studying long-term mortality.
Alex: So there's still real work ahead to make the synthetic diary as complete as the real one.
Sam: There is. But the paper's contribution is establishing that preserving the timeline is not optional—it's the foundation everything else depends on. A synthetic record that gets the sequence of events right but loses the spacing between them isn't a useful substitute for real data. It's a different thing entirely.
Alex: That's a useful distinction. It's not just about generating data that looks plausible—it has to behave the way real data behaves when you actually use it for research.
Sam: Right. And that's what makes this approach meaningful for the field. The goal isn't a convincing imitation. It's a functional one—data that researchers can trust to train and test their models, without putting any real patient's privacy at risk.
Alex: Thanks for listening to ResearchPod.