Precise Learning of Source Code Contextual Semantics via Hierarchical Dependence Structure and Graph Attention Networks

被引:11
|
作者
Zhao, Zhehao [1 ]
Yang, Bo [2 ]
Li, Ge [1 ]
Liu, Huai [3 ]
Jin, Zhi [1 ]
机构
[1] Peking Univ, Key Lab High Confidence Software Technol, Beijing 100871, Peoples R China
[2] Beijing Forestry Univ, Sch Informat Sci & Technol, Beijing 100083, Peoples R China
[3] Swinburne Univ Technol, Dept Comp Technol, Hawthorn, Vic 3122, Australia
基金
澳大利亚研究理事会; 中国国家自然科学基金; 国家重点研发计划;
关键词
Graph neural network; Program analysis; Deep learning; Abstract syntax Tree; Control flow graph; NEURAL-NETWORK;
D O I
10.1016/j.jss.2021.111108
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Deep learning is being used extensively in a variety of software engineering tasks, e.g., program classification and defect prediction. Although the technique eliminates the required process of feature engineering, the construction of source code model significantly affects the performance on those tasks. Most recent works was mainly focused on complementing AST-based source code models by introducing contextual dependencies extracted from CFG. However, all of them pay little attention to the representation of basic blocks, which are the basis of contextual dependencies. In this paper, we integrated AST and CFG and proposed a novel source code model embedded with hierarchical dependencies. Based on that, we also designed a neural network that depends on the graph attention mechanism. Specifically, we introduced the syntactic structural of the basic block, i.e., its corresponding AST, in source code model to provide sufficient information and fill the gap. We have evaluated this model on three practical software engineering tasks and compared it with other state-of-the-art methods. The results show that our model can significantly improve the performance. For example, compared to the best performing baseline, our model reduces the scale of parameters by 50% and achieves 4% improvement on accuracy on program classification task. (c) 2021 Elsevier Inc. All rights reserved.
引用
收藏
页数:13
相关论文
共 47 条
  • [31] Long-tailed graph neural networks via graph structure learning for node classification
    Junchao Lin
    Yuan Wan
    Jingwen Xu
    Xingchen Qi
    Applied Intelligence, 2023, 53 : 20206 - 20222
  • [32] Long-tailed graph neural networks via graph structure learning for node classification
    Lin, Junchao
    Wan, Yuan
    Xu, Jingwen
    Qi, Xingchen
    APPLIED INTELLIGENCE, 2023, 53 (17) : 20206 - 20222
  • [33] Adversarial Attacks on Graph Neural Networks via Node Injections: A Hierarchical Reinforcement Learning Approach
    Sun, Yiwei
    Wang, Suhang
    Tang, Xianfeng
    Hsieh, Tsung-Yu
    Honavar, Vasant
    WEB CONFERENCE 2020: PROCEEDINGS OF THE WORLD WIDE WEB CONFERENCE (WWW 2020), 2020, : 673 - 683
  • [34] Dynamic Job-Shop Scheduling via Graph Attention Networks and Deep Reinforcement Learning
    Liu, Chien-Liang
    Tseng, Chun-Jan
    Weng, Po-Hao
    IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, 2024, 20 (06) : 8662 - 8672
  • [35] Unsupervised fuzzy temporal knowledge graph entity alignment via joint fuzzy semantics learning and global structure learning
    Song, Jingni
    Bai, Luyi
    An, Xuanxuan
    Zhou, Longlong
    NEUROCOMPUTING, 2025, 617
  • [36] Sparse Structure Learning via Graph Neural Networks for Inductive Document Classification
    Piao, Yinhua
    Lee, Sangseon
    Lee, Dohoon
    Kim, Sun
    THIRTY-SIXTH AAAI CONFERENCE ON ARTIFICIAL INTELLIGENCE / THIRTY-FOURTH CONFERENCE ON INNOVATIVE APPLICATIONS OF ARTIFICIAL INTELLIGENCE / TWELVETH SYMPOSIUM ON EDUCATIONAL ADVANCES IN ARTIFICIAL INTELLIGENCE, 2022, : 11165 - 11173
  • [37] Self-admitted technical debt detection by learning its comprehensive semantics via graph neural networks
    Li, Hui
    Qu, Yang
    Liu, Yong
    Chen, Rong
    Ai, Jun
    Guo, Shikai
    SOFTWARE-PRACTICE & EXPERIENCE, 2022, 52 (10): : 2152 - 2176
  • [38] Tree Structure-Aware Graph Representation Learning via Integrated Hierarchical Aggregation and Relational Metric Learning
    Qiao, Ziyue
    Wang, Pengyang
    Fu, Yanjie
    Du, Yi
    Wang, Pengfei
    Zhou, Yuanchun
    20TH IEEE INTERNATIONAL CONFERENCE ON DATA MINING (ICDM 2020), 2020, : 432 - 441
  • [39] Don Tucker finalist: predicting the combinatorial code of olfaction via graph neural networks and representation learning
    Hladis, Matej
    Fiorucci, Sebastien
    Topin, Jeremie
    CHEMICAL SENSES, 2022, 47
  • [40] Graph Neural Networks for multivariate time-series forecasting via learning hierarchical spatiotemporal dependencies
    Zhou, Zhou
    Basker, Ronisha
    Yeung, Dit-Yan
    ENGINEERING APPLICATIONS OF ARTIFICIAL INTELLIGENCE, 2025, 147