AI Model Predicts Opioid Addiction Risk Before It Happens—And Works Across Any Hospital System
New deep learning tool achieves 91% accuracy in identifying which patients will develop opioid use disorder within a year, solving a critical interoperability problem that has stymied clinical AI deployment.

Illustration: AI-generated
The opioid crisis continues to claim tens of thousands of lives annually, and identifying which patients prescribed opioids will develop addiction remains a significant clinical challenge. A new deep learning model called OUD-REY (OUD Risk Evaluator at 1 Year) may help address this gap—and it does so while tackling one of healthcare AI's most stubborn technical challenges: working seamlessly across different hospital systems.
Developed by researchers affiliated with UC San Diego and validated across millions of patient records, the model achieved 91.2% accuracy (AUROC) in predicting one-year opioid use disorder risk among patients receiving opioid prescriptions. The model maintained strong performance when tested on completely different healthcare systems, reaching 86.4% accuracy on NIH's All of Us Research Program data and 85.5% accuracy across approximately 6 million Veterans Affairs patients spanning 20 years.
Addressing the EHR Compatibility Barrier
What distinguishes OUD-REY from previous clinical AI models is its use of pretrained language modeling to harmonize data across electronic health record (EHR) systems—an approach that addresses a fundamental obstacle to deploying AI in healthcare. Different hospitals code the same conditions, medications, and procedures differently, creating a "vocabulary mismatch" that causes most AI models to fail when moved from one system to another.
By leveraging language modeling techniques, OUD-REY can accommodate thousands of unseen, out-of-vocabulary clinical features from longitudinal EHR data without requiring manual recoding or retraining. This technical innovation enables the model to work across diverse healthcare environments, from community hospitals to VA medical centers, without the extensive customization that has limited previous clinical AI tools.
The model analyzes comprehensive patient histories—diagnoses, medications, procedures, and other clinical data points—to stratify risk at the moment when opioids are prescribed, potentially allowing clinicians to implement early interventions, explore alternative pain management strategies, or establish enhanced monitoring protocols.
Real-World Validation and Fairness
The research team validated OUD-REY's performance using data from the All of Us Research Program and Veterans Affairs medical centers nationwide. In the All of Us dataset, where OUD prevalence was 2.9%, the model achieved an AUPRC of 23.1%. In the VA dataset, with 3.5% OUD prevalence, it reached 19.5% AUPRC—metrics the researchers indicate demonstrate clinically meaningful discrimination in real-world populations.
Fairness assessments showed the model performed equitably across gender, race, and ethnic backgrounds, addressing concerns about algorithmic bias that have plagued other healthcare AI applications. This fairness profile may support deployment across diverse patient populations without exacerbating existing healthcare disparities.
The researchers note that while the authors received no specific funding for this work, the broader All of Us Research Program context was supported by Wellcome Leap's Untangling Addiction Program. A provisional patent (U.S. Provisional Application No. 63/928,574) has been filed covering the deep learning architecture for EHR data harmonization in OUD risk prediction.
Clinical Implications
For the 3-4% of opioid-prescribed patients who develop use disorder, early identification could prove significant. Health systems and payers now have a potential tool for risk stratification that doesn't require expensive system-wide EHR standardization. The cross-system generalizability suggests the model may be deployable across different healthcare environments, though real-world implementation would still require appropriate clinical validation and integration into existing workflows.
As the opioid epidemic continues, tools that enable precision prevention—identifying high-risk patients before addiction takes hold—represent a critical complement to treatment and harm reduction strategies.
Sources
Reporting & accountability
How we maintain accuracy
Health AI Central separates reported facts, analysis, and public-source data. Readers can review our standards, request a correction, or consult the relevant research methodology before relying on a claim.