Manuscript Offprint

arXiv:2609.05682

A Rubric-Guided Large Language Model Solution for Opioid Use Disorder Computable Phenotyping

Mengxian Lyu, Paredes Pardo, Cheng Peng, Ziyi Chen, Mengyuan Zhang, Jieting Li Lu, Gary M Reisfield, William M Greene, Jenny Lo-Ciganic, Yonghui Wu

Mengxian Lyu, MS¹, Paredes Pardo, MS¹, Cheng Peng, PhD¹, Ziyi Chen, MS¹, Mengyuan Zhang, MS¹, Jieting Li Lu, BS², Gary M Reisfield, M.D³, William M Greene, M.D³, Lo-Ciganic Jenny, PhD, MS, MSPharm⁴*, Yonghui Wu, PhD¹, ⁵*

¹Department of Health Outcomes and Biomedical Informatics, College of Medicine, University of Florida, Gainesville, FL, USA; ²Department of Engineering Education, Herbert Wertheim College of Engineering, University of Florida, Gainesville, FL, USA; ³Department of Psychiatry, College of Medicine, University of Florida, Gainesville, FL, USA; ⁴Division of General Internal Medicine, Department of Medicine, University of Pittsburgh School of Medicine, Pittsburgh, PA, USA; ⁵Preston A. Wells, Jr. Center for Brain Tumor Therapy, Lillian S. Wells Department of Neurosurgery, University of Florida, Gainesville, Florida, USA.

Abstract

Opioid use disorder (OUD) remains a public health crisis in the United States, yet it is difficult to identify from electronic health records (EHRs) because missing diagnosis codes and supporting evidence are buried in clinical narratives. Accurate OUD identification is critical to support interventions and improve health outcomes. This study developed a rubric-guided large language model (LLM) that incorporated Optimization by PROMpting (OPRO) for OUD computable phenotyping (CP). The framework used an 18-item, expert-identified rubric to instruct LLMs to automatically extract critical text with supporting evidence to determine OUD flags. Two UF Health physicians (GMR and WMG) chart-reviewed 253 patients, including 68 OUD-positive cases. Our LLM-based computable phenotype (CP) achieved the best F1 score of 0.774 and an AUROC of 0.934, outperforming the machine learning-based CP using EHR and natural language processing-extracted variables, and zero-shot LLMs by relative F1 improvements of 12.8% and 44.4%, respectively. The proposed LLM-based CP could link LLM-extracted evidence to OUD phenotyping for better explainability.

Introduction

Opioid use disorder (OUD) is a major national public health threat in the United States¹,². The 2024 National Survey on Drug Use and Health estimated that 4.8 million people aged 12 years or older had OUD³. Healthcare systems propose various intervention programs to counter this crisis; however, such interventions require accurately identifying patients with OUD from electronic health records (EHRs), which is challenging. OUD is well-known as undercoded in EHRs; among patients prescribed opioids, it is estimated that only approximately 10% of them could be identified using OUD International Classification of Diseases (ICD) codes.⁴ A study reported that across six U.S. primary-care systems, documented OUD diagnoses ranged from approximately 0.7% to 1.4% over three years⁵. Other evidence may be documented as heroin or fentanyl use, use of opioids other than as prescribed, medication treatment for OUD, injection-related complications, naloxone administration, polysubstance use, or opioid-seeking behavior⁶. Many of these cases may appear in the EHR without a clear OUD diagnosis. There is a critical gap in accurately identifying OUD cases from routinely collected EHR data to support clinical intervention and large-scale OUD studies.

In disease phenotyping, domain experts' chart review of EHRs is typically considered a gold standard. However, manual review is time-consuming and cannot scale up to support large-scale studies. Medical researchers typically develop a computable algorithm to automatically identify OUD cases by screening large-scale EHRs, which is known as a computable phenotyping (CP) algorithm. Previous studies have developed OUD CPs using rule-based or machine-learning models⁷. Rule-based CPs use domain experts to manually identify combinations of diagnosis codes, medications, laboratory results, and other EHR events. Rule-based CPs are efficient for screening large-scale EHRs, but they require substantial manual development and are difficult to expand or adapt across health systems⁸. Machine-learning-based CPs automatically learn important features from a larger number of structured EHR variables, including free-text variables that are extracted from clinical notes by natural language processing (NLP)⁹. Most CPs use structured EHRs, and a few explore clinical narratives, where NLP extracts information from clinical notes and encodes it into discrete features.

Large language models (LLMs) have become widely accepted as a standard solution for processing clinical narratives, offering a novel way to use whole-text clinical narratives instead of only small pieces of text extracted by NLP. Recent studies have applied LLMs to extract OUD-related information from clinical narratives and to identify patients with

OUD from clinical notes¹¹,¹². LLMs can recognize OUD-related evidence and return structured evidence together with supporting excerpts from the source notes. These capabilities make LLMs particularly promising for evidence-based OUD computable phenotyping, in which clinically relevant observations can be identified from narrative documentation to further improve CP for OUD.

LLM-based phenotyping combines evidence identification and patient-level classification in a unified system ¹³. This study aims to explore LLM-based CPs and develop algorithms to integrate evidence and rules previously identified in the literature. Two UF Health physicians chart-reviewed a cohort of 300 patients to create a gold standard dataset with 253 valid subjects. We explored LLM-based CPs and developed a method to integrate existing expert-identified evidence and rules to further improve CP for OUD. The framework comprised three components: OUD evidence items adapted from a physician-developed documentation ruleset, LLM-based extraction of item-level judgments with supporting text, and logistic regression for patient-level aggregation. We further used Optimization by PROmpting¹⁴ (OPRO) to refine the evidence-extraction prompt and evaluated alternative evidence specifications and aggregation strategies. We compared our LLM-based solution with rule-based CP using diagnosis codes, machine learning-based CPs, and zero-shot LLM baselines. The chart-reviewed cohort is used to develop and evaluate the CP algorithms. The evaluation results show that our LLM-based CP achieved the best AUROC score of 0.934 and the best F1 score of 0.774, outperforming machine learning-based CPs by 12.8% and outperforming zero-shot LLMs by 44.4%. The proposed LLM-based CP improved accuracy in identifying OUD cases and provided better explainability by linking text evidence to CP determinations through the LLM's attention mechanism.

References (17)

  • Opioid Use Disorder: Evaluation and Management
  • Evaluation of machine-learning algorithms for predicting opioid overdose risk among Medicare beneficiaries with opioid prescriptions
  • Development and validation of an electronic health records-based opioid use disorder algorithm by expert clinical adjudication among patients with prescribed opioids
  • Documented opioid use disorder and its treatment in primary care patients across six U.S
  • A comparison of veterans with problematic opioid use identified through natural language processing of clinical notes versus using diagnostic codes
  • Using natural language processing to identify opioid use disorder in electronic health record data
  • Advances in electronic phenotyping: From rule-based definitions to machine learning models
  • Identifying opioid use disorder in the emergency department: Multi-system electronic health record-based computable phenotype derivation and validation study
  • Computable structured phenotype versus large language model identification of opioid use disorder using electronic health record data (opens the publisher in a new tab)
  • Identifying opioid overdose and opioid use disorder and related information from clinical narratives using large language models
  • Zero-shot learning for clinical phenotyping: Comparing LLMs and rule-based methods
  • Large Language Models as Optimizers (opens arXiv in a new tab)
  • gpt-oss-120b & gpt-oss-20b Model Card
  • Identifying social determinants of health from clinical narratives: A study of performance, documentation ratio, and potential bias
  • Using natural language processing and machine learning to identify hospitalized patients with opioid use disorder
  • Automatically identifying opioid use disorder in non-cancer patients on chronic opioid therapy
  • Large language models are few-shot clinical information extractors