mlsanityData to 7 Oct 2026

On the Usage of Continual Learning for Out-of-Distribution Generalization in Pre-trained Language Models of Code

arXiv 2305.04106 ↗First posted 6 May 2023cs.SE cs.LGcited by 7

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  7. 2016Overcoming catastrophic forgetting in neural networkscited by 4,718
  8. 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
  9. 2016Learning without Forgettingcited by 2,465
  10. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,548
  11. 2020WILDS: A Benchmark of in-the-Wild Distribution Shiftscited by 1,366
  12. 2016Progressive Neural Networkscited by 1,332
34 more
  1. 2018Continual Lifelong Learning with Neural Networks: A Reviewcited by 1,313
  2. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  3. 2017Memory Aware Synapses: Learning what (not) to forgetcited by 1,094
  4. 2018XNLI: Evaluating Cross-lingual Sentence Representationscited by 913
  5. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  6. 2018Riemannian Walk for Incremental Learning: Understanding Forgetting and Intransigencecited by 734
  7. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  8. 2020Learning under Concept Drift: A Reviewcited by 470
  9. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  10. 2021Dynabench: Rethinking Benchmarking in NLPcited by 447
  11. 2021Towards Out-Of-Distribution Generalization: A Surveycited by 431
  12. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  13. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  14. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  15. 2020Pretrained Transformers Improve Out-of-Distribution Robustnesscited by 293
  16. 2021DyTox: Transformers for Continual Learning with DYnamic TOken eXpansioncited by 291
  17. 2017CORe50: a New Dataset and Benchmark for Continuous Object Recognitioncited by 287
  18. 2020Few-Shot Class-Incremental Learningcited by 249
  19. 2020Continual Lifelong Learning in Natural Language Processing: A Surveycited by 152
  20. 2021Avalanche: an End-to-End Library for Continual Learningcited by 124
  21. 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 123
  22. 2019A continual learning survey: Defying forgetting in classification taskscited by 118
  23. 2022GLUE-X: Evaluating Natural Language Understanding Models from an Out-of-distribution Generalization Perspectivecited by 72
  24. 2022Memory Efficient Continual Learning with Transformerscited by 43
  25. 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligencecited by 41
  26. 2020CC2Vec: Distributed Representations of Code Changescited by 38
  27. 2020A Systematic Literature Review on the Use of Deep Learning in Software Engineering Researchcited by 35
  28. 2018Towards continual learning in medical imagingcited by 24
  29. 2021An Empirical Study on the Usage of BERT Models for Code Completioncited by 22
  30. 2020Learning Autocompletion from Real-World Datasetscited by 19
  31. 2022Alleviating Representational Shift for Continual Fine-tuningcited by 8
  32. 2023Keeping Pace with Ever-Increasing Data: Towards Continual Learning of Code Intelligence Modelscited by 8
  33. 2023Continual HyperTransformer: A Meta-Learner for Continual Few-Shot Learningcited by 3
  34. 2020A Software-Repair Robot based on Continual Learningcited by 2

Built on by

Cited by year

Citing papers per year: 2023: 3; 2024: 4.

7 papers.