<scp>AI</scp> for <scp>NONMEM</scp> Coding in Pharmacometrics Research and Education: Shortcut or Pitfall?

Artificial intelligence (AI) is increasingly being explored as a tool to support pharmacometric modeling, particularly in addressing the coding challenges associated with NONMEM. In this study, we evaluated the ability of seven Large Language Models (LLMs) to generate NONMEM codes across 13 pharmacometrics tasks, including a range of population pharmacokinetic (PK) and pharmacodynamic (PD) models. We further developed a standardized scoring rubric to assess code accuracy and created an optimized prompt to improve LLM performance. Our results showed that the OpenAI o1 and gpt-4.1 models achieved the best performance, both generating codes with great accuracy for all tasks when using our optimized prompt. Overall, LLMs performed well in writing basic NONMEM model structures, providing a useful foundation for pharmacometrics model coding. However, user review and refinement remain essential, especially for complex models with special dataset alignment or advanced coding techniques. We also discussed the applications of AI in pharmacometrics education, particularly strategies to prevent overreliance on AI for coding. This work provides a benchmark for current LLMs' performance in NONMEM coding and introduces a practical prompt that can facilitate more accurate and efficient use of AI in pharmacometrics research and education.

Authors

Institutions

Publication Details

Journal
CPT Pharmacometrics & Systems Pharmacology
Published
2025-11-04
DOI
https://doi.org/10.1002/psp4.70125
Citations
1
Primary Topic
Computational Drug Discovery Methods
Type
article
Field-Weighted Citation Impact
1.50

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

AI for NONMEM Coding in Pharmacometrics Research and Education: Shortcut or Pitfall?

Cornelia B. Landersdorfer, Carl M. J. Kirkpatrick, Huaxiu Yao, Wenhao Zheng et al.
1 citations
CPT Pharmacometrics & Systems Pharmacology
Computational Drug Discovery Methods
1.50
article

AI for NONMEM Coding in Pharmacometrics Research and Education: Shortcut or Pitfall?

Cornelia B. Landersdorfer, Carl M. J. Kirkpatrick, Huaxiu Yao, Wenhao Zheng, W. C. Wang, Jiawei Zhou
article en
1 citations

Abstract

Artificial intelligence (AI) is increasingly being explored as a tool to support pharmacometric modeling, particularly in addressing the coding challenges associated with NONMEM. In this study, we evaluated the ability of seven Large Language Models (LLMs) to generate NONMEM codes across 13 pharmacometrics tasks, including a range of population pharmacokinetic (PK) and pharmacodynamic (PD) models. We further developed a standardized scoring rubric to assess code accuracy and created an optimized prompt to improve LLM performance. Our results showed that the OpenAI o1 and gpt-4.1 models achieved the best performance, both generating codes with great accuracy for all tasks when using our optimized prompt. Overall, LLMs performed well in writing basic NONMEM model structures, providing a useful foundation for pharmacometrics model coding. However, user review and refinement remain essential, especially for complex models with special dataset alignment or advanced coding techniques. We also discussed the applications of AI in pharmacometrics education, particularly strategies to prevent overreliance on AI for coding. This work provides a benchmark for current LLMs' performance in NONMEM coding and introduces a practical prompt that can facilitate more accurate and efficient use of AI in pharmacometrics research and education.

CPT Pharmacometrics & Systems PharmacologyVol. 14(12)
University of North Carolina at Chapel Hill (US), Monash University (AU)
University College London, Monash University, University of North Carolina at Chapel Hill
Openalex Percentile: Top 12%
Computational Drug Discovery Methods
1.50
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.