分析基于树的神经网络在回归任务中的行为
Analysing the Behaviour of Tree-Based Neural Networks in Regression Tasks
AI总结:
针对源代码执行时间预测回归任务,论文比较基于树的CNN、Code2Vec、Transformer和GNN,并提出融合代码token与AST交叉注意力的双Transformer,性能优于现有方法。
摘要:
深度学习的格局极大地拓展了源代码分析的边界,尤其是通过利用抽象语法树(AST)等结构化表示。尽管这些方法已在分类任务中证明有效,但它们在回归应用中的效果,例如根据源代码预测执行时间,仍未得到充分研究。本文致力于解读基于树的神经网络模型在此类回归挑战中的行为。我们将既有模型——基于树的卷积神经网络(CNN)、Code2Vec以及基于Transformer的方法——的应用扩展到通过把源代码解析为AST来预测其执行时间。比较分析表明,尽管这些模型是代码表示领域的基准,但在承担回归任务时表现出局限性。为解决这些不足,我们提出一种新颖的双Transformer方法,同时作用于源代码token和AST表示,并采用交叉注意力机制增强两个领域之间的可解释性。此外,我们探索了图神经网络(GNN)对这一基于树的问题的适配,并基于AST的图性质论证了其内在兼容性。在真实数据集上的实证评估显示,我们的双Transformer模型优于所有其他基于树的神经网络以及基于GNN的模型。此外,所提出的双Transformer在多样化数据集上展现出显著的适应性和稳健性能。
英文摘要:
The landscape of deep learning has vastly expanded the frontiers of source code analysis, particularly through the utilization of structural representations such as Abstract Syntax Trees (ASTs). While these methodologies have demonstrated effectiveness in classification tasks, their efficacy in regression applications, such as execution time prediction from source code, remains underexplored. This paper endeavours to decode the behaviour of tree-based neural network models in the context of such regression challenges. We extend the application of established models--tree-based Convolutional Neural Networks (CNNs), Code2Vec, and Transformer-based methods--to predict the execution time of source code by parsing it to an AST. Our comparative analysis reveals that while these models are benchmarks in code representation, they exhibit limitations when tasked with regression. To address these deficiencies, we propose a novel dual-transformer approach that operates on both source code tokens and AST representations, employing cross-attention mechanisms to enhance interpretability between the two domains. Furthermore, we explore the adaptation of Graph Neural Networks (GNNs) to this tree-based problem, theorizing the inherent compatibility due to the graphical nature of ASTs. Empirical evaluations on real-world datasets showcase that our dual-transformer model outperforms all other tree-based neural networks and the GNN-based models. Moreover, our proposed dual transformer demonstrates remarkable adaptability and robust performance across diverse datasets.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。