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 条
  • [1] Enhancing Pre-trained Language Representation for Multi-Task Learning of Scientific Summarization
    Jia, Ruipeng
    Cao, Yannan
    Fang, Fang
    Li, Jinpeng
    Liu, Yanbing
    Yin, Pengfei
    [J]. 2020 INTERNATIONAL JOINT CONFERENCE ON NEURAL NETWORKS (IJCNN), 2020,
  • [2] Multi-task Learning Based Online Dialogic Instruction Detection with Pre-trained Language Models
    Hao, Yang
    Li, Hang
    Ding, Wenbiao
    Wu, Zhongqin
    Tang, Jiliang
    Luckin, Rose
    Liu, Zitao
    [J]. ARTIFICIAL INTELLIGENCE IN EDUCATION (AIED 2021), PT II, 2021, 12749 : 183 - 189
  • [3] Multi-task Active Learning for Pre-trained Transformer-based Models
    Rotman, Guy
    Reichart, Roi
    [J]. TRANSACTIONS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, 2022, 10 : 1209 - 1228
  • [4] MCM: A Multi-task Pre-trained Customer Model for Personalization
    Luo, Rui
    Wang, Tianxin
    Deng, Jingyuan
    Wan, Peng
    [J]. PROCEEDINGS OF THE 17TH ACM CONFERENCE ON RECOMMENDER SYSTEMS, RECSYS 2023, 2023, : 637 - 639
  • [5] MTLink: Adaptive multi-task learning based pre-trained language model for traceability link recovery between issues and commits
    Deng, Yang
    Wang, Bangchao
    Zhu, Qiang
    Liu, Junping
    Kuang, Jiewen
    Li, Xingfu
    [J]. JOURNAL OF KING SAUD UNIVERSITY-COMPUTER AND INFORMATION SCIENCES, 2024, 36 (02)
  • [6] Drug knowledge discovery via multi-task learning and pre-trained models
    Li, Dongfang
    Xiong, Ying
    Hu, Baotian
    Tang, Buzhou
    Peng, Weihua
    Chen, Qingcai
    [J]. BMC MEDICAL INFORMATICS AND DECISION MAKING, 2021, 21 (SUPPL 9)
  • [7] Drug knowledge discovery via multi-task learning and pre-trained models
    Dongfang Li
    Ying Xiong
    Baotian Hu
    Buzhou Tang
    Weihua Peng
    Qingcai Chen
    [J]. BMC Medical Informatics and Decision Making, 21
  • [8] JiuZhang 2.0: A Unified Chinese Pre-trained Language Model for Multi-task Mathematical Problem Solving
    Zhao, Wayne Xin
    Zhou, Kun
    Zhang, Beichen
    Gong, Zheng
    Chen, Zhipeng
    Zhou, Yuanhang
    Wen, Ji-Rong
    Sha, Jing
    Wang, Shijin
    Liu, Cong
    Hu, Guoping
    [J]. PROCEEDINGS OF THE 29TH ACM SIGKDD CONFERENCE ON KNOWLEDGE DISCOVERY AND DATA MINING, KDD 2023, 2023, : 5660 - 5672
  • [9] Multi-task Pre-training Language Model for Semantic Network Completion
    Li, Da
    Zhu, Boqing
    Yang, Sen
    Xu, Kele
    Yi, Ming
    He, Yukai
    Wang, Huaimin
    [J]. ACM TRANSACTIONS ON ASIAN AND LOW-RESOURCE LANGUAGE INFORMATION PROCESSING, 2023, 22 (11)
  • [10] Pre-trained Language Model with Prompts for Temporal Knowledge Graph Completion
    Xu, Wenjie
    Liu, Ben
    Peng, Miao
    Jia, Xu
    Peng, Min
    [J]. arXiv, 2023,