Multi-task Learning based Pre-trained Language Model for Code Completion

被引:92
|
作者
Liu, Fang [1 ]
Li, Ge [1 ]
Zhao, Yunfei [1 ]
Jin, Zhi [1 ]
机构
[1] MoE Peking Univ, Key Lab High Confidence Software Technol, Beijing, Peoples R China
基金
中国国家自然科学基金;
关键词
code completion; multi-task learning; pre-trained language model; transformer networks;
D O I
10.1145/3324884.3416591
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Code completion is one of the most useful features in the Integrated Development Environments (IDEs), which can accelerate software development by suggesting the next probable token based on the contextual code in real-time. Recent studies have shown that statistical language modeling techniques can improve the performance of code completion tools through learning from large-scale software repositories. However, these models suffer from two major drawbacks: a) Existing research uses static embeddings, which map a word to the same vector regardless of its context. The differences in the meaning of a token in varying contexts are lost when each token is associated with a single representation; b) Existing language model based code completion models perform poor on completing identifiers, and the type information of the identifiers is ignored in most of these models. To address these challenges, in this paper, we develop a multi-task learning based pre-trained language model for code understanding and code generation with a Transformer-based neural architecture. We pre-train it with hybrid objective functions that incorporate both code understanding and code generation tasks. Then we fine-tune the pre-trained model on code completion. During the completion, our model does not directly predict the next token. Instead, we adopt multi-task learning to predict the token and its type jointly and utilize the predicted type to assist the token prediction. Experiments results on two real-world datasets demonstrate the effectiveness of our model when compared with state-of-the-art methods.
引用
收藏
页码:473 / 485
页数:13
相关论文
共 50 条
  • [21] Knowledge Graph Completion Using a Pre-Trained Language Model Based on Categorical Information and Multi-Layer Residual Attention
    Rao, Qiang
    Wang, Tiejun
    Guo, Xiaoran
    Wang, Kaijie
    Yan, Yue
    [J]. APPLIED SCIENCES-BASEL, 2024, 14 (11):
  • [22] A Novel Embedding Model for Knowledge Graph Completion Based on Multi-Task Learning
    Dou, Jiaheng
    Tian, Bing
    Zhang, Yong
    Xing, Chunxiao
    [J]. DATABASE SYSTEMS FOR ADVANCED APPLICATIONS (DASFAA 2021), PT I, 2021, 12681 : 240 - 255
  • [23] Pre-trained Language Model Representations for Language Generation
    Edunov, Sergey
    Baevski, Alexei
    Auli, Michael
    [J]. 2019 CONFERENCE OF THE NORTH AMERICAN CHAPTER OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS: HUMAN LANGUAGE TECHNOLOGIES (NAACL HLT 2019), VOL. 1, 2019, : 4052 - 4059
  • [24] AMBERT: A Pre-trained Language Model with Multi-Grained Tokenization
    Zhang, Xinsong
    Li, Pengshuai
    Li, Hang
    [J]. FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, ACL-IJCNLP 2021, 2021, : 421 - 435
  • [25] Pre-trained Language Model based Ranking in Baidu Search
    Zou, Lixin
    Zhang, Shengqiang
    Cai, Hengyi
    Ma, Dehong
    Cheng, Suqi
    Wang, Shuaiqiang
    Shi, Daiting
    Cheng, Zhicong
    Yin, Dawei
    [J]. KDD '21: PROCEEDINGS OF THE 27TH ACM SIGKDD CONFERENCE ON KNOWLEDGE DISCOVERY & DATA MINING, 2021, : 4014 - 4022
  • [26] Software Vulnerabilities Detection Based on a Pre-trained Language Model
    Xu, Wenlin
    Li, Tong
    Wang, Jinsong
    Duan, Haibo
    Tang, Yahui
    [J]. 2023 IEEE 22ND INTERNATIONAL CONFERENCE ON TRUST, SECURITY AND PRIVACY IN COMPUTING AND COMMUNICATIONS, TRUSTCOM, BIGDATASE, CSE, EUC, ISCI 2023, 2024, : 904 - 911
  • [27] Interpretability of Entity Matching Based on Pre-trained Language Model
    Liang, Zheng
    Wang, Hong-Zhi
    Dai, Jia-Jia
    Shao, Xin-Yue
    Ding, Xiao-Ou
    Mu, Tian-Yu
    [J]. Ruan Jian Xue Bao/Journal of Software, 2023, 34 (03): : 1087 - 1108
  • [28] A Self-Attentional Neural Architecture for Code Completion with Multi-Task Learning
    Liu, Fang
    Li, Ge
    Wei, Bolin
    Xia, Xin
    Fu, Zhiyi
    Jin, Zhi
    [J]. 2020 IEEE/ACM 28TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION, ICPC, 2020, : 37 - 47
  • [29] Syntax-guided Contrastive Learning for Pre-trained Language Model
    Zhang, Shuai
    Wang, Lijie
    Xiao, Xinyan
    Wu, Hua
    [J]. FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS (ACL 2022), 2022, : 2430 - 2440
  • [30] Adder Encoder for Pre-trained Language Model
    Ding, Jianbang
    Zhang, Suiyun
    Li, Linlin
    [J]. CHINESE COMPUTATIONAL LINGUISTICS, CCL 2023, 2023, 14232 : 339 - 347