节点文献
基于Transformer的微积分符号计算求解
Symbolic Computation for Calculus Solving Based on Transformer
【作者】 卢林;
【导师】 朱兆旻;
【作者基本信息】 广西大学 , 计算机技术(专业学位), 2024, 硕士
【摘要】 符号计算也称计算代数,是数学计算中的一个分支,其通过逻辑推导得到精确解,可实现求解代数与微积分等操作,适用于科学研究中的理论物理、数学等领域。随着现实中复杂问题增多,计算处理对象愈加复杂,人工进行符号计算成本高且难度大,因此人们开发了Maple等计算代数系统,其求解快速、准确且能避免人工计算错误。尽管计算代数系统能解决大部分符号计算问题,但在求解复杂数学问题时仍存在求解不稳定且计算慢的问题。近年来,随着深度学习的快速发展,人工智能在自然语言处理领域取得了巨大成功并表现出强大的复杂问题处理能力,将该领域的神经机器翻译技术应用于符号计算问题,不仅能克服计算代数系统求解复杂符号计算问题的局限,也能扩展人工智能在符号计算方面的应用范围。因此本文将神经机器翻译应用于符号计算任务,主要工作如下:(1)针对神经机器翻译在特定领域因信息利用不足导致的翻译过度或遗漏等问题,同时考虑到积分计算本质上属于符号计算的特定领域,本文提出了一种融合先验知识Transformer的积分求解算法。首先提出一种数字分词方法以增强网络对数字的感知,然后引入卷积嵌入获取局部数学知识,最后通过高斯先验注意力调整模型在临近字符区域的注意力分布,从而强化对临近字符的特征提取能力。实验结果表明,所提方法在函数积分数据集ibp、bwd和fwd上比常规Transformer模型依次提升了5.04、2.64和2.11个百分点,并领先于多个神经机器翻译模型,同时求解效果优于Maple等计算代数系统。(2)针对目前深度学习对微分方程的研究主要集中在数值解而缺少对解析解的研究,同时为了扩展神经网络在符号计算的应用,本文提出了一种构建偏微分方程数据集的方法并引入对齐用以求解微分方程。微分方程的求解过程是复杂且困难的,因此通过方程解映射到方程反向生成数据集:将常微分方程转变与特征线法结合,生成常系数一阶线性、变系数一阶线性以及满足一定条件的二阶抛物线偏微分方程。另外,将词对齐引入到Transformer中进行翻译和对齐的多任务学习,提升模型求解效果。实验结果表明,模型求解一阶线性常系数、一阶线性变系数以及满足一定条件的二阶抛物线偏微分方程较常规Transformer模型依次提升了2.09、0.58和0.96个百分点,性能优于Sym Py和Mathematica。(3)设计并实现符号计算求解系统。基于以上模型,应用前后端分离技术实现符号计算求解系统。此系统主要包括注册、登录、符号计算等功能。用户输入待求解的数学式子即可得到计算结果。
【Abstract】 Symbolic computation also known as computational algebra,is a branch of mathematical computation,which can obtain exact solutions through logical derivation and can realize operations such as solving algebra and calculus.It is suitable for theoretical physics,mathematics and other fields in scientific research.With the increase of complex problems in reality,the computation and processing objects become more and more complex,and manual symbolic computation is costly and difficult.For this reason,people have developed computational algebra systems such as Maple,which can solve quickly,accurately and avoid manual computation errors.Although computational algebraic systems can solve most symbolic computation problems,there are still problems such as unstable and slow computation when solving complex mathematical problems.In recent years,with the rapid development of deep learning,artificial intelligence has achieved great success in the field of natural language processing and has demonstrated a strong ability to deal with complex problems.Applying neural machine translation technology in this field to symbolic computation problems can not only overcome the limitations of computational algebraic systems in solving complex symbolic computation problems,but also expand the application range of artificial intelligence in symbolic computation.Therefore,this paper applies neural machine translation to symbolic computing tasks,and the main work is as follows:(1)Aiming at the problems of over-translation or omission in neural machine translation due to insufficient use of information in specific domains,and considering that integral computation is essentially a specific field of symbolic computation,this paper proposes an integral solving algorithm integrating prior knowledge Transformer.Firstly,a digital word segmentation method is proposed to enhance the network’s perception of numbers,then a convolutional embedding is introduced to obtain local mathematical knowledge,and finally gaussian prior attention is used to adjust the attention distribution of the model in the adjacent character region,thereby strengthening the feature extraction ability of the adjacent character.The experimental results show that the proposed method is 5.04,2.64 and 2.11 percentage points better than the conventional Transformer model on the functional integration data sets ibp,bwd and fwd respectively,and it is ahead of many neural machine translation models.At the same time,its solution effect is better than computational algebra systems such as Maple.(2)Aiming at the current deep learning research on differential equations mainly focuses on numerical solutions and lacks research on analytical solutions,and in order to expand the application of neural networks in symbolic computing,this paper proposes a method of constructing partial differential equation datasets and introduces alignment to solve differential equations.The process of solving differential equations is complex and difficult,so the data set is generated by mapping the equation solution to the equation reverse: combining the ordinary differential equation transformation with the method of characteristic lines to generate constant coefficient first-order linear,variable coefficient first-order linear,and second-order parabolic partial differential equations that satisfy certain conditions.In addition,word alignment is introduced into Transformer for multi-task learning of translation and alignment to improve model solving effect.The experimental results show that the model’s performance in solving first-order linear constant coefficient,first-order linear variable coefficient and second-order parabolic partial differential equations satisfying certain conditions is improved by 2.09,0.58,0.96 percentage points respectively compared with the conventional Transformer model,which is better than Sym Py and Mathematica.(3)Design and implement the symbolic computation solution system.Based on the above model,the symbolic computing solution system is realized by using the front and back-end separation technology.This system mainly includes registration,login,symbol calculation and other functions.Users can get the calculation results by inputting the mathematical equation to be solved.
【Key words】 Symbolic Computation; Neural Machine Translation; Transformer; Function Integration; Differential Equation; Method of Characteristic Line;
- 【网络出版投稿人】 广西大学 【网络出版年期】2025年 04期
- 【分类号】TP391.2