A language model framework for sequence modeling of audit logs to characterize clinician–electronic health record interactions
- 12 October 2026
- journal article
- Published by Oxford University Press (OUP) in Journal of the American Medical Informatics Association
Abstract
Objective: Electronic health record (EHR) audit logs capture clinician-EHR interaction patterns, but most audit log research relies on aggregated measures (eg, total time). We investigated how audit logs could be modeled using large language model (LLM) architectures to learn underlying workflow sequences during clinician-EHR interactions. Materials and methods: Using >295 million EHR-based audit log actions from inpatient settings spanning 2019 to 2024, we fine-tuned Llama-3-8B under 2 encodings: (1) symbolic (field-based) tokens and (2) semantic (word-based) natural language-based audit log action descriptions. A first-order Markov model, using only the immediate prior action, served as a baseline minimal context comparator. Model representation was assessed using next-action prediction accuracy in an early-period test set and 2 temporally distinct out-of-sample (OOS) periods. Results: In the early-period test set, the word-based LLM achieved the highest accuracy (0.7473; 95% CI, 0.7468-0.7478) compared to the field-based LLM (0.3464; 95% CI, 0.3456-0.3472) and Markov baseline (0.4230; 95% CI, 0.4223-0.4236). The word-based approach retained a substantial performance advantage over the Markov baseline across the OOS periods, although accuracy declined over time (word-based LLM vs Markov accuracy, OOS-1: 0.6555 vs 0.3139, OOS-2: 0.6286 vs 0.2720). Discussion: Word-based LLM relying on audit log action descriptions yielded the highest next-action prediction accuracy and demonstrated relative robustness to temporal drift, suggesting that longer sequential context and word-based action descriptions may improve audit log-based sequence modeling. Conclusions: These findings support the development of natural language-based LLM models for audit log research for task identification, workflow characterization, and safety-focused analyses of clinician-EHR interaction patterns.Keywords
Funding Information
- Agency for Healthcare Research and Quality (#R01HS029020)
This publication has 42 references indexed in Scilit:
- Anesthesia Clinical Workload Estimated From Electronic Health Record Documentation vs Billed Relative Value UnitsJAMA Network Open, 2023
- Temporal Associations Between EHR-Derived Workload, Burnout, and Errors: a Prospective Cohort StudyJournal of General Internal Medicine, 2022
- Effect of clinician attention switching on workload and wrong-patient errorsBritish Journal of Anaesthesia, 2022
- Evaluation of Attention Switching and Duration of Electronic Inbox Work Among Primary Care PhysiciansJAMA Network Open, 2021
- EHR audit logs: A new goldmine for health services research?Journal of Biomedical Informatics, 2020
- Using the PARAFAC2 tensor factorization on EHR audit data to understand PCP desktop workJournal of Biomedical Informatics, 2020
- Effect of Restriction of the Number of Concurrently Open Records in an Electronic Health Record on Wrong-Patient Order ErrorsJAMA, 2019
- Meaningful Use of Electronic Health RecordsJAMA, 2010
- Workflow modeling in critical care: Piecing together your own puzzleJournal of Biomedical Informatics, 2007
- The effects of domain knowledge on search tactic formulationJournal of the American Society for Information Science and Technology, 2003