WorksComputer Science
RASPER: Reward-Aligned Summarization of Clinical Notes for EHR Outcome Prediction
Abstract
Unstructured discharge notes in Electronic Health Records (EHRs) often carry signal complementary to structured medical codes, holding patient-specific evidence that standardized cohort-level codes alone cannot capture. However, this evidence in notes is frequently buried in lengthy, noisy text that is not intentionally written with any specific clinical prediction in mind. Summarization is an obvious mitigation, but generic summaries, tuned for fluency rather than the outcome, routinely omit decisive evidence while retaining plausible but uninformative detail. To this end, we propose RASPER, a Reward-Aligned Summarizer for Prediction in EHR, that optimizes note summarization directly against the downstream clinical task. RASPER employs a tunable LLM-based summarizer to extract task-relevant evidence from discharge notes and trains it via reinforcement learning from prediction feedback, using a reward derived from the downstream predictor's loss. To ground the summarizer, a longitudinal encoder converts structured codes into soft prompts that incorporate each patient's clinical context into note summarization. By rewarding the quality of the resulting multimodal prediction, RASPER encourages the summarizer to retain patient-specific evidence that complements, rather than duplicates, information captured by structured codes. RASPER consistently outperforms strong baselines on both readmission prediction and medication recommendation across MIMIC-III and MIMIC-IV.
Introduction
Electronic Health Records (EHRs) represent a patient’s health trajectory with multimodal views: structured codes such as diagnoses capture standardized, cohort-level patterns across patients ([2]), while discharge notes record patient-specific symptom severity, treatment response, and clinician observations that codes cannot fully record ((Tayefi et al., 2021)). Although discharge notes contain rich patient-specific information, they are primarily written for clinical documentation rather than predictive modeling. These raw notes are often lengthy, redundant, and sensitive to variation in documentation style ([14]). Directly feeding such notes into a model can therefore dilute the predictive signal and make the model sensitive to documentation artifacts rather than the underlying clinical state ([7]). A natural strategy is to summarize discharge notes with an LLM ([5, 4]), compressing noisy clinical narratives into a fluent, coherent summary before prediction. However, reducing note length and improving readability does not by itself ensure that the retained information is useful for a specific prediction task.
The predictive value of a note summary depends on both the downstream task and the patient-specific context. Although different clinical prediction tasks may rely on overlapping clinical information, the information that is most predictive of each task can differ ((Yoon et al., 2025)). Hence, a summary optimized only for generic coverage and denoising is optimized for the wrong objective ((Yadav et al., 2021)), since it might discard details that a specific prediction depends on while preserving plausible but uninformative clinical information. This mismatch suggests that discharge note summarization should not be treated as a separate preprocessing step, but should instead be aligned with the downstream prediction and patient-specific objective.
Existing EHR-LLM methods do not directly address this problem. Some approaches feed raw or hard-prompted notes into LLMs and inherit the noise of the original documentation ([10, 9]), and others rely on fixed summaries or extracted textual features that are never tuned to the target outcome [7]. Some structured code models discard the note modality altogether [11] (Xu et al. 2024). As a result, prior methods generally do not align the summarization process with the downstream clinical objective.
To close this gap, we propose RASPER, a Reward-Aligned Summarizer for Prediction in EHR. RASPER optimizes the summarization of notes directly against the downstream task: a tunable LLM summarizer is trained with reinforcement learning from prediction feedback (RLPF) (Wu et al., 2025), using the predictor’s loss as the reward signal. A longitudinal EHR encoder maps structured codes into soft prompts that provide patient grounding. Because the reward reflects how well the note summary and the structured codes collaborate, the summarizer is encouraged to preserve note evidence that complements the structured code information and contributes to downstream prediction. The summarizer is first initialized through supervised fine-tuning on teacher-generated summaries, then optimized with this prediction-feedback objective to preserve the task-relevant evidence that improves predictive utility. Our approach makes the following contributions:
We propose a reward-aligned note summarization framework that trains a tunable LLM summarizer directly against the downstream prediction objective, using reinforcement learning from prediction feedback rather than treating summaries as a fixed preprocessing step.
We design an LLM-based predictor that jointly conditions on structured EHR soft prompts and generated note summaries, enabling prediction feedback to align the summarizer with both cohort-level code patterns and informative textual evidence.
We conduct experiments on MIMIC-III and MIMIC-IV, showing consistent improvements over strong deep-learning and LLM-based baselines on two clinical prediction tasks.
Methodology
Problem Formulation
For each patient , we use an ordered sequence of historical clinical visits as input, where denotes the -th observed visit in chronological order and denotes the number of historical visits available before the target visit. Each visit contains a set of medical codes, including diagnoses, medications, and procedures. Formally, the codes recorded at visit are defined as
where denotes the number of medical codes associated with that visit. In addition to structured medical codes, each visit is accompanied by discharge notes represented as text. We denote the token sequence of the discharge note for patient at visit as , where each denotes a token and is the length of the note.
The target outcome is task-dependent and is defined as
where denotes the size of the medication vocabulary. For medication recommendation, indicates that medication is prescribed at the target visit .
Model Overview
Figure 1 illustrates the overall architecture of RASPER. The model is designed around the idea that clinical-note summarization should not be optimized independently from the prediction task. The framework contains two interacting modules: an LLM-aware outcome predictor and a tunable LLM summarizer. The predictor combines structured EHR soft prompts with generated note summaries to model both cohort-level code patterns and patient-specific textual evidence. After supervised fine-tuning, the summarizer is further optimized through prediction feedback, so that its generated summaries preserve information that improves downstream clinical prediction.

Figure 1. Overview of the proposed RASPER framework. A tunable LLM summarizer transforms discharge notes into standardized visit-level summaries, which are concatenated into a patient-level summary. An LLM-aware predictor combines this patient-level summary with soft prompt embeddings from structured EHR codes for outcome prediction. The summarizer is first initialized with supervised fine-tuning and then optimized with RLPF using prediction-loss-derived reward within the PPO objective.
LLM-Aware Outcome Predictor
Clinical prediction from EHR requires modeling both discharge notes and structured medical codes [7]. Discharge notes describe patient condition, treatment, and clinical progression [13]. In contrast, diagnoses, procedures, and medications provide standardized cohort-level signals [2, 6] (Shang et al. 2019). Using only notes may expose the model to non-standardized textual evidence, and using only structured codes may miss important patient-specific clinical context. Therefore, we integrate both in a unified representation space.
Large language models can encode clinical text into contextualized representations (Yenduri et al., 2024), but many healthcare LLM approaches rely mainly on hard prompting over linearized patient records [16] (Zaghir et al. 2024). We therefore use prompt tuning [7], where the summarized discharge note embeddings are augmented with soft prompts from a structured EHR encoder. This allows the two modalities to complement each other in a lightweight and modular prediction framework.
Mathematically, the input to the LLM for patient is defined as
The structured code sequence is first encoded by an encoder to obtain a patient-level representation . For the EHR encoder, we use RETAIN [2], a lightweight longitudinal model that captures visit-level and code-level patterns through attention (Further details on RETAIN are provided in Appendix § 9.§ 1). We then project this representation into continuous soft prompt embeddings:
where is the number of soft prompt tokens and is the hidden dimension of the LLM predictor.
denotes the token embeddings corresponding to the patient summary in the LLM-Aware Outcome Predictor, where is the number of summary tokens for patient . As defined in Equation (4), the representation is then provided to the predictor LLM, which outputs the final hidden representation :
As defined in Equation (5), we first apply average pooling over the final hidden representations and then use a linear prediction head to obtain task-specific logits:
The prediction loss is binary cross-entropy:
where denotes the predicted probability for patient . The trainable components of the predictor include the EHR-to-soft-prompt layer, the prediction head, and the LoRA adapters of the LLM predictor. The backbone LLM parameters remain frozen.
Tunable LLM Summarizer
The predictive value of clinical information depends on the downstream task and the patient-level prediction context. Hence, a generic summarization objective may not preserve the evidence most useful for outcome modeling (Wu et al., 2025). This motivates using a summarizer that is not only a fixed preprocessing component, but can utilize prediction feedback from the downstream task.
The tunable LLM summarizer converts each raw discharge note into a shorter visit-level summary. It has two main goals: first, to reduce documentation noise and standardize the note format; second, to preserve patient-specific evidence that is useful for downstream prediction. After supervised initialization, the LLM-aware predictor provides a prediction-feedback reward by converting its per-sample prediction loss into a scalar reward, while the LLM summarizer is the policy model.
Given the discharge note for patient at time step , the summarizer generates a standardized clinical summary using the prompt shown in Figure 2. We then construct the patient-level document as , where denotes concatenation. This ordering places the most recent visit first because recent clinical status is often more directly related to near-future outcomes, while earlier visits provide additional historical context.

Figure 2. Prompt used by the tunable LLM summarizer to extract relevant information from discharge notes.
Summarizer Supervised Fine-Tuning
Before applying reinforcement learning, we first perform supervised fine-tuning (SFT) to teach the local summarizer how to extract clinically relevant information from noisy discharge notes. Reinforcement-based alignment alone can be unstable when starting from an unadapted language model [19], especially in long-form clinical summarization settings where the output space is large, and rewards may be sparse or noisy (Rafailov et al., 2023). Therefore, SFT first trains the model to produce summaries that follow a structured clinical style before the summarizer is optimized for downstream predictive utility.
Formally, for each visit-level discharge note , we first use the GPT-5.4 mini model to generate a target summary , due to the lack of annotated visit-level summaries. This creates a supervised fine-tuning dataset , where is the input note and is the teacher-generated target summary used for supervised fine-tuning. We denote the summarizer policy as , where represents the trainable LoRA adapter parameters [8], while the backbone LLM weights remain frozen. The teacher-generated summary is written as
where denotes the length of the target summary for patient at visit . At decoding step , the summarizer predicts the next token conditioned on the discharge note and the previously generated target tokens . Therefore, the supervised fine-tuning objective is defined as the negative log-likelihood of the GPT-generated target summary:
By minimizing for several epochs, denoted by , the summarizer learns to generate clinically meaningful summaries before being further optimized with the reinforcement learning objective.
RLPF Optimization with PPO
After supervised fine-tuning, we further optimize the summarizer using Reinforcement Learning from Predictor Feedback (RLPF) (Wu et al., 2025). In this stage, the goal is to move beyond generic clinical summarization and encourage the model to retain information that improves downstream outcome prediction. The tunable summarizer is treated as a policy model initialized from the SFT-trained checkpoint. Given the discharge note for patient at visit , the policy generates a summary token-by-token:
where denotes the length of the generated summary. The generated visit-level summaries are then concatenated to form the patient-level summary , following the same construction described in the previous subsection.
The LLM-aware predictor acts as the feedback model. Specifically, the generated patient-level summary is passed to the LLM-aware outcome predictor defined in Equation (2), together with the structured EHR soft prompts. The predictor then produces the downstream prediction score following Equations (4) and (5). We use the resulting prediction loss to define the reward for optimizing the summarizer. This feedback helps the summarizer to produce clinical summaries that are more useful for prediction. We optimize the summarizer using Proximal Policy Optimization (PPO) (Schulman et al., 2017).
Let denote the per-sample binary cross-entropy loss for patient at epoch :
For each patient, we maintain a history of previous losses during warm-up in each epoch and define a strong reference loss as the average of the five lowest losses observed so far:
where denotes the -th smallest historical loss for patient observed during the LLM predictor warm-up stage, before the summarizer is optimized. Using the average of the lowest historical losses provides a reference of the strongest prediction performance observed for that patient during warm-up, and it makes the reward less sensitive to differences across patients. The raw reward is computed as the improvement over this reference:
This reward is used as the prediction-feedback signal for PPO optimization of the summarizer policy; a higher reward indicates that the generated summary improves downstream prediction relative to the patient’s warm-up best historical baselines.
To stabilize PPO training, the patient-level rewards are normalized within each mini-batch . Let and denote the mean and standard deviation of rewards in the mini-batch. The normalized reward is
where is a small constant for numerical stability. The normalized reward is then clipped to avoid unstable updates:
Because the reward is computed at the patient level, the same reward is assigned to all generated visit summaries belonging to that patient. For each generated summary token, we compute the log-probability under the current policy and under the old policy that produced the sampled summary. Let denote the policy before the PPO update. The PPO probability ratio for token is
In addition to the policy model, we use a value head on top of the summarizer hidden states to estimate the expected reward for each generated token. The token-level advantage is computed as
where is the hidden state corresponding to token . The PPO clipped policy loss is then defined as
where is the PPO clipping threshold.
The value head is trained to regress to the normalized and clipped reward:
To prevent the policy from drifting too far from the SFT-initialized behavior, we use a frozen reference policy . We use a sampled KL penalty over the generated tokens to discourage the current policy from drifting too far from the frozen SFT reference policy [19]:
We also include an entropy bonus to encourage sufficient exploration during summary generation (Zheng et al., 2023):
where is the vocabulary.
The final PPO objective combines the clipped policy loss, value loss, entropy regularization, and KL regularization:
where , , and control the contributions of the value loss, entropy bonus, and KL penalty, respectively.
Staged Predictor–Summarizer Optimization
The RL optimization stage requires a reliable downstream predictor to provide meaningful feedback for the summarizer. When the predictor is under-trained, the reward signal can be noisy and may lead to unstable policy updates. To address this, we first train the predictor for epochs using , and then optimize the summarizer using , while the backbone of the predictor LLM is frozen. The two modules use separate optimizers, and :
After the warm-up stage, the predictor and summarizer are optimized with separate objectives and optimizers. The predictor continues minimizing , while the summarizer is updated using based on the prediction-feedback reward. This staged training provides a more reliable reward signal before the summarizer policy is updated, and reduces the risk of optimizing the summarizer against under-trained predictor feedback.
Evaluation
Datasets and Setups
In this study, we use two real-world datasets to evaluate model performance on medication and readmission prediction tasks.
MIMIC-III (Johnson et al., [13]) is an open-access database containing health records for over 40,000 patients admitted to critical care units between 2001 and 2012. In this study, we focus on patients with multiple visits and aim to predict binary outcomes.
MIMIC-IV (Johnson et al., [12]) is a publicly available EHR dataset containing records from over 380,000 patients admitted to Beth Israel Deaconess Medical Center between 2008 and 2019. It extends MIMIC-III with a clearer modular structure, richer clinical detail, and improved data provenance.
Both MIMIC-III and MIMIC-IV are publicly available through PhysioNet under controlled-access terms for credentialed researchers. The dataset statistics are summarized in Table 1. In this study, we consider two key healthcare prediction tasks: hospital readmission prediction (binary classification) and medication recommendation (multi-label classification). Given patient information up to visit , the model predicts the outcome at visit for patient based on prior visits. Since these tasks require longitudinal data, we excluded patients with only a single recorded visit. We randomly split the data into 70% training and 30% testing sets and report the mean over 4 seeds. The source code is released.2
| Metric | MIMIC-III | MIMIC-IV |
| # of patients | 7537 | 15874 |
| # of medications per patient | 79.30 | 113.55 |
| # of diagnoses per patient | 28.98 | 65.99 |
| # of procedures per patient | 7.37 | 9.08 |
| # of history visits per patient | 1.65 | 3.11 |
| Positive rate for readmission | 53.7% | 53.5% |
Table 1. Dataset statistics.
For both the LLM summarizer and the LLM-aware predictor, we utilize the Gemma-2-2B model. All experiments are implemented in Python, using PyTorch (Paszke et al., [20]) as the main deep learning framework. RASPER is also fully compatible with the PyHealth framework (Yang et al., 2023), which we use for implementing EHR baselines. For LLM tuning, we use the Hugging Face framework (Wolf et al., 2019). Experiments are conducted on a high-performance server with three NVIDIA A6000 GPUs.
The hyperparameters used in our experiments are shown in Table 2. These values were selected through a greedy search for the best performance.
| Component | Hyperparameter / Symbol | Value |
| Soft prompt encoder | 8 | |
| LLM hidden size | 2304 | |
| Max Summary length | 512 | |
| Reward normalization | ||
| Reward clipping | 2.0 | |
| PPO clipping | 0.2 | |
| Value loss weight | 0.5 | |
| Entropy weight | 0.01 | |
| KL weight | 0.02 | |
| Max PPO generation | 128 | |
| SFT epochs | 10 | |
| Predictor warm-up | 20 | |
| Optimizers | AdamW |
Table 2. Hyperparameters used in the proposed framework.
Baselines
We compare RASPER with representative deep EHR models, including Deepr (Nguyen et al., [18]), RETAIN (Choi et al., [2]), GRASP (Zhang et al., 2021), AdaCare (Ma et al., [15]), StageNet (Gao et al., [3]), ADORE (Cheong et al., [1]), and ARCI (H Moghaddam et al., [6]). We also compare against recent LLM-based healthcare prediction methods, including GraphCare (Jiang et al., [11]), LINKO (Nayebi Kerdabadi et al., [17]), and RePrompT (H Moghaddam et al., [7]). These baselines cover sequential EHR modeling, ontology-enhanced prediction, patient-similarity learning, knowledge-graph augmentation, and LLM-based EHR representation learning. More information about baselines is available in Appendix § 9.§ 2.
Discussion
Performance Comparison on Baselines
As shown in Table 3, the proposed method achieves the best performance across the baselines. RePrompT is the closest competing method, which is expected since it also uses a multimodal LLM-based design. The improvement over RePrompT demonstrates the effectiveness of the overall RASPER framework for jointly leveraging structured EHR representations and prediction-aligned clinical summaries. The gap between RETAIN, RePrompT, and our method also shows the value of using clinical notes in EHR modeling. Compared with models that rely only on structured codes, adding note information clearly improves the learned patient representations. In general, the LLM-based methods perform better than traditional deep learning baselines. Even when prior methods do not directly use clinical-note summarization, they suggest that LLM-based feature extraction [11, 17] and multimodal learning [7] are useful for prediction.
| Model | MIMIC-III Readmission AUROC | MIMIC-III Readmission PRAUC | MIMIC-III Medication F1 | MIMIC-III Medication Jaccard | MIMIC-IV Readmission AUROC | MIMIC-IV Readmission PRAUC | MIMIC-IV Medication F1 | MIMIC-IV Medication Jaccard |
| DL-based Methods | ||||||||
| Deepr (Nguyen et al., [18]) | 0.671 | 0.702 | 0.255 | 0.160 | 0.621 | 0.651 | 0.228 | 0.189 |
| RETAIN (Choi et al., [2]) | 0.657 | 0.678 | 0.253 | 0.156 | 0.673 | 0.698 | 0.349 | 0.255 |
| GRASP (Zhang et al., 2021) | 0.618 | 0.635 | 0.153 | 0.096 | 0.535 | 0.578 | 0.267 | 0.195 |
| AdaCare (Ma et al., [15]) | 0.645 | 0.687 | 0.235 | 0.133 | 0.615 | 0.644 | 0.251 | 0.184 |
| StageNet (Gao et al., [3]) | 0.678 | 0.705 | 0.239 | 0.139 | 0.659 | 0.690 | 0.278 | 0.202 |
| Adore (Cheong et al., [1]) | 0.665 | 0.698 | 0.152 | 0.125 | 0.615 | 0.643 | 0.206 | 0.165 |
| ARCI (H Moghaddam et al., [6]) | 0.648 | 0.669 | 0.283 | 0.184 | 0.668 | 0.698 | 0.303 | 0.246 |
| LLM-based Methods | ||||||||
| GraphCare (Jiang et al., [11]) | 0.665 | 0.705 | 0.294 | 0.195 | 0.688 | 0.711 | 0.355 | 0.259 |
| LINKO (Nayebi Kerdabadi et al., [17]) | 0.674 | 0.711 | 0.304 | 0.202 | 0.695 | 0.715 | 0.367 | 0.264 |
| RePrompT (H Moghaddam et al., [7]) | <u>0.682</u> | <u>0.718</u> | <u>0.312</u> | <u>0.206</u> | <u>0.702</u> | <u>0.723</u> | <u>0.375</u> | <u>0.273</u> |
| RASPER | 0.704 | 0.738 | 0.326 | 0.218 | 0.725 | 0.742 | 0.388 | 0.282 |
Table 3. Baseline performance comparison on MIMIC-III and MIMIC-IV. Best results are in bold, and underlined results denote the second-best results that are statistically lower at the 95% confidence level.
Ablation Studies on Modules
As shown in Table 4, removing the EHR encoder leads to the largest performance drop, indicating that cohort-level structured information is essential for complementing patient-specific clinical notes. In addition, directly using noisy clinical notes as input leads to worse performance than the proposed method, supporting the main motivation of our paper: raw discharge notes contain redundant and noisy information that can distract the predictor. The GPT-based summarizer improves over raw-note input by reducing this noise, but it still relies on generic summarization objectives and is not explicitly optimized for the clinical prediction task. In contrast, our proposed method further improves performance by aligning the summaries with downstream prediction loss through RL-based optimization. This gap shows that prediction-aligned summarization adds value beyond generic note compression and helps preserve useful information for the final prediction.
| Model Variant | MIMIC-III Readmission AUROC | MIMIC-III Readmission PRAUC | MIMIC-III Medication F1 | MIMIC-III Medication Jaccard | MIMIC-IV Readmission AUROC | MIMIC-IV Readmission PRAUC | MIMIC-IV Medication F1 | MIMIC-IV Medication Jaccard |
| RASPER w/o EHR encoder | 0.661 | 0.698 | 0.288 | 0.187 | 0.685 | 0.704 | 0.353 | 0.258 |
| RASPER w/o Summarization | 0.674 | 0.712 | 0.298 | 0.191 | 0.691 | 0.713 | 0.363 | 0.262 |
| RASPER w/o RL (GPT only) | <u>0.689</u> | <u>0.725</u> | <u>0.309</u> | <u>0.201</u> | <u>0.708</u> | <u>0.723</u> | <u>0.371</u> | <u>0.272</u> |
| RASPER w/o RL (SFT only) | 0.684 | 0.721 | 0.305 | 0.198 | 0.701 | 0.718 | 0.367 | 0.269 |
| RASPER | 0.704 | 0.738 | 0.326 | 0.218 | 0.725 | 0.742 | 0.388 | 0.282 |
Table 4. Ablation studies on MIMIC-III and MIMIC-IV. Best results are in bold, and underlined results denote the second-best results that are statistically lower at the 95% confidence level.
Ablation Studies on Encoder Selection
The EHR encoder plays a central role in converting the structured medical codes in a patient’s longitudinal history into cohort-level representations. To study this effect, we replace the structured encoder with different EHR modeling backbones and report the results in Figure 3. Among the compared encoders, RETAIN achieves the best overall performance. This is likely because RETAIN captures patient history at multiple levels. As a result, the generated soft tokens provide more informative structured signals to the LLM predictor. The gains are consistent across datasets and evaluation metrics, suggesting that the benefit is not limited to a single task setting. These results also indicate that the proposed framework can benefit from stronger structured EHR encoders.

Figure 3. Performance comparison across different EHR models on MIMIC-III and MIMIC-IV.
LLM Model Selection
To examine the sensitivity of RASPER to the choice of LLM backbone, we conduct additional experiments using different LLMs, as shown in Table 5. Since RASPER relies on LLMs for both clinical note summarization and prediction, changing the backbone can affect the final performance. Overall, Gemma-2-2B achieves the best performance across all metrics, suggesting that a stronger backbone can provide better clinical representations and improve downstream prediction. However, the performance gaps between Gemma2-2B, Llama-3.2-1B, and Qwen2.5-0.5B are relatively small in most settings. This indicates that RASPER is not highly dependent on a specific LLM architecture, and the main performance gain comes from the proposed framework.
| Backbone | MIMIC-III | MIMIC-III | MIMIC-III | MIMIC-III | MIMIC-IV | MIMIC-IV | MIMIC-IV | MIMIC-IV |
| Readmission AUROC | Readmission PRAUC | Medication F1 | Medication Jaccard | Readmission AUROC | Readmission PRAUC | Medication F1 | Medication Jaccard | |
| Llama-3.2-1B | 0.701 | 0.734 | 0.321 | 0.214 | 0.722 | 0.737 | 0.384 | 0.278 |
| Qwen2.5-0.5B | 0.697 | 0.730 | 0.315 | 0.209 | 0.716 | 0.731 | 0.379 | 0.276 |
| Gemma-2-2B | 0.704 | 0.738 | 0.326 | 0.218 | 0.725 | 0.742 | 0.388 | 0.282 |
Table 5. Comparison of LLM backbones on MIMIC-III and MIMIC-IV across two tasks.
Related Work
A large body of work has studied how to learn predictive representations from Electronic Health Records for clinical decision support. Early neural models such as RETAIN [2] improve interpretability by applying reverse-time attention over visits and medical variables, allowing the model to emphasize clinically important parts of a patient’s history. Other methods incorporate medical ontologies to reduce sparsity and improve the use of domain knowledge. For example, Hierarchical Attention Propagation (HAP) (Zhang et al., 2020) propagates attention through ontology structures to capture relationships between ancestor and descendant concepts. Temporal disease progression and patient heterogeneity have also been widely studied. AdaCare [15] models both short- and long-term variations in clinical signals using multi-scale convolutional modules, while StageNet [3] introduces stage-aware modeling to capture disease progression over time. These methods improve clinical prediction by better modeling structured EHR sequences, attention patterns, or disease stages. However, they mainly rely on structured medical codes or numerical features, and therefore do not fully exploit the rich information in unstructured clinical notes.
Recent advances in Large Language Models (LLMs) have motivated their use for EHR representation learning and clinical prediction. GraphCare [11] constructs patient-specific knowledge graphs by combining structured knowledge bases with LLM-generated knowledge, and applies a bi-attention-augmented GNN for prediction. RAM-EHR (Xu et al., 2024) augments patient representations through LLM-powered dense retrieval from multiple knowledge sources, together with consistency regularization to improve robustness. Prompting-based studies (Zhu et al., 2024) further show that carefully designed prompts incorporating EHR-specific information can enable LLMs to perform clinical prediction in few-shot or zero-shot settings. LINKO [17] uses LLM-initialized medical concept embeddings and performs dual-axis knowledge propagation, both within individual ontologies and across different ontology systems, and RePrompT [7] incorporates structured EHR encoders into LLMs through prompt tuning, using recurrent visit-level states and cohort-trained soft prompts.
Conclusion
We proposed RASPER, a reward-aligned framework that integrates structured EHR codes and discharge notes for clinical prediction. RASPER uses EHR soft prompts to capture cohort-level patterns and prediction-aligned summaries to retain useful patient-specific context. By optimizing the summarizer with downstream prediction feedback, RASPER produces summaries that are more directly useful for the target task. Experiments on MIMIC-III and MIMIC-IV show consistent improvements over strong baselines.
Limitations
Although RASPER shows strong performance, this study has two limitations. First, the experiments are conducted only on MIMIC-III and MIMIC-IV, so additional evaluation on datasets from other hospitals would better show its generalizability. Second, the current framework focuses on prediction performance and does not deeply analyze how different summary lengths or prompt formats affect the final results.
Ethical Considerations
This study uses publicly available, de-identified EHR datasets and does not involve direct interaction with patients. The proposed framework is intended to support clinical prediction research rather than replace clinical judgment. Because generated summaries may omit clinically relevant information or introduce inaccuracies, the proposed framework should not be used as an autonomous clinical decision-making system. We used AI-assisted tools to support language editing, grammar correction, and clarity improvement during manuscript preparation.
Acknowledgments
This work was supported by the National Science Foundation under Grant No. IIS-2544634.
Appendix
RETAIN Encoder
For the structured EHR encoder, we use RETAIN [2], which maps longitudinal medical code sequences into dense patient representations through a two-level attention mechanism: Visit-level and variable-level attention. The visit-level attention captures the relative importance of the visit embeddings :
The variable-level attention assigns featurewise weights to the visit representation:
The final patient representation is computed by combining the two attention-weighted signals:
The model outputs a sequence of visit-level embeddings , where the final embedding at visit is used as the patient-level EHR representation, denoted by .
Baselines
In this research, we compare RASPER with both established healthcare deep learning methods and LLM-based approaches. The deep learning baselines include Deepr [18], which represents patient records as sequences of coded events with time gaps and hospital transfers and applies a CNN for prediction; RETAIN [2], which uses a dual-RNN attention mechanism to capture the interpretable influence of visits and medical features; GRASP (Zhang et al., 2021), which improves EMR-based prediction by identifying clinically similar patients; AdaCare [15], which captures both short- and long-term biomarker variations and adaptively emphasizes patient-specific risk factors; StageNet [3], a stage-aware neural network that models disease progression using LSTM and stage-adaptive convolution; ADORE [1], which uses attention to adapt medical ontology category embeddings to EHR data for clinical prediction; and ARCI [6], which disentangles coexisting temporal medical intents across sequential visits. We also compare RASPER with three recent LLM-based healthcare prediction methods: GraphCare [11], which extracts knowledge from LLMs and external biomedical knowledge graphs to construct patient-specific KGs and train a Bi-attention Augmented GNN for clinical prediction; LINKO [17], which uses LLM-augmented initialization and dual-axis knowledge propagation to jointly learn medical concept representations across multiple ontology graphs; and RePrompT [7], which integrates structured EHR encoders with LLMs through time-aware prompt tuning, preserving longitudinal visit information and injecting cohort-level representations via trainable prompt tokens.
Inference Time Comparison
Table 6: Inference time comparison for a batch of 12 patients.
In Table 6, we compare the proposed method with existing baselines to provide an inference time analysis. While our model is more complex than RePrompT, the observed performance gains suggest that this additional complexity is justified and contributes meaningful predictive benefit.
| Model | Time (s) |
| Deepr | 0.09 |
| RETAIN | 0.06 |
| GRASP | 0.17 |
| AdaCare | 0.05 |
| StageNet | 0.11 |
| Adore | 0.21 |
| ARCI | 0.92 |
| GraphCare | 0.34 |
| LINKO | 0.24 |
| RePrompT | 1.38 |
| RASPER | 1.87 |
Table 6.
References
- [1]Chin Wang Cheong, Kejing Yin, William K Cheung, Benjamin CM Fung, and Jonathan Poon. 2023. Adaptive integration of categorical and multi-relational ontologies with ehr data for medical concept embedding. ACM Transactions on Intelligent Systems and Technology, 14(6):1–20.DOI
- [2]Edward Choi, Mohammad Taha Bahadori, Jimeng Sun, Joshua Kulas, Andy Schuetz, and Walter Stewart. 2016. Retain: An interpretable predictive model for healthcare using reverse time attention mechanism. Advances in neural information processing systems, 29.arxiv.org/abs/1608.05745
- [3]Junyi Gao, Cao Xiao, Yasha Wang, Wen Tang, Lucas M Glass, and Jimeng Sun. 2020. Stagenet: Stage-aware neural networks for health risk prediction. In Proceedings of the web conference 2020, pages 530–540.DOI
- [4]Senay A Gebreab, Khaled Salah, Raja Jayaraman, Muhammad Habib ur Rehman, and Samer Ellaham. 2024. Llm-based framework for administrative task automation in healthcare. In 2024 12th International Symposium on Digital Forensics and Security (ISDFS), pages 1–7. IEEE.DOI
- [5]Sagar Goyal, Eti Rastogi, Sree Prasanna Rajagopal, Dong Yuan, Fen Zhao, Jai Chintagunta, Gautam Naik, and Jeff Ward. 2024. Healai: A healthcare llm for effective medical documentation. In Proceedings of the 17th ACM International Conference on Web Search and Data Mining, pages 1167–1168.DOI
- [6]Arya H Moghaddam, Mohsen Nayebi Kerdabadi, Mei Liu, and Zijun Yao. 2024. Contrastive learning on medical intents for sequential prescription recommendation. In Proceedings of the 33rd ACM International Conference on Information and Knowledge Management, pages 748–757.DOI
- [7]Arya H Moghaddam, Drew Ross, Mohsen Nayebi Kerdabadi, Dongjie Wang, and Zijun Yao. 2026. Reprompt: Recurrent prompt tuning for integrating structured ehr encoders with large language models. In Findings of the Association for Computational Linguistics: ACL 2026, pages 26766–26778.
- [8]Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2021. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685.arxiv.org/abs/2106.09685
- [9]Kexin Huang, Jaan Altosaar, and Rajesh Ranganath. 2019. Clinicalbert: Modeling clinical notes and predicting hospital readmission. arXiv preprint arXiv:1904.05342.arxiv.org/abs/1904.05342
- [10]Lavender Yao Jiang, Xujin Chris Liu, Nima Pour Nejatian, Mustafa Nasir-Moin, Duo Wang, Anas Abidin, Kevin Eaton, Howard Antony Riina, Ilya Laufer, Paawan Punjabi, et al. 2023. Health system-scale language models are all-purpose prediction engines. Nature, 619(7969):357–362.DOI
- [11]Pengcheng Jiang, Cao Danica Xiao, Adam Cross, and Jimeng Sun. 2024. Graphcare: Enhancing healthcare predictions with personalized knowledge graphs. In International Conference on Learning Representations, volume 2024, pages 16839–16866.arxiv.org/abs/2305.12788
- [12]Alistair Johnson, Lucas Bulgarelli, Tom Pollard, Steven Horng, Leo Anthony Celi, and Roger Mark. 2021. MIMIC-IV. PhysioNet.
- [13]Alistair EW Johnson, Tom J Pollard, Lu Shen, Li-wei H Lehman, Mengling Feng, Mohammad Ghassemi, Benjamin Moody, Peter Szolovits, Leo Anthony Celi, and Roger G Mark. 2016. Mimic-iii, a freely accessible critical care database. Scientific data, 3(1):160035.DOI
- [14]Jinghui Liu, Daniel Capurro, Anthony Nguyen, and Karin Verspoor. 2022. “note bloat” impacts deep learning-based nlp models for clinical prediction tasks. Journal of biomedical informatics, 133:104149.DOI
- [15]Liantao Ma, Junyi Gao, Yasha Wang, Chaohe Zhang, Jiangtao Wang, Wenjie Ruan, Xin Gao, and Xinyu Ma. 2020. Adacare: Explainable clinical health status representation learning via scale-adaptive feature extraction and recalibration. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 825–832.arxiv.org/abs/1911.12205
- [16]Bertalan Meskó. 2023. Prompt engineering as an important emerging skill for medical professionals: tutorial. Journal of medical Internet research, 25:e50638.DOI
- [17]Mohsen Nayebi Kerdabadi, Arya H Moghaddam, Dongjie Wang, and Zijun Yao. 2025. Multi-ontology integration with dual-axis propagation for medical concept representation. In Proceedings of the 34th ACM International Conference on Information and Knowledge Management, pages 2201–2211.arxiv.org/abs/2508.21320
- [18]Phuoc Nguyen, Truyen Tran, Nilmini Wickramasinghe, and Svyetha Venkatesh. 2017. DeepR: a convolutional net for medical records. IEEE journal of biomedical and health informatics, 21(1):22–30.arxiv.org/abs/1607.07519
- [19]Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35:27730–27744.arxiv.org/abs/2203.02155
- [20]Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, and 2 others. 2019. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32.arxiv.org/abs/1912.01703
AI tools statement
No AI-use declaration is available for this version in Valency.
The available record does not establish whether AI systems or models contributed to this work.