Machine Learning Science and Technology· 2026Q2
Re4: Scientific computing agent with rewriting, resolution, review and revision
- 4citations
- Q2SCImago
- 2026year
Short summary
A novel agent framework, Re4, uses a 'rewriting-resolution-review-revision' chain with three LLMs to significantly improve bug-free code generation and reduce non-physical solutions in scientific computing.
AI-generated from the title and abstract; the full text is not read.
Key points
- The Re4 agent framework integrates three LLMs (Consultant, Programmer, Reviewer) in a collaborative 'rewriting-resolution-review-revision' chain.
- The Reviewer module enables self-debugging and iterative refinement of generated code based on runtime feedback.
- Re4 significantly improves bug-free code generation rates and reduces non-physical solutions compared to single-model approaches.
- The review mechanism boosted execution success rates for tested LLMs: DeepSeek R1 from 59% to 82%, ChatGPT 4.1-mini from 66% to 87%, and Gemini-2.5 from 60% to 84%.
AI-generated from the title and abstract; the full text is not read.
Abstract
Abstract Large language models (LLMs) are a promising class of generative artificial intelligence models 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 undergoes iterative revision. A comprehensive evaluation is conducted on the performance of the proposed agent framework in solving typical partial differential equations (PDEs), engineering-oriented flow past a cylinder, ill-conditioned linear systems, and data-driven physical analysis problems. Compared with a single-model approach, 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 (bug-free code and non-NaN solutions) rate of the modern reasoning model DeepSeek R1 from 59% to 82%, while ChatGPT 4.1-mini improved from 66% to 87% and Gemini-2.5 improved from 60% to 84%. Automatic code generation and review provide a promising workflow for scientific computing; analysis of solver-development trajectories further reveals recurring implementation difficulties in boundary treatment, array indexing, and the preservation of numerical constraints.
The authors' abstract, as published at the source. Machine Learning Science and Technology, 2026 · DOI ↗
Continue with a free account
Ask the paper: 5 free questions a day about this paper; save it, get its citation, new summaries every day for your field. Takeaways are Premium.
Continue free on the webSign in with Google or Apple; no card needed. You come back to this paper.
On your phone:
Field: Information Systems
Information SystemsComputer Science