arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2303.12093cs.LGcs.NAcs.SEmath.NA
收藏

ChatGPT用于数值方法编程

ChatGPT for Programming Numerical Methods

Stanford University(斯坦福大学)

Ali Kashefi, Tapan Mukerji

AI总结:

本文首次系统评估ChatGPT在多语言数值算法代码生成、调试、补全、迁移、并行化及代码来源识别中的表现,指出其可用性与典型失败和改进方向。

摘要:

ChatGPT是OpenAI公司最近发布的一款大型语言模型。在本技术报告中,我们首次探索了ChatGPT在数值算法编程方面的能力。具体而言,我们考察了ChatGPT在以下方面的能力:使用不同编程语言生成数值算法代码,调试和改进用户编写的代码,补全数值代码中缺失的部分,将现有代码改写为其他编程语言,以及将串行代码并行化。此外,我们还评估了ChatGPT能否识别给定代码是由人类还是机器编写的。为实现这一目标,我们考虑了多种数学问题,例如Poisson方程、扩散方程、不可压缩Navier-Stokes方程、可压缩无粘流、特征值问题、线性方程组求解、稀疏矩阵存储等。此外,我们还举例说明了科学机器学习,例如物理信息神经网络和卷积神经网络在计算物理中的应用。通过这些示例,我们调查了ChatGPT的成功、失败和挑战。失败的例子包括生成奇异矩阵、对大小不兼容的数组执行操作、较长代码出现编程中断等。我们的结果表明,ChatGPT能够成功地使用不同编程语言编写数值算法,但仍存在一定的局限性和挑战,需要对该机器学习模型作进一步改进。

英文摘要:

ChatGPT is a large language model recently released by the OpenAI company. In this technical report, we explore for the first time the capability of ChatGPT for programming numerical algorithms. Specifically, we examine the capability of GhatGPT for generating codes for numerical algorithms in different programming languages, for debugging and improving written codes by users, for completing missed parts of numerical codes, rewriting available codes in other programming languages, and for parallelizing serial codes. Additionally, we assess if ChatGPT can recognize if given codes are written by humans or machines. To reach this goal, we consider a variety of mathematical problems such as the Poisson equation, the diffusion equation, the incompressible Navier-Stokes equations, compressible inviscid flow, eigenvalue problems, solving linear systems of equations, storing sparse matrices, etc. Furthermore, we exemplify scientific machine learning such as physics-informed neural networks and convolutional neural networks with applications to computational physics. Through these examples, we investigate the successes, failures, and challenges of ChatGPT. Examples of failures are producing singular matrices, operations on arrays with incompatible sizes, programming interruption for relatively long codes, etc. Our outcomes suggest that ChatGPT can successfully program numerical algorithms in different programming languages, but certain limitations and challenges exist that require further improvement of this machine learning model.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑