On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of Code
Not on the map. Why?
Abstract (arXiv)
Pre-trained language models (PLMs) have become a prevalent technique in deep learning for code, utilizing a two-stage pre-training and fine-tuning procedure to acquire general knowledge about code and specialize in a variety of downstream tasks. However, the dynamic nature of software codebases poses a challenge to the effectiveness and robustness of PLMs. In particular, world-realistic scenarios potentially lead to significant differences between the distribution of the pre-training and test data, i.e., distribution shift, resulting in a degradation of the PLM's performance on downstream tasks. In this paper, we stress the need for adapting PLMs of code to software data whose distribution changes over time, a crucial problem that has been overlooked in previous works. The motivation of this work is to consider the PLM in a non-stationary environment, where fine-tuning data evolves over time according to a software evolution scenario. Specifically, we design a scenario where the model needs to learn from a stream of programs containing new, unseen APIs over time. We study two widely used PLM architectures, i.e., a GPT2 decoder and a RoBERTa encoder, on two downstream tasks, API call and API usage prediction. We demonstrate that the most commonly used fine-tuning technique from prior work is not robust enough to handle the dynamic nature of APIs, leading to the loss of previously acquired knowledge i.e., catastrophic forgetting. To address these issues, we implement five continual learning approaches, including replay-based and regularization-based methods. Our findings demonstrate that utilizing these straightforward methods effectively mitigates catastrophic forgetting in PLMs across both downstream tasks while achieving comparable or superior performance.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 46 of its 77 references that are in the map. First posted on arXiv 6 May 2023.
Builds on
46 of 77 references.
References · 46
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2016Overcoming catastrophic forgetting in neural networkscited by 4,718
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
- 2016Learning without Forgettingcited by 2,465
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
- 2020WILDS: A Benchmark of in-the-Wild Distribution Shiftscited by 1,366
- 2016Progressive Neural Networkscited by 1,332
34 more
- 2018Continual Lifelong Learning with Neural Networks: A Reviewcited by 1,313
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2017Memory Aware Synapses: Learning what (not) to forgetcited by 1,094
- 2018XNLI: Evaluating Cross-lingual Sentence Representationscited by 913
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2018Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigencecited by 734
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2020Learning under Concept Drift: A Reviewcited by 470
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2021Dynabench: Rethinking Benchmarking in NLPcited by 447
- 2021Towards Out-Of-Distribution Generalization: A Surveycited by 431
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2020Pretrained Transformers Improve Out-of-Distribution Robustnesscited by 293
- 2021DyTox: Transformers for Continual Learning with DYnamic TOken eXpansioncited by 291
- 2017CORe50: a New Dataset and Benchmark for Continuous Object Recognitioncited by 287
- 2020Few-Shot Class-Incremental Learningcited by 249
- 2020Continual Lifelong Learning in Natural Language Processing: A Surveycited by 152
- 2021Avalanche: an End-to-End Library for Continual Learningcited by 124
- 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 123
- 2019A continual learning survey: Defying forgetting in classification taskscited by 118
- 2022GLUE-X: Evaluating Natural Language Understanding Models from an Out-of-distribution Generalization Perspectivecited by 72
- 2022Memory Efficient Continual Learning with Transformerscited by 43
- 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligencecited by 41
- 2020CC2Vec: Distributed Representations of Code Changescited by 38
- 2020A Systematic Literature Review on the Use of Deep Learning in Software Engineering Researchcited by 35
- 2018Towards continual learning in medical imagingcited by 24
- 2021An Empirical Study on the Usage of BERT Models for Code Completioncited by 22
- 2020Learning Autocompletion from Real-World Datasetscited by 19
- 2022Alleviating Representational Shift for Continual Fine-tuningcited by 8
- 2023Keeping Pace with Ever-Increasing Data: Towards Continual Learning of Code Intelligence Modelscited by 8
- 2023Continual HyperTransformer: A Meta-Learner for Continual Few-Shot Learningcited by 3
- 2020A Software-Repair Robot based on Continual Learningcited by 2
Built on by
Citing papers per year: 2023: 3; 2024: 4.
7 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2024Continual Learning of Large Language Models: A Comprehensive Surveycited by 228
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2023Trustworthy and Synergistic Artificial Intelligence for Software Engineering: Vision and Roadmapscited by 19
- 2024Towards Incremental Learning in Large Language Models: A Critical Reviewcited by 6
- 2024GitChameleon: Unmasking the Version-Switching Capabilities of Code Generation Modelscited by 6
- 2024MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repaircited by 0
- 2024GitChameleon: Unmasking the Version-Switching Capabilities of Code Generation Models5 Nov 2024
- 2024MergeRepair: An Exploratory Study on Merging Task-Specific Adapters in Code LLMs for Automated Program Repair18 Aug 2024
- 2024Towards Incremental Learning in Large Language Models: A Critical Review28 Apr 2024
- 2024Continual Learning of Large Language Models: A Comprehensive Survey25 Apr 2024
- 2023Trustworthy and Synergistic Artificial Intelligence for Software Engineering: Vision and Roadmaps8 Sep 2023
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Models21 Aug 2023