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

DevFeed: [Re4: Scientific Computing Agent with Rewriting, Resolution, Review and Revision](<https://devfeed.tech/articles/re4-scientific-computing-agent-with-rewriting-resolution-review-and-revision-102916.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2508.20729>)

Author: Ao Cheng, Lei Zhang, Guowei He

Published: 2026-10-28T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>)

Topics: [Multi Agent Systems](<https://devfeed.tech/topics/multi-agent-systems.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [SciPy](<https://devfeed.tech/topics/scipy.md>), [Finite Element Method (FEM)](<https://devfeed.tech/topics/finite-element-method.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agent-framework](<https://devfeed.tech/tags/agent-framework.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [array](<https://devfeed.tech/tags/array.md>), [autonomous](<https://devfeed.tech/tags/autonomous.md>), [chatgpt](<https://devfeed.tech/tags/chatgpt.md>), [code](<https://devfeed.tech/tags/code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [computing](<https://devfeed.tech/tags/computing.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [data](<https://devfeed.tech/tags/data.md>), [data-driven](<https://devfeed.tech/tags/data-driven.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [deepseek-r1](<https://devfeed.tech/tags/deepseek-r1.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [execution](<https://devfeed.tech/tags/execution.md>), [feedback](<https://devfeed.tech/tags/feedback.md>), [flow](<https://devfeed.tech/tags/flow.md>), [physics-comp-ph](<https://devfeed.tech/tags/physics-comp-ph.md>), [review](<https://devfeed.tech/tags/review.md>), [revision](<https://devfeed.tech/tags/revision.md>), [scientific-computing](<https://devfeed.tech/tags/scientific-computing.md>)

## AI overview

Re4 coordinates three reasoning roles: a Consultant augments problem descriptions with domain knowledge, a Programmer writes and executes code, and a Reviewer uses runtime feedback to drive iterative revision. Evaluated on PDEs, flow past a cylinder, ill-conditioned linear systems, and data-driven physical analysis, the review mechanism raised execution success (bug-free code and non-NaN solutions) from 59% to 82% for DeepSeek R1, 66% to 87% for ChatGPT 4.1-mini, and 60% to 84% for Gemini-2.5. The abstract also identifies boundary treatment, array indexing, and preserving numerical constraints as recurring solver-development difficulties.

## Source excerpt

arXiv:2508.20729v3 Announce Type: replace Abstract: Large language models (LLMs) 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 incorporates a "rewriting-resolution-review-revision" logical chain via three reasoning LLMs (the Consultant, Reviewer, and Programmer) in a collaborative and interactive manner. The Consultant module enables knowledge transfer to link problems to professional domain insights, thereby rewriting problem descriptions through text augmentation. The Programmer module generates and executes well-structured code to solve problems. The Reviewer module enables self-debugging and self-refinement through interactive feedback with code runtime outputs. Through the end-to-end review mechanism, the Programmer's executable code undergoes iterative revision. We comprehensively evaluate the framework on 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 non-physical solutions, establishing a reliable framework for autonomous code generation from natural language descriptions. The review mechanism improved the average execution success (bug-free code and non-NaN solutions) rate of 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.