Ciência_Iscte
Publications
Publication Detailed Description
Can large language models implement agent-based models? An ODD-based replication study
Journal Title
Ecological Modelling
Year (definitive publication)
2026
Language
English
Country
Netherlands
More Information
Web of Science®
Scopus
Google Scholar
This publication is not indexed in Google Scholar
This publication is not indexed in Overton
Abstract
Large language models (LLMs) can now synthesize non-trivial executable code from textual descriptions, raising an important question: can LLMs reliably implement agent-based models from standardized specifications in a way that supports replication, verification, and validation? We address this question by evaluating 17 contemporary LLMs on a controlled ODD-to-code translation task, using the PPHPC predator–prey model as a fully specified reference. Generated Python implementations are assessed through staged executability checks, model-independent statistical comparison against a validated NetLogo baseline, and quantitative measures of runtime efficiency and maintainability. Results show that behaviorally faithful implementations are achievable but not guaranteed, and that executability alone is insufficient for scientific use. GPT-4.1 consistently produces statistically valid and efficient implementations, with Claude 3.7 Sonnet performing well but less reliably. Overall, the findings clarify both the promise and current limitations of LLMs as model engineering tools, with implications for reproducible agent-based and ecological modeling.
Acknowledgements
--
Keywords
Natural language model specification,Specification-to-code translation,Code generation,Computational reproducibility,Verification and validation
Fields of Science and Technology Classification
- Earth and related Environmental Sciences - Natural Sciences
- Biological Sciences - Natural Sciences
Funding Records
| Funding Reference | Funding Entity |
|---|---|
| UID/PRR/00408/2025 | Fundação para a Ciência e a Tecnologia |
| UID/PRR/50008/2025 | Fundação para a Ciência e a Tecnologia |
| UID/06486/2025 | Fundação para a Ciência e a Tecnologia |
| PID2023-147409NB-C21 | Ministerio de Ciencia, Innovación y Universidades |
| UID/00408/2025 | Fundação para a Ciência e a Tecnologia |
| UID/50008/2025 | Fundação para a Ciência e a Tecnologia |
| COFAC/ILIND/COPELABS/1/2024 | Instituto Lusófono de Investigação e Desenvolvimento |
| 2023.15441.TENURE.051/CP00003/CT00029 | Fundação para a Ciência e a Tecnologia |
| UID/PRR2/06486/2025 | Fundação para a Ciência e a Tecnologia |
| CEECINST/00002/2021/CP2788/CT0001 | Fundação para a Ciência e a Tecnologia |
| UID/PRR2/50008/2025 | Fundação para a Ciência e a Tecnologia |
| UID/PRR/06486/2025 | Fundação para a Ciência e a Tecnologia |
Português