Molecular dynamics (MD) simulations are essential for understanding atomic-scale behaviors in materials science, yet writing LAMMPS scripts remains highly specialized and time-consuming tasks. Although LLMs show promise in code generation and domain-specific question answering, their performance in MD scenarios is limited by scarce domain data, the high deployment cost of state-of-the-art LLMs, and low code executability. Building upon our prior MDAgent, we present MDAgent2, the first end-to-end framework capable of performing both knowledge Q&A and code generation within the MD domain. We construct a domain-specific data-construction pipeline that yields three high-quality datasets spanning MD knowledge, question answering, and code generation. Based on these datasets, we adopt a three stage post-training strategy--continued pre-training (CPT), supervised fine-tuning (SFT), and reinforcement learning (RL)--to train two domain-adapted models, MD-Instruct and MD-Code. Furthermore, we introduce MD-GRPO, a closed-loop RL method that leverages simulation outcomes as reward signals and recycles low-reward trajectories for continual refinement. We further build MDAgent2-RUNTIME, a deployable multi-agent system that integrates code generation, execution, evaluation, and self-correction. Together with MD-EvalBench proposed in this work, the first benchmark for LAMMPS code generation and question answering, our models and system achieve performance surpassing several strong baselines.This work systematically demonstrates the adaptability and generalization capability of large language models in industrial simulation tasks, laying a methodological foundation for automatic code generation in AI for Science and industrial-scale simulations. URL: https://github.com/FredericVAN/PKU_MDAgent2


翻译:分子动力学模拟是理解材料科学中原子尺度行为的关键工具,然而编写LAMMPS脚本仍然是高度专业化且耗时的任务。尽管大语言模型在代码生成和领域特定问答方面展现出潜力,但它们在分子动力学场景中的性能受到领域数据稀缺、先进大语言模型部署成本高昂以及代码可执行性低的限制。基于我们先前开发的MDAgent,本文提出MDAgent2——首个能够在分子动力学领域同时执行知识问答与代码生成的端到端框架。我们构建了领域专用的数据构建流程,产生了涵盖分子动力学知识、问答和代码生成的三个高质量数据集。基于这些数据集,我们采用三阶段后训练策略——持续预训练、监督微调和强化学习——训练出两个领域适应模型:MD-Instruct与MD-Code。此外,我们提出MD-GRPO,这是一种利用模拟结果作为奖励信号、并回收低奖励轨迹进行持续优化的闭环强化学习方法。我们进一步构建了MDAgent2-RUNTIME,这是一个可部署的多智能体系统,集成了代码生成、执行、评估与自我修正功能。结合本文提出的首个LAMMPS代码生成与问答基准测试集MD-EvalBench,我们的模型与系统在多项指标上超越了多个强基线模型。本工作系统论证了大语言模型在工业仿真任务中的适应性与泛化能力,为AI for Science及工业级模拟的自动代码生成奠定了方法论基础。项目地址:https://github.com/FredericVAN/PKU_MDAgent2

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【AAAI2025】TimeDP:通过领域提示学习生成多领域时间序列
【KDD2024】HiGPT:异构图语言模型
专知会员服务
19+阅读 · 2024年7月9日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员