[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-126974-en":3,"doc-seo-126974-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},126974,687207024478,"Liam","https://ap-avatar.wpscdn.com/davatar_a8503ba1806abce46bf441b54a3ca4cd",8,"Research & Report","Symbolic Integration Algorithm Selection with Machine Learning - LSTMs vs Tree LSTMs - research paper","Computer Algebra Systems such as Maple support symbolic integration, but selecting the best sub-algorithm is difficult because different choices change both runtime and the form of the returned integral. This work hypothesizes that machine learning can guide sub-algorithm selection, provided the mathematical expression is represented effectively. Two neural models, LSTM and TreeLSTM, are trained for multi-label subalgorithm prediction and evaluated against Maple’s meta-algorithm for indeﬁnite integration. Results show TreeLSTM substantially outperforms LSTM and beats Maple’s current state-of-the-art, enabling stronger follow-up research.","arXiv :2404 . 14973v1 [ cs .LG] 23 Apr 2024  \nSymbolic Integration Algorithm Selection with Machine Learning: LSTMs vs Tree LSTMs  \nRashid Barket1[0000−0002−9104−4281], Matthew England 1[0000−0001−5729−3420],  \nand Jürgen Gerhard2  \n1 Coventry University, Coventry, United Kingdom  \n{barketr, [matthew.england}@coventry.ac.uk](matthew.england}@coventry.ac.uk)  \n2 Maplesoft, Waterloo, Ontario, Canada  \n[jgerhard@maplesoft.com](jgerhard@maplesoft.com)  \nAbstract. Computer Algebra Systems (e.g. Maple) are used in research, education, and industrial settings. One of their key functionalities is symbolic integration, where there are many sub-algorithms to choose from that can a􀀛ect the form of the output integral, and the runtime. Choosing the right sub-algorithm for a given problem is challenging: we hypothesise that Machine Learning can guide this sub-algorithm choice.  \nA key consideration of our methodology is how to represent the mathematics to the ML model: we hypothesise that a representation which encodes the tree structure of mathematical expressions would be well suited. We trained both an LSTM and a TreeLSTM model for subalgorithm prediction and compared them to Maple’s existing approach.  \nOur TreeLSTM performs much better than the LSTM, highlighting the bene􀀜t of using an informed representation of mathematical expressions.  \nIt is able to produce better outputs than Maple’s current state-of-the-art meta-algorithm, giving a strong basis for further research.  \nKeywords: Computer Algebra · Symbolic Integration · Machine Learning · LSTM · TreeLSTM · Data Generation.  \n1 Introduction  \nMachine Learning (ML), and speci􀀜cally deep learning, has seen a surge of applications in many domains, but only recently have there been applications to computer algebra. One can take two possible approaches when using ML in this 􀀜eld: to directly make predictions to solve a problem, or to aid existing algorithms in their free choices to improve an objective function.  \nWe focus on the Computer Algebra System (CAS) Maple, and its main symbolic integration algorithm, int, which is essentially a meta-algorithm to choose from 12 possible sub-algorithms Maple has for inde􀀜nite integration3 . The names of each sub-algorithm are also available later in Figure 3 . Each can produce very di􀀛erent, but mathematically equivalent answers, as in the example in Figure 1 . Some can also take much longer to execute than others.  \n3 [https://www.maplesoft.com/support/help/Maple/view.aspx?path=int](https://www.maplesoft.com/support/help/Maple/view.aspx?path=int)  \n2 Barket et al.  \nFig. 1. The output of R x sin(x) from three successful sub-algorithm. The optimal output is the shortest expression from the second sub-algorithm.  \nIn this paper, we will train LSTM and TreeLSTM models to select the subalgorithm that produces the optimal length answer for given problems. This is important to a Maple user who would prefer a simpler expression if available. Because the objective function is based on the output length, multiple subalgorithms may be optimal. Thus, this is a multi-label classi􀀜cation problem.  \nWe proceed with a brief literature review in Section 2, before outlining our machine learning methodology and data generation processes in Sections 3 and 4. We give our experimental results in Section 5 and then conclude in Section 6 .  \n2 Literature Review  \nThe problem of using ML to improve computer algebra algorithms has gained traction within the last decade. One of the 􀀜rst uses was for cylindrical algebraic decomposition algorithm where the choice of variable ordering can be key to tractability. Huang et al. made the 􀀜rst attempt in 2014 using a Support Vector Machine [3], with more recent work on this problem involving reinforcement learning and graph neural networks [4] and Explainable AI techniques [6] .  \nThe most relevant work for our problem was by Lample & Charton [5] who trained a transformer to calculate integrals directly, learning from a large ","cbCaifbxwnyT5xb5","https://ap.wps.com/l/cbCaifbxwnyT5xb5","pdf",359115,1,9,"English","en",105,"# Introduction\n# Literature Review\n# Machine Learning\n## LSTM\n## TreeLSTM\n# Experimental Results\n# Conclusion","[{\"question\":\"What problem does the paper address in symbolic integration systems like Maple?\",\"answer\":\"It addresses how to choose the best sub-algorithm for Maple’s indeﬁnite symbolic integration so that the output integral has desirable properties while minimizing execution cost.\"},{\"question\":\"Why do the authors believe machine learning can help algorithm selection?\",\"answer\":\"They hypothesize that a learned model can predict which sub-algorithm will produce an optimal result, using an informed representation of mathematical expressions.\"},{\"question\":\"How do LSTM and TreeLSTM models compare to Maple’s meta-algorithm?\",\"answer\":\"The TreeLSTM performs much better than the LSTM and produces better outputs than Maple’s current state-of-the-art meta-algorithm, based on the paper’s output-length objective.\"}]","Symbolic Integration Algorithm Selection with Machine Learning - LSTMs vs Tree LSTMs - research paper | PDF",1785935982,23,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"symbolic-integration-algorithm-selection-with-machine-learning-lstms-vs-tree-lstms-research-paper","",{"@graph":36,"@context":85},[37,54,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/symbolic-integration-algorithm-selection-with-machine-learning-lstms-vs-tree-lstms-research-paper/126974/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":62,"encodingFormat":61,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-05",true,{"@type":65,"interactionType":66,"userInteractionCount":4},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What problem does the paper address in symbolic integration systems like Maple?","Question",{"text":75,"@type":76},"It addresses how to choose the best sub-algorithm for Maple’s indeﬁnite symbolic integration so that the output integral has desirable properties while minimizing execution cost.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"Why do the authors believe machine learning can help algorithm selection?",{"text":80,"@type":76},"They hypothesize that a learned model can predict which sub-algorithm will produce an optimal result, using an informed representation of mathematical expressions.",{"name":82,"@type":73,"acceptedAnswer":83},"How do LSTM and TreeLSTM models compare to Maple’s meta-algorithm?",{"text":84,"@type":76},"The TreeLSTM performs much better than the LSTM and produces better outputs than Maple’s current state-of-the-art meta-algorithm, based on the paper’s output-length objective.","https://schema.org",{"og:url":52,"og:type":87,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":89,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,127,130,134],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":21,"doc_module":4,"doc_module_name":46,"category_name":124,"show_sort_weight":125,"slug":126},"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":106,"slug":137},19,"General","general"]