An Extensive Study of the Structure Features in Transformer-based Code Semantic Summarization

被引:0
|
作者
Yang, Kang [1 ]
Mao, Xinjun [1 ]
Wang, Shangwen [1 ]
Qin, Yihao [1 ]
Zhang, Tanghaoran [1 ]
Lu, Yao [1 ]
Al-Sabahi, Kamal [2 ]
机构
[1] Natl Univ Def Technol, Key Lab Software Engn Complex Syst, Changsha, Peoples R China
[2] Univ Technol & Appl Sci ibra, Ibra, Oman
基金
美国国家科学基金会;
关键词
Transformer; empirical study; probing task; code summarization;
D O I
10.1109/ICPC58990.2023.00024
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Transformers are now widely utilized in code intelligence tasks. To better fit highly structured source code, various structure information is passed into Transformer, such as positional encoding and abstract syntax tree (AST) based structures. However, it is still not clear how these structural features affect code intelligence tasks, such as code summarization. Addressing this problem is of vital importance for designing Transformer-based code models. Existing works are keen to introduce various structural information into Transformers while lacking persuasive analysis to reveal their contributions and interaction effects. In this paper, we conduct an empirical study of frequently-used code structure features for code representation, including two types of position encoding features and AST-based structure features. We propose a couple of probing tasks to detect how these structure features perform in Transformer and conduct comprehensive ablation studies to investigate how these structural features affect code semantic summarization tasks. To further validate the effectiveness of code structure features in code summarization tasks, we assess Transformer models equipped with these code structure features on a structural dependent summarization dataset. Our experimental results reveal several findings that may inspire future study: (1) there is a conflict between the influence of the absolute positional embeddings and relative positional embeddings in Transformer; (2) AST-based code structure features and relative position encoding features show a strong correlation and much contribution overlap for code semantic summarization tasks indeed exists between them; (3) Transformer models still have space for further improvement in explicitly understanding code structure information.
引用
收藏
页码:89 / 100
页数:12
相关论文
共 50 条
  • [41] Transformer-based Joint Source Channel Coding for Textual Semantic Communication
    Liu, Shicong
    Gao, Zhen
    Chen, Gaojie
    Su, Yu
    Peng, Lu
    arXiv, 2023,
  • [42] Transformer-based Language Models for Semantic Search and Mobile Applications Retrieval
    Coelho, Joao
    Neto, Antonio
    Tavares, Miguel
    Coutinho, Carlos
    Oliveira, Joao
    Ribeiro, Ricardo
    Batista, Fernando
    PROCEEDINGS OF THE 13TH INTERNATIONAL JOINT CONFERENCE ON KNOWLEDGE DISCOVERY, KNOWLEDGE ENGINEERING AND KNOWLEDGE MANAGEMENT (KDIR), VOL 1:, 2021, : 225 - 232
  • [43] Semantic Parameter Matching in Web APIs with Transformer-based Question Answering
    Kotstein, Sebastian
    Decker, Christian
    2023 IEEE INTERNATIONAL CONFERENCE ON SERVICE-ORIENTED SYSTEM ENGINEERING, SOSE, 2023, : 114 - 123
  • [44] tSF: Transformer-Based Semantic Filter for Few-Shot Learning
    Lai, Jinxiang
    Yang, Siqian
    Liu, Wenlong
    Zeng, Yi
    Huang, Zhongyi
    Wu, Wenlong
    Liu, Jun
    Gao, Bin-Bin
    Wang, Chengjie
    COMPUTER VISION, ECCV 2022, PT XX, 2022, 13680 : 1 - 19
  • [45] MUSTER: A Multi-Scale Transformer-Based Decoder for Semantic Segmentation
    Xu, Jing
    Shi, Wentao
    Gao, Pan
    Li, Qizhu
    Wang, Zhengwei
    IEEE TRANSACTIONS ON EMERGING TOPICS IN COMPUTATIONAL INTELLIGENCE, 2024,
  • [46] A Two-Stage Transformer-Based Approach for Variable-Length Abstractive Summarization
    Su, Ming-Hsiang
    Wu, Chung-Hsien
    Cheng, Hao-Tse
    IEEE-ACM TRANSACTIONS ON AUDIO SPEECH AND LANGUAGE PROCESSING, 2020, 28 : 2061 - 2072
  • [47] A novel transformer-based semantic segmentation framework for structural condition assessment
    Wang, Ruhua
    Shao, Yanda
    Li, Qilin
    Li, Ling
    Li, Jun
    Hao, Hong
    STRUCTURAL HEALTH MONITORING-AN INTERNATIONAL JOURNAL, 2024, 23 (02): : 1170 - 1183
  • [48] Cnnformer: Transformer-Based Semantic Information Enhancement Framework for Behavior Recognition
    Liu, Jindong
    Xiao, Zidong
    Bai, Yan
    Xie, Fei
    Wu, Wei
    Zhu, Wenjuan
    He, Hua
    IEEE ACCESS, 2023, 11 : 141299 - 141308
  • [50] ALSI-Transformer: Transformer-Based Code Comment Generation With Aligned Lexical and Syntactic Information
    Park, Youngmi
    Park, Ahjeong
    Kim, Chulyun
    IEEE ACCESS, 2023, 11 : 39037 - 39047