arXiv:2508.20729cs.AIphysics.comp-ph2025-08综述被引 2

构建可自修正的科学计算智能体,提升代码生成可靠性。

Re4: Scientific Computing Agent with Rewriting, Resolution, Review and Revision

  • 三模块协作:重写-求解-评审-修订,实现闭环优化。
  • 在偏微分方程等任务中,错误率显著降低,物理解更准确。
  • 适合需要高可靠代码生成的研究者与自动化科学计算场景。

大型语言模型在数学与科学推理等领域展现强大能力。本文构建了一个用于解决典型科学计算问题的新颖智能体框架,采用‘重写-求解-评审-修订’逻辑链,由三个推理型LLM(顾问、评审员、程序员)协同工作。顾问模块通过文本增强将问题链接至专业领域知识,实现问题重述;程序员模块生成并执行结构化代码以求解问题;评审员模块基于代码运行反馈进行自我调试与优化。通过端到端评审机制,代码实现迭代修订。在偏微分方程、病态线性系统及数据驱动物理分析任务上评估表明,相比单模型,该框架显著提升无错代码生成率,减少非物理解出现,建立基于自然语言描述的高可靠性自主代码生成体系。评审机制提升了现代推理模型的平均执行成功率。代码开源:https://github.com/ChengAo21/Re4_Sci_Agent

原文摘要 · Abstract (English)

Large language models (LLMs) serve as an active and promising field of generative artificial intelligence and have demonstrated abilities to perform complex tasks in multiple domains, including mathematical and scientific reasoning. In this work, we construct a novel agent framework for solving representative problems in scientific computing. The proposed agent, incorporating a "rewriting-resolution-review-revision" logical chain via three reasoning LLMs (functioning as the Consultant, Reviewer, and Programmer, respectively), is integrated in a collaborative and interactive manner. The Consultant module endows the agent with knowledge transfer capabilities to link problems to professional domain insights, thereby rewriting problem descriptions through text augmentation. The Programmer module is responsible for generating and executing well-structured code to deliver the problem resolution. The Reviewer module equips the agent with the capacity for self-debugging and self-refinement through interactive feedback with code runtime outputs. By leveraging the end-to-end review mechanism, the executable code provided by the Programmer attains the iterative revision. A comprehensive evaluation is conducted on the performance of the proposed agent framework in solving partial differential equations (PDEs), ill-conditioned linear systems, and data-driven physical analysis problems. Compared to single-model, this collaborative framework significantly improves the bug-free code generation rate and reduces the occurrence of non-physical solutions, thereby establishing a highly reliable framework for autonomous code generation based on natural language descriptions. The review mechanism improved the average execution success rate of the modern reasoning models. Our code is available at https://github.com/ChengAo21/Re4_Sci_Agent

科学计算智能体代码生成自修正

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。