Opening the Black Box: How Agentic AI-Assisted Modeling Lets Pharmacometricians See Inside NONMEM.
Yiming Cheng, Yan Li
Clinical Pharmacology, Bristol Myers Squibb, 5 Giralda Farms, Madison, NJ, 07940, USA. · Clinical Pharmacology, Bristol Myers Squibb, 5 Giralda Farms, Madison, NJ, 07940, USA. Yan.Li@bms.com.
Key points
From the paper's conclusion- We illustrate this capability with two examples: capturing how subject-level samples evolve from one iteration to the next during NONMEM's expectation-maximization (EM) methods, including importance sampling (IMP) and stochastic approximation expectation maximization (SAEM), and tracking the BFGS Hessian approximation and objective-function gradients across snapshots of first-order conditional est
Abstract
NONMEM is the gold-standard tool in pharmacometrics, yet much of its estimation engine operates out of sight. Routine outputs show what the engine reports, but not everything it computes along the way. The quantities needed to answer a specific question may exist transiently within the long-established Fortran-based engine, but for most modelers they remain hidden behind an implementation barrier. AI-assisted modeling changes that barrier. A user can pose a question in "vibe" language, work with an AI assistant to generate verbatim Fortran code that instruments the running engine and exposes otherwise unavailable quantities on demand for use as additional model diagnostics or in other ad hoc investigations. We illustrate this capability with two examples: capturing how subject-level samples evolve from one iteration to the next during NONMEM's expectation-maximization (EM) methods, including importance sampling (IMP) and stochastic approximation expectation maximization (SAEM), and tracking the BFGS Hessian approximation and objective-function gradients across snapshots of first-order conditional estimation (FOCE). The examples themselves are not the central contribution. Rather, they demonstrate how AI can turn NONMEM from a closed black box into an engine that motivated users can interrogate when new questions arise. When paired with scientific judgment and numerical verification, AI can make forms of engine-level inspection once largely limited to developers and specialized experts accessible to everyday modelers, substantially shortening the distance between a NONMEM user and a NONMEM expert.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- AI for NONMEM Coding in Pharmacometrics Research and Education: Shortcut or Pitfall?CPT Pharmacometrics & Systems Pharmacology · 2025
- Redefining Parameter Estimation and Covariate Selection via Variational Autoencoders: One Run Is All You NeedCPT Pharmacometrics & Systems Pharmacology · 2025
- Exact FOCE-I optimization on stiff manifolds via differentiable programming in JAX.Journal of pharmacokinetics and pharmacodynamics · 2026
- From the ELBO to Maximum Likelihood: Convergence of Variational Autoencoders for Nonlinear Mixed-Effects ModelingarXiv · 2026
- A non-destructive methodological framework for modernizing legacy clinical reporting systems for AI-driven pharmacoinformatics: a SAS case study.Frontiers in pharmacology · 2026
- Integrating generative AI into cognitive apprenticeship–based problem-based learning in biochemistry: a quasi-experimental studyBMC Medical Education · 2026