Knowledge-Augmented Large Language Model for Autonomous MODFLOW 6 Input File Generation

IF 2.6 4区 地球科学 Q3 GEOSCIENCES, MULTIDISCIPLINARY
Groundwater Pub Date : 2026-09-13 Epub Date: 2026-09-06 DOI:10.1111/gwat.70102
David Krčmář, Kamila Hodasová, Martin Zatlakovič, Natália Bahnová
{"title":"Knowledge-Augmented Large Language Model for Autonomous MODFLOW 6 Input File Generation","authors":"David Krčmář,&nbsp;Kamila Hodasová,&nbsp;Martin Zatlakovič,&nbsp;Natália Bahnová","doi":"10.1111/gwat.70102","DOIUrl":null,"url":null,"abstract":"<p>A large language model (LLM) coding agent can build complete MODFLOW 6 input file sets from natural-language descriptions when given the right reference material, without retraining the model. The reference material, which we call a plugin, comprises 42 plain-text package files (one per MODFLOW 6 package, written from the official Input/Output Guide, the Fortran source code, and the simulator's runtime error messages), plus seven workflow files and one configuration file. A suite of 59 pass-or-fail checks covered five tasks: steady-state flow, transient flow with pumping, coupled flow and solute transport, coupled flow and heat transport, and validation of an existing model. On the unmodified plugin, 52 of 59 checks passed (88%); the seven failures were all runtime errors, six of them caused by constraints spanning more than one input file. Two independent improvement strategies followed: an expert-guided batch correction and an automated one-failure-at-a-time loop. Both reached 59 of 59 (100%) and modified the same four skill files; the expert-guided strategy, which identified five root causes, made one additional edit to a workflow command file. This convergence indicates that the failures came from gaps in the reference files, not from random variation in the model's output. The automated loop required no human intervention. The methodology has been replicated on a sibling simulator (MODFLOW USG-Transport; Krčmář et al. 2026b) with 100% first-attempt success. The result is a reusable design pattern for adapting an LLM coding agent to a scientific simulator without retraining the model.</p>","PeriodicalId":12866,"journal":{"name":"Groundwater","volume":"64 5","pages":"565-575"},"PeriodicalIF":2.6000,"publicationDate":"2026-09-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Groundwater","FirstCategoryId":"89","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1111/gwat.70102","RegionNum":4,"RegionCategory":"地球科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/9/6 0:00:00","PubModel":"Epub","JCR":"Q3","JCRName":"GEOSCIENCES, MULTIDISCIPLINARY","Score":null,"Total":0}
引用次数: 0

Abstract

A large language model (LLM) coding agent can build complete MODFLOW 6 input file sets from natural-language descriptions when given the right reference material, without retraining the model. The reference material, which we call a plugin, comprises 42 plain-text package files (one per MODFLOW 6 package, written from the official Input/Output Guide, the Fortran source code, and the simulator's runtime error messages), plus seven workflow files and one configuration file. A suite of 59 pass-or-fail checks covered five tasks: steady-state flow, transient flow with pumping, coupled flow and solute transport, coupled flow and heat transport, and validation of an existing model. On the unmodified plugin, 52 of 59 checks passed (88%); the seven failures were all runtime errors, six of them caused by constraints spanning more than one input file. Two independent improvement strategies followed: an expert-guided batch correction and an automated one-failure-at-a-time loop. Both reached 59 of 59 (100%) and modified the same four skill files; the expert-guided strategy, which identified five root causes, made one additional edit to a workflow command file. This convergence indicates that the failures came from gaps in the reference files, not from random variation in the model's output. The automated loop required no human intervention. The methodology has been replicated on a sibling simulator (MODFLOW USG-Transport; Krčmář et al. 2026b) with 100% first-attempt success. The result is a reusable design pattern for adapting an LLM coding agent to a scientific simulator without retraining the model.

自主MODFLOW 6输入文件生成的知识增强大语言模型。
当给定正确的参考材料时,大型语言模型(LLM)编码代理可以根据自然语言描述构建完整的MODFLOW 6输入文件集,而无需重新训练模型。参考材料,我们称之为插件,包括42个纯文本包文件(每个MODFLOW 6包一个,根据官方输入/输出指南,Fortran源代码和模拟器的运行时错误消息编写),加上7个工作流文件和一个配置文件。一套59个通过或不通过的检查涵盖了五个任务:稳态流动、瞬态泵送流动、耦合流动和溶质输运、耦合流动和热输运,以及对现有模型的验证。在未修改的插件上,59次检查中有52次通过(88%);这七个失败都是运行时错误,其中六个是由跨越多个输入文件的约束引起的。随后采用了两种独立的改进策略:专家指导的批量纠正和一次一个故障的自动循环。两者都达到了59 / 59(100%),并且修改了相同的四个技能文件;专家指导的策略确定了五个根本原因,并对工作流命令文件进行了额外的编辑。这种收敛表明,失败来自于参考文件中的间隙,而不是模型输出中的随机变化。自动循环不需要人为干预。该方法已在同类模拟器(MODFLOW USG-Transport; Krčmář et al. 2026b)上复制,首次尝试成功率为100%。其结果是一个可重用的设计模式,用于使LLM编码代理适应科学模拟器,而无需重新训练模型。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Groundwater
Groundwater 环境科学-地球科学综合
CiteScore
4.80
自引率
3.80%
发文量
0
审稿时长
12-24 weeks
期刊介绍: Ground Water is the leading international journal focused exclusively on ground water. Since 1963, Ground Water has published a dynamic mix of papers on topics related to ground water including ground water flow and well hydraulics, hydrogeochemistry and contaminant hydrogeology, application of geophysics, groundwater management and policy, and history of ground water hydrology. This is the journal you can count on to bring you the practical applications in ground water hydrology.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书