RAVEN uses next-visit prediction to push EHR foundation modeling forward
The new RAVEN framework takes a direct swing at one of the hardest problems in clinical artificial intelligence: how to learn from structured electronic health records without confusing repeat documentation for true new disease onset. Built around recurrence-aware next-visit prediction, the model is trained to autoregressively generate tokenized clinical events for a patient’s upcoming encounter, conditioned on prior history. In practical terms, that means the model is not simply learning whether a diagnosis code ever appeared; it is learning the sequence in which events recur, reappear, and evolve across visits. For clinical records, where chronic conditions, follow-up coding, and duplicate entries are routine, that distinction changes the entire evaluation problem.
The cohort scale matters. RAVEN was trained on data from more than one million unique individuals, giving the model enough volume to examine how performance changes as data and parameter count increase. The work makes a clear case that standard scaling rules from general language modeling do not transfer cleanly to healthcare records. In a data-constrained, compute-saturated setting, simply making the model larger was not the winning strategy. Without a commensurate increase in training data, added parameters offered diminishing returns.
This is a familiar trap in biomedical machine learning. Clinical records are sparse, irregular, and shaped by care delivery rather than by a clean narrative arc. A diagnosis code may mark a true incident event, a historical condition, or a repeated billing entry. When a model cannot separate those states, it can appear stronger on paper than it is in bedside reality. RAVEN directly addresses this by adding regularization for repeated events and by calling out a major evaluation pitfall: repeated event tokens can inflate performance if new onset is not distinguished from subsequent occurrences.
Why repeated events can distort model performance
Repeated codes are not a minor bookkeeping issue. They can make a model look better at prediction while leaving the clinically relevant question unanswered: did the patient truly develop the disease, or was the condition simply recoded at another encounter? In that setting, a model that learns frequency alone may overestimate near-term risk and underperform where it matters most, such as identifying incident disease early enough to change management. By building recurrence awareness into the learning objective, RAVEN tries to move evaluation closer to the real decision task clinicians face.
The paper’s zero-shot testing strategy adds another layer of relevance. Without additional parameter updates, RAVEN was used to forecast the incidence of a diverse set of diseases, where it rivaled fully fine-tuned representation-based Transformer models. It also outperformed standard simulation-based next-token approaches and a prompted medical large language model baseline. For a model that was not task-tuned for each disease endpoint, that result suggests the pretraining objective captured clinically useful temporal structure rather than only memorized code patterns.
The external validation is equally important. RAVEN generalized to an outside patient cohort without additional parameter updates, even when confronted with lossy clinical code mappings and gaps in feature coverage. Those are the conditions that usually expose brittle systems. Real-world health data rarely arrive in a pristine, standardized format, and different institutions encode the same clinical reality in different ways. A model that can tolerate those mismatches has a better chance of surviving contact with operational healthcare data.
Clinical records reward temporal structure, not just scale
The study’s central message is not that bigger models are useless. It is more specific than that. In structured EHR data, scale only helps when the model is trained on enough diverse longitudinal information to justify its capacity. Otherwise, increasing size without increasing data volume becomes inefficient. That insight is especially relevant for hospitals and health systems that want to build local predictive tools from constrained datasets, where compute budgets may outpace the available clinical history.
From a translational perspective, the recurrence-aware approach could be useful anywhere the distinction between first occurrence and repeat documentation affects downstream risk estimation. Disease incidence forecasting, surveillance of chronic conditions, and visit-to-visit trajectory modeling all depend on that separation. A model that treats every recurrence as a fresh onset risks skewing predictions toward the noisiest parts of the record. RAVEN’s design tries to suppress that error before it reaches evaluation.
External generalization remains the decisive test
Generalization across institutions is where many EHR models fail, and the external cohort performance here is one of the most clinically meaningful findings. Lossy code mappings and incomplete feature coverage are not edge cases; they are the norm in multi-site data science. Demonstrating zero-shot transfer under those conditions suggests the model learned a more robust representation of clinical sequence dynamics than a narrow site-specific code lookup table would allow.
The paper also lands in a broader methodological debate around foundation models in medicine. Healthcare AI often borrows concepts from general-purpose language modeling, then assumes the same scaling behavior will hold once the text is replaced with codes and visits. This work argues against that assumption. In clinical records, recurrence, censoring, and encounter structure shape the signal. A next-visit prediction objective that makes those elements explicit may be a better fit than generic next-token simulation alone.
One practical consequence stands out. If repeated events are not handled correctly, the model can appear to predict disease more accurately than it truly does. That is a dangerous kind of optimism in clinical prediction research.
The study was published in npj Digital Medicine and is identified by DOI 10.1038/s41746-026-03386-8. Its authorship and support details place the work squarely at the intersection of data science, radiology, population health, and biomedical imaging, but the central contribution is methodological: a recurrence-aware pretraining strategy for sequential EHR data that is explicitly designed to better match how clinical records are actually written, repeated, and reused.
What remains unresolved is how far this approach will go when moved from retrospective prediction into prospective clinical deployment. The paper establishes stronger pretraining and more careful evaluation, but the next step is to see whether those gains translate into safer, more actionable decision support inside live workflows rather than only in benchmark forecasting.
- • Journal DOI 10.1038/s41746-026-03386-8: https://doi.org/10.1038/s41746-026-03386-8