SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representations
Changan Niu, Chuanyi Li, Vincent Ng, Jidong Ge, Liguo Huang, Bin Luo
Abstract
Recent years have seen the successful application of large pre-trained models to code representation learning, resulting in substantial improvements on many code-related downstream tasks. But there are issues surrounding their application to SE tasks. First, the majority of the pre-trained models focus on pre-training only the encoder of the Transformer. For generation tasks that are addressed using models with the encoder-decoder architecture, however, there is no reason why the decoder should be left out during pre-training. Second, many existing pre-trained models, including state-of-the-art models such as T5-learning, simply reuse the pretraining tasks designed for natural languages. Moreover, to learn the natural language description of source code needed eventually for code-related tasks such as code summarization, existing pretraining tasks require a bilingual corpus composed of source code and the associated natural language description, which severely limits the amount of data for pre-training. To this end, we propose SPT-Code, a sequence-to-sequence pre-trained model for source code. In order to pre-train SPT-Code in a sequence-to-sequence manner and address the aforementioned weaknesses associated with existing pre-training tasks, we introduce three pre-training tasks that are specifically designed to enable SPT-Code to learn knowledge of source code, the corresponding code structure, as well as a natural language description of the code without relying on any bilingual corpus, and eventually exploit these three sources of information when it is applied to downstream tasks. Experimental results demonstrate that SPT-Code achieves state-of-the-art performance on five code-related downstream tasks after fine-tuning.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
25 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- CoCoSoDa: Effective Contrastive Learning for Code Search cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CoCoSoDa: Effective Contrastive Learning for Code Search cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- VULGEN: Realistic Vulnerability Generation Via Pattern Mining and Deep Learning cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- NatGen: generative pre-training by "naturalizing" source code cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- NatGen: generative pre-training by "naturalizing" source code cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- NatGen: generative pre-training by "naturalizing" source code cites ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators
- CodeBERT: A Pre-Trained Model for Programming and Natural Languages cites ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators
- CodeBERT: A Pre-Trained Model for Programming and Natural Languages cites Learning and Evaluating Contextual Embedding of Source Code
- Learning and Evaluating Contextual Embedding of Source Code cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- An Empirical Comparison of Pre-Trained Models of Source Code cites BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
- An Empirical Comparison of Pre-Trained Models of Source Code cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- An Empirical Comparison of Pre-Trained Models of Source Code cites GraphCodeBERT: Pre-training Code Representations with Data Flow
- An Empirical Comparison of Pre-Trained Models of Source Code cites ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators
- An Empirical Comparison of Pre-Trained Models of Source Code cites Learning and Evaluating Contextual Embedding of Source Code
- Towards Efficient Fine-Tuning of Pre-trained Code Models: An Experimental Study and Beyond cites NatGen: generative pre-training by "naturalizing" source code
- Towards Efficient Fine-Tuning of Pre-trained Code Models: An Experimental Study and Beyond cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Towards Efficient Fine-Tuning of Pre-trained Code Models: An Experimental Study and Beyond cites GraphCodeBERT: Pre-training Code Representations with Data Flow
Cited by top-tier papers25
- NatGen: generative pre-training by "naturalizing" source codeSaikat Chakraborty, Toufique Ahmed, Yangruibo Ding, Premkumar T. Devanbu et al.FSE 2022 · 101 citations
- An Empirical Comparison of Pre-Trained Models of Source CodeChangan Niu, Chuanyi Li, Vincent Ng, Dongxiao Chen et al.ICSE 2023 · 71 citations
- CoCoSoDa: Effective Contrastive Learning for Code SearchEnsheng Shi, Yanlin Wang, Wenchao Gu, Lun Du et al.ICSE 2023 · 45 citations
- Towards Efficient Fine-Tuning of Pre-trained Code Models: An Experimental Study and BeyondEnsheng Shi, Yanlin Wang, Hongyu Zhang, Lun Du et al.ISSTA 2023 · 37 citations
- VULGEN: Realistic Vulnerability Generation Via Pattern Mining and Deep LearningYu Nong, Yuzhe Ou, Michael Pradel, Feng Chen et al.ICSE 2023 · 32 citations
Builds on13
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
- BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and ComprehensionMike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad et al.ACL 2020 · 1,224 citations
- ELECTRA: Pre-training Text Encoders as Discriminators Rather Than GeneratorsKevin Clark, Minh-Thang Luong, Quoc V. Le, Christopher D. ManningICLR 2020 · 541 citations
- Learning and Evaluating Contextual Embedding of Source CodeAditya Kanade, Petros Maniatis, Gogul Balakrishnan, Kensen ShiICML 2020 · 438 citations
Related papers
- GrammarT5: Grammar-Integrated Pretrained Encoder-Decoder Neural Model for CodeQihao Zhu, Qingyuan Liang, Zeyu Sun, Yingfei Xiong et al.ICSE 2024 · 10 citations
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 citations
- AST-T5: Structure-Aware Pretraining for Code Generation and UnderstandingLinyuan Gong, Mostafa Elhoushi, Alvin CheungICML 2024 · 42 citations
- Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related TasksAntonio Mastropaolo, Simone Scalabrino, Nathan Cooper, David Nader-Palacio et al.ICSE 2021 · 9 citations
- No more fine-tuning? an experimental evaluation of prompt tuning in code intelligenceChaozheng Wang, Yuanhang Yang, Cuiyun Gao, Yun Peng et al.FSE 2022 · 148 citations
