NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Data-Driven Discovery of Dynamical Systems in Pharmacology using Large Language Models

Samuel Holt, Zhaozhi Qian, Tennison Liu, Jim Weatherall, Mihaela van der Schaar

Abstract & TL;DR

Researchers have developed Data-Driven Discovery (D3), a framework that uses Large Language Models (LLMs) to autonomously discover and refine the mathematical equations governing complex systems like drug metabolism. By treating an LLM as an iterative "scientist" that writes code, evaluates performance, and even asks for new data, D3 found a new, more accurate model for the blood-thinner Warfarin that human experts found both biologically plausible and clinically superior.

The Challenge: Interpretable Pharmacokinetics

In pharmacology, understanding pharmacokinetics (PK)—how a drug is absorbed, distributed, and excreted—is a matter of life and death. Traditionally, human experts (pharmacometricians) spend years developing Ordinary Differential Equation (ODE) models to describe these processes.

The field currently faces a "Goldilocks" problem:

  1. Traditional models are interpretable but often too simple to capture real-world complexity.
  2. Black-box Machine Learning (like RNNs) can be very accurate but offer zero insight into why a prediction was made, making them untrustworthy for clinical use.
  3. Symbolic Regression (automated equation finding) exists but often fails when there are too many variables or noisy data.

D3 aims to bridge this gap by using the reasoning and coding capabilities of LLMs to discover "white-box" models that are both highly accurate and fully readable by humans.

The D3 Framework: An AI Scientist Loop

The D3 framework operates as a collaborative loop between specialized LLM agents (powered by GPT-4):

  • The Modeling Agent: Proposes candidate models by writing Python code (using PyTorch). It leverages its "internalized" textbook knowledge of biology and physics to suggest sensible starting points.
  • The Evaluation Agent: Takes the proposed code, trains it on patient data, and calculates the error (MSE). Crucially, it provides verbal feedback to the Modeling Agent (e.g., "The model overestimates decay; try adding a saturation term").
  • The Data Acquisition Agent: Uses a "Value of Information" approach to decide if acquiring a new feature (like a patient's genetic markers) would significantly improve the model, effectively deciding which "lab tests" are worth the cost.
The D3 iterative framework

The system iterates up to 20 times, refining the code until it finds the best-fitting, most parsimonious equation.

Datasets and Versatility

The authors tested D3 across several domains to prove its versatility:

  • Pharmacology: A real-world dataset of 33 patients on Warfarin therapy.
  • Oncology: Simulated lung cancer tumor growth (PKPD) under various treatment regimes (Chemo, Radiotherapy).
  • Epidemiology: Data from the COVASIM simulator, modeling COVID-19 transmission.
  • Ecology: A Plankton Microcosm dataset tracking prey-predator dynamics between algae and rotifers.

Key Insights

  • Code as the Universal Language of Science: Instead of asking the LLM for a math formula, D3 asks for a PyTorch nn.Module. This allows the LLM to use its strongest skill—programming—to represent complex dynamical systems.
  • The Power of "Verbal Reflection": The "Aha!" moment comes from the Evaluation Agent. By telling the Modeling Agent why a model failed in plain English, the system mimics the iterative process of a human researcher.
  • LLMs as Zero-Shot Feature Selectors: D3 can reason about features it hasn't seen yet. For example, it correctly identified that "radiotherapy dosage" was a high-value feature for a cancer model based solely on the text description of the problem, before ever seeing the numbers.
  • Hybrid Modeling: D3 doesn't just do pure equations. It can discover "Hybrid ODEs" where a core physical equation handles the known dynamics, while a small neural network captures the "messy" residuals.

Key Results: Outperforming the Experts

On the Warfarin dataset, the standard model used in medical literature has a test error (MSE) of 0.646. D3 discovered a new "white-box" equation with an MSE of 0.39 and a hybrid version at 0.271.

Warfarin Best Model Test MSE
  • Novel Discovery: The D3-discovered Warfarin model introduced a square root transformation for dosage and Michaelis-Menten saturation kinetics. When shown to expert pharmacologists, they noted the model was "significant," "promising," and "physiologically plausible."
  • Efficiency: D3 matched or beat the accuracy of massive black-box models (like Transformers and RNNs) while using only 5–15 parameters, compared to the 18,000+ parameters used by the neural networks.

Limitations and Future Work

The authors acknowledge several hurdles:

  • LLM Dependency: The system's success relies heavily on the underlying LLM (GPT-4). Hallucinations or poor coding could derail the process.
  • Data Uniformity: D3 currently assumes that if you acquire a new feature (like a blood test), you get it for every patient in the set, which isn't always possible in clinical trials.
  • Human-in-the-loop: While D3 is autonomous, it still requires a human to provide an initial "system description."

Future Work: The team suggests moving toward "Tree-of-Thought" strategies for more complex searches and using Retrieval-Augmented Generation (RAG) to allow the agents to "read" the latest medical journals while designing models.

Summary updated

BibTeX
@inproceedings{holt2024data,
  author = {Samuel Holt and Zhaozhi Qian and Tennison Liu and Jim Weatherall and Mihaela van der Schaar},
  title = {{Data-Driven Discovery of Dynamical Systems in Pharmacology using Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=KIrZmlTA92},
}
Figure