Agentic Framework for Epidemiological Modeling

Rituparna Datta, Zihan Guan, Baltazar Espinoza, Yiqi Su, Priya Pitre, Srini Venkatramanan, Naren Ramakrishnan, Anil Vullikanti

Introduction

Epidemiological modeling is the backbone of public health planning and policy-making. However, traditional approaches are notoriously bespoke. When a new pathogen variant emerges or novel public health policies are proposed, expert modelers must manually redesign compartmental structures (such as Susceptible, Exposed, Infectious, and Recovered states), rewrite transition logic, and recalibrate simulators. This manual process is slow and scales poorly during fast-moving crises.

To address this, researchers have introduced EpiAgent, an agentic AI framework that automates the design, coding, calibration, and refinement of epidemiological simulators. By treating disease progression as an iterative program synthesis problem, EpiAgent ensures that AI-generated models are not merely fitting curves to historical data, but are mechanistically sound and scientifically valid.

The Pitfalls of Naive LLM Generation

While Large Language Models (LLMs) excel at writing code, they are prone to "hallucinating" physical and epidemiological realities. A naive LLM might generate a model that perfectly fits historical case counts but violates fundamental laws—such as mass imbalance (populations disappearing into thin air), negative population counts, or impossible disease transitions (like recovering without ever being infected). These structural flaws make naive models dangerous for counterfactual reasoning, which is the exact "what-if" scenario analysis that policymakers rely on.

The EpiAgent Framework

EpiAgent moves away from one-shot prompting in favor of a structured, multi-agent pipeline designed to mimic professional expert workflows:

  1. Knowledge-Augmented Synthesis: The system utilizes Retrieval-Augmented Generation (RAG) to pull domain-specific knowledge from epidemiology textbooks and literature. This grounds the model in established scientific theory rather than relying solely on the LLM's internal training weights.
  2. Flow Graph Intermediate Representation (IR): This is the framework's core innovation. Instead of translating text descriptions directly into Python code, EpiAgent first constructs a directed graph of disease states. This intermediate representation decouples the "what" (the model structure) from the "how" (the PyTorch implementation), making it significantly easier to verify logical consistency before code generation.
  3. Scaffolded Autonomy: EpiAgent provides a PyTorch-based skeleton code interface. The LLM is tasked with filling in specific differential equations, while the skeleton manages routine plumbing like data loading and optimization.
  4. Multi-Agent Verification & Validation (V&V): A suite of specialized agents—including a Verifier, Reasoner, and Feedback agent—evaluates the model at every step. If a generated model violates compartmental axioms (such as mass conservation), the feedback agent provides a structured error trace to the planner agent, prompting a topological revision in the next iteration.

Experimental Evaluation

The framework was rigorously evaluated across two primary case studies:

  • Scenario Modeling: Based on the COVID-19 Scenario Modeling Hub (SMH) Round 17, this study involved six complex scenarios with varying assumptions regarding vaccination uptake and immune escape for new variants.
  • Real-World Calibration: Utilizing publicly available COVID-19 surveillance data from four heterogeneous locations (New York City, Jakarta, Bogota, and Rhode Island), this study tested a Data-Driven Behavioral (DDB) SEIR model incorporating mobility and seasonality factors.

Key Findings

  • Correctness Over Curve-Fitting: EpiAgent recognizes that a model can achieve a low Mean Squared Error (MSE) while remaining scientifically invalid. It treats boundary violations as signals for structural revision rather than simple numerical clipping. The authors found that without the graph-level IR checks, 87% of generated models produced incorrect scenario projections.
  • Counterfactual Reliability: Models generated by EpiAgent correctly responded to simulated interventions. For instance, they accurately projected that universal boosters would reduce infections more effectively than targeted boosters, and that high immune-escape variants would yield higher infection peaks.
  • Rapid Convergence: By explicitly emulating the generate-fail-reason-refine loop of a professional epidemiologist, EpiAgent achieved 100% convergence toward valid models within five iterations. It significantly outperformed general-purpose agents like MLGym and HDTwinGen, which frequently defaulted to overly simplistic or structurally flawed models.

Limitations and Future Directions

While EpiAgent represents a significant leap forward, the authors note several areas for future improvement. The current system relies on a fixed optimization setup; future iterations should allow agents to adaptively modify learning rates and schedules. Additionally, the agentic loop can occasionally "regress" in later iterations due to compounding noise, highlighting the need for convergence-aware stopping criteria. Ultimately, the goal is to achieve a fully automated "PDF-to-Model" pipeline capable of ingesting a research paper and outputting a calibrated, spatially-structured metapopulation simulator.

Summary updated

BibTeX
@inproceedings{datta2026agentic,
  author = {Rituparna Datta and Zihan Guan and Baltazar Espinoza and Yiqi Su and Priya Pitre and Srini Venkatramanan and Naren Ramakrishnan and Anil Vullikanti},
  title = {{Agentic Framework for Epidemiological Modeling}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=ujYdUdqWpm},
}
Figure