PaReGTA: A Temporally Aware LLM-Based Patient Representation Framework for EHR Analytics
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: AI Radio. Generated commentary on the latest Artificial Intelligence papers.
Tom: Today's paper: "PaReGTA: A Temporally Aware LLM-Based Patient Representation Framework for EHR Analytics".
Jane: The gist The proposed PaReGTA framework is an LLM-based encoding system that converts longitudinal EHR events into visit-level templated text, learns domain-adapted visit embeddings via contrastive fine-tuning,
Tom: First, who's behind it and why it matters.
Title and authors: Tom: So we're diving into the PaReGTA: A Temporally Aware LLM-Based Patient Representation Framework for EHR Analytics paper. We see here that the authors are tackling that problem where temporal information in structured electronic health records is often lost in sparse one-hot or count-based representations, while sequence models can be costly and data-hungry.
Jane: So, what’s the core proposal there? How do they fix this issue of losing that crucial timing data when you try to make a standardized patient representation?
Lu: The authors propose PaReGTA as an LLM-based encoding framework that has three main steps: first, they convert those longitudinal EHR events into visit-level templated text with explicit temporal cues.
Tom: And then, second, they learn domain-adapted visit embeddings using lightweight contrastive fine-tuning of a sentence embedding model to make sure those embeddings actually fit the specific clinical language of the data.
Meng: That’s important for deployment because if you just throw raw text into a model, it might not understand all those specific medical terms or patterns in a new hospital setting.
Lalam: And third, they aggregate those visit embeddings into a fixed-dimensional patient representation using hybrid temporal pooling that captures both recency and globally informative visits.
The paper's summary: Jane: So, if I’m not reading the whole thing, what does this actually mean for me as someone who just needs a prediction from an EHR? What is the main practical implication of PaReGTA?
Tom: The practical part is that you get these fixed-dimensional patient representations that can be used with conventional downstream machine learning models. They’re designed to preserve the clinical narratives, which means distinct sequences of events might become distinguishable again.
Lu: They address a major barrier where site-specific vocabularies and irregular timing make things hard for deep learning approaches, highlighting the promise of representation learning for temporally structured EHRs.
Meng: I'm concerned about the cost here. They’re using an LLM encoding system and contrastive fine-tuning, which sounds intensive compared to just running a simple regression model on aggregated counts.
Lalam: The authors suggest that their method can help overcome the challenge where distinct clinical narratives, like one disease followed by another, might become indistinguishable even when their outcomes are different.
The paper's improvements: Tom: Now let’s talk about how they improve things. They introduce PaReGTA-RSS, which is a prespecified factor-removal analysis that recomputes patient representations after removing clinically defined factor groups and quantifies the resulting change in the fitted logit of a fixed logistic-regression model.
Jane: So, PaReGTA-RSS sounds like they’re trying to check if their representation is actually picking up the right clinical signals, even when you deliberately remove things like specific medication factors.
Lu: That analysis allows researchers to examine how the fitted pipeline responded to the evaluated EHR inputs by quantifying shifts in predictive performance when specific clinical factors, for example, onabotulinumtoxinA, are removed.
Meng: So it’s a sensitivity check built right into the representation learning process? That sounds like it adds complexity to the training pipeline that we have to manage carefully at scale.
Lalam: They also showed that temporal information substantially outperforms baselines; specifically, PaReReGTA-Gap and PaReGTA-Month had higher point estimates than PaReGTA-Without across the five downstream classifiers.
Conclusion: Tom: So to wrap up, PaReGTA is this modular alternative to sparse aggregation and specialized sequence models for generating fixed-dimensional, temporally aware patient-level representations for retrospective EHR analysis. It’s about making the data usable again without needing massive sequence models every time.
Jane: The main implication is that we can move away from representations that discard temporal dynamics and start getting more faithful to the actual clinical narrative of a patient's journey when using these fixed-dimensional outputs.
Lu: They provide a way to leverage LLMs for this, but they also flag some practical barriers, like the need for data normalization of semi-structured EHR tables, which is something they admit is a practical hurdle in many EHR systems.
Meng: From an engineering standpoint, it’s modular because you can swap out the temporal encoding schemes or the domain adaptation method if you want to optimize for specific deployment constraints.
Lalam: The PaReGTA: A Temporally Aware LLM-Based Patient Representation Framework for EHR Analytics framework gives us a way to generate these representations that are fixed-dimensional and temporally aware, which is valuable for retrospective EHR analysis.
Kihyuk Yoona, Lingchao Maoa, Catherine Chongc, Todd Schwedtc, Chia-Chun Chiangc, Jing Lia
Georgia Institute of Technology · UNIST · Mayo Clinic
cs.LG
Submitted: 2026-02-23
Updated: 2026-10-08
Comments: 37 pages, 5 figures, 21 tables
License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
Importance score: 89/100
The gist: The gist The proposed PaReGTA framework is an LLM-based encoding system that converts longitudinal EHR events into visit-level templated text, learns domain-adapted visit embeddings via contrastive
Key concepts
- Visit-level Textualization
- This step converts raw EHR rows into descriptive text by applying fixed templates. It orders events chronologically and uses temporal prefixes (like date or gap markers) to explicitly embed time information directly into the visit descriptions, making the data readable for an LLM.
- Domain Adaptation via Contrastive Learning
- The system fine-tunes a pre-trained language model using a contrastive objective. This teaches the model to generate embeddings that are close together for identical visits while pushing them away from different visits in the batch, ensuring the resulting embeddings are specific and relevant to the patient's medical history.
- Hybrid Temporal Pooling
- This method aggregates individual visit embeddings into a single patient representation. It uses a combination of time-decay weighting (to prioritize recent events) and attention-based weighting (to focus on visits deemed globally important), balancing recency with overall context.
Terminology
Summary
The gist The proposed PaReGTA framework is an LLM-based encoding system that converts longitudinal EHR events into visit-level templated text, learns domain-adapted visit embeddings via contrastive fine-tuning, and aggregates these embeddings into a fixed-dimensional patient representation using hybrid temporal pooling to preserve both recency and globally informative visits.
How it works
PaReGTA operates through three main stages to transform structured EHR data into patient-level representations The first stage is Visit-level text construction, which involves a deterministic textualization procedure
that orders rows chronologically and applies fixed templates to medication and comorbidity fields. This textualization uses temporal prefixes such as PaReGTADate, PaReGTA-Gap, or PaReGTA-Month to explicitly encode temporal cues into the visit text.
The second stage involves Domain adaptation via contrastive learning, where a pretrained sentence-embedding LLM is fine-tuned using a SimCSE-style identical-text contrastive fine-tuning
objective. This process adapts the encoder to cohort-specific visit texts by optimizing the loss function to ensure that embeddings of the same visit text remain close while ranking the paired copy above other batch examples.
The third stage is Hybrid temporal pooling into patient representations, which aggregates visit-level embeddings using a scheme that combines time-decay weighting to emphasize recency and attention-based weighting to emphasize globally informative visits
. This results in a hybrid representation defined as z = αzattn + (1 − α)ztime, where α controls the contribution of the attention-pooled representation versus the time-weighted representation.
Key Methodological Components
The framework incorporates several specific mechanisms designed to handle EHR data challenges
-
Visit-level textualization involves constructing domain-specific strings for medication and comorbidity fields, using fixed templates like
Medication first visit, meds: acetaminophen 325 MG Oral Tablet
. -
Temporal cues are introduced via three schemes: PaReGTADate uses the calendar date and appends an elapsed-day marker, PaReGTA-Gap uses the elapsed time between consecutive visits, and PaReGTA-Month expresses the interval in 30-day month bins.
-
Domain adaptation is achieved by fine-tuning a model like GTE-basev1.5 using the MultipleNegativesRankingLoss objective to align embeddings with cohort-specific texts.
-
Hybrid pooling combines a time-weighted component, where weights are calculated based on elapsed days (di = max(tN − ti)days, 0), and an attention component, where visit embeddings are concatenated with the log-transformed elapsed-time feature δi before passing through an MLP to obtain attention weights.
Evaluation and Results
The framework was evaluated on a retrospective patient-level classification task using a cohort of 39,088 patients with migraine from the All of Us Research Program (AoU). In an exploratory comparison on the fixed held-out test cohort, PaReGTA-Gap + LightGBM had the highest reported AUC, accuracy, and F1 values among the evaluated sparse, BERT-based EHR, and recurrent approaches
.
A key finding from the factor-removal analysis is that PaReGTA-RSS quantifies changes in the fitted logit of a fixed logistic-regression model after removing clinically defined factor groups. For example, removal of onabotulinumtoxinA produced the largest average absolute fitted-logit change
among medication factor groups.
Further ablation studies showed that temporal information substantially outperforms baselines; specifically, PaReReGTA-Gap and PaReGTA-Month had higher point estimates than PaReGTA-Without across the five downstream classifiers. The paired differences between PaReGTAGap + LightGBM and T-LSTM were positive for AUC, accuracy, and F1 in the fixed-test bootstrap analysis, indicating modest but consistently positive differences in favor of PaReGTA-Gap + LightGBM
.
Limitations
The study acknowledges several limitations regarding its findings First, PaReGTA-RSS depends on the selected factor definitions, removal rule, learned representation, fitted preprocessing transformation, and downstream logistic-regression model. Second, T-LSTM and RETAIN were trained using length-bucket batching to address training instability due to sequence length heterogeneity. Finally, the experiments are retrospective and do not establish general superiority across datasets or clinical tasks because they are limited to a single All of Us cohort.
The study concludes that PaReGTA provides a modular alternative to sparse aggregation and specialized sequence models for generating fixed-dimensional, temporally aware patient-level representations for retrospective EHR analysis.
Improvements for AI systems
- Bold header: Temporal Information Encoding via PaReGTA
PaReGTA converts longitudinal EHR events into visit-level templated text with explicit temporal cues,
allowing downstream models to leverage explicit temporal information rather than losing it in sparse one-hot or count-based representations.
This enables models to capture distinct clinical narratives (e.g., the emergence of one disease followed by another) may become indistinguishable
by explicitly encoding the sequence and timing of events.
- Bold header: Domain Adaptation via Contrastive Learning
The system employs a lightweight contrastive fine-tuning of a sentence-embedding model
using a SimCSE-style identical-text contrastive fine-tuning,
which adapts the encoder to cohort-specific visit texts.
This improves generalization by learning embeddings that are relevant to the specific clinical vocabulary and event patterns of the cohort, addressing challenges where site-specific vocabularies
complicate modeling.
- Bold header: Hybrid Temporal Aggregation for Patient Representation
PaReGTA aggregates visit embeddings into a patient representation using a hybrid temporal pooling that captures both recency and globally informative visits,
combining a time-decay weighting
mechanism with an attention-based weighting
mechanism to emphasize different temporal aspects of the record. This results in representations that are used with conventional downstream machine-learning models,
providing a fixed-dimensional patient representation compatible with existing pipelines.
- Bold header: Factor Sensitivity Analysis via PaReGTA-RSS
The system introduces PaReGTA-RSS, which is a prespecified factor-removal analysis that recomputes patient representations after removing clinically defined factor groups and quantifies the resulting change in the fitted logit of a fixed logistic-regression model.
This allows researchers to examine how the fitted pipeline responded to the evaluated EHR inputs
by quantifying shifts in predictive performance when specific clinical factors (like medication or comorbidity groups) are removed.
- Bold header: Robust Performance Across Temporal Encoding Schemes
A comprehensive ablation study shows that LLM-based embeddings with temporal information (Date or Gap) substantially outperform the baselines across all five classifiers,
indicating that Gap showed the strongest overall point-estimate pattern among the examined temporal representations
for this task, suggesting that capturing patient-specific progression pace is particularly effective.
- Bold header: Flexible Input Handling via Medication Information
PaReGTA demonstrates flexibility by encoding deterministically constructed product-level strings
when medication records are available, and maintaining strong performance using comorbidity-derived visit text alone
when medication records are missing or incomplete, thereby reducing preprocessing burden across different real-world EHR settings.
Sources
- Attention Is All You Need
- Prompting Large Language Models for Zero-Shot Clinical Prediction with Structured Longitudinal Electronic Health Record Data
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks