Exploring Distributional Shifts in Large Language Models for Code Analysis
Not on the map. Why?
Abstract (arXiv)
We systematically study how three large language models with code capabilities - CodeT5, Codex, and ChatGPT - generalize to out-of-domain data. We consider two fundamental applications - code summarization, and code generation. We split data into domains following its natural boundaries - by an organization, by a project, and by a module within the software project. We establish that samples from each new domain present all the models with a significant challenge of distribution shift. We study how established methods adapt models to better generalize to new domains. Our experiments show that while multitask learning alone is a reasonable baseline, combining it with few-shot finetuning on examples retrieved from training data can achieve very strong performance. Moreover, this solution can outperform direct finetuning for very low-data scenarios. Finally, we consider variations of this approach to create a more broadly applicable method to adapt to multiple domains at once. We find that for code generation, a model adapted to multiple domains simultaneously performs on par with those adapted to a single domain
Key facts. Cited by 14 papers in the map (data through 13 Oct 2026). Builds on 38 of its 64 references that are in the map. First posted on arXiv 16 Mar 2023.
Builds on
38 of 64 references.
References · 38
- 2020Language Models are Few-Shot Learnerscited by 32,320
- 2022Training language models to follow instructions with human feedbackcited by 15,856
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,549
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,231
- 2021Evaluating Large Language Models Trained on Codecited by 8,205
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,870
- 2019Parameter-Efficient Transfer Learning for NLPcited by 4,213
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,898
- 2017Deep reinforcement learning from human preferencescited by 3,871
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,785
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,765
- 2017Prototypical Networks for Few-shot Learningcited by 3,011
26 more
- 2016Matching Networks for One Shot Learningcited by 2,251
- 2021Multitask Prompted Training Enables Zero-Shot Task Generalizationcited by 1,468
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,191
- 2017Learning to Compare: Relation Network for Few-Shot Learningcited by 1,141
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 905
- 2022Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learningcited by 891
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 651
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 475
- 2018TADAM: Task dependent adaptive metric for improved few-shot learningcited by 408
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 348
- 2018How to train your MAMLcited by 306
- 2018Probabilistic Model-Agnostic Meta-Learningcited by 254
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
- 2019Simple, Scalable Adaptation for Neural Machine Translationcited by 240
- 2020Cross-Domain Few-Shot Classification via Learned Feature-Wise Transformationcited by 184
- 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 163
- 2021Case-based Reasoning for Natural Language Queries over Knowledge Basescited by 107
- 2023CodeBERTScore: Evaluating Code Generation with Pretrained Models of Codecited by 102
- 2019Generalized Inner Loop Meta-Learningcited by 93
- 2016Deep Multi-task Representation Learning: A Tensor Factorisation Approachcited by 69
- 2022Out of the BLEU: how should we assess quality of the Code Generation models?cited by 65
- 2021IsoScore: Measuring the Uniformity of Embedding Space Utilizationcited by 52
- 2019Modular Universal Reparameterization: Deep Multi-task Learning Across Diverse Domainscited by 13
- 2021Impact of Evaluation Methodologies on Code Summarizationcited by 11
- 2021Estimating Predictive Uncertainty Under Program Data Distribution Shiftcited by 5
- 2022Robust Machine Learning for Malware Detection over Timecited by 5
Built on by
Citing papers per year: 2023: 1; 2024: 4; 2025: 4; 2026: 5.
14 papers.
Sort:
By area:
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 395
- 2024On the Self-Verification Limitations of Large Language Models on Reasoning and Planning Taskscited by 140
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2024Automatic Programming: Large Language Models and Beyondcited by 35
- 2024Automatically Generating UI Code from Screenshot: A Divide-and-Conquer-Based Approachcited by 24
- 2025Risk Assessment Framework for Code LLMs via Leveraging Internal Statescited by 8
- 2025Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearningcited by 7
- 2025JaxSGMC: Modular stochastic gradient MCMC in JAXcited by 1
- 2025URECA: The Chain of Two Minimum Set Cover Problems exists behind Adaptation to Shifts in Semantic Code Searchcited by 0
- 2026Resource-Adaptive Federated Text Generation with Differential Privacycited by 0
- 2026DOne: Decoupling Structure and Rendering for High-Fidelity Design-to-Code Generationcited by 0
- 2026Prompt-Driven Code Summarization: A Systematic Literature Reviewcited by 0
- 2026From Experience to Expertise: Adoption-Aware Memory Learning for Data-Scarce NPU Kernel Synthesis28 Sep 2026
- 2026Efficiently Learning Drifting Halfspaces with Massart Noise9 Jun 2026
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review16 Apr 2026
- 2026DOne: Decoupling Structure and Rendering for High-Fidelity Design-to-Code Generation12 Mar 2026
- 2026Resource-Adaptive Federated Text Generation with Differential Privacy7 Mar 2026
- 2025Scrub It Out! Erasing Sensitive Memorization in Code Language Models via Machine Unlearning17 Sep 2025
- 2025JaxSGMC: Modular stochastic gradient MCMC in JAX16 May 2025
- 2025Risk Assessment Framework for Code LLMs via Leveraging Internal States20 Apr 2025
- 2025URECA: The Chain of Two Minimum Set Cover Problems exists behind Adaptation to Shifts in Semantic Code Search11 Feb 2025
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024Automatically Generating UI Code from Screenshot: A Divide-and-Conquer-Based Approach24 Jun 2024
- 2024Automatic Programming: Large Language Models and Beyond3 May 2024
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 395
- 2024Automatic Programming: Large Language Models and Beyondcited by 35
- 2024Automatically Generating UI Code from Screenshot: A Divide-and-Conquer-Based Approachcited by 24
- 2025Risk Assessment Framework for Code LLMs via Leveraging Internal Statescited by 8
- 2025JaxSGMC: Modular stochastic gradient MCMC in JAXcited by 1
- 2025URECA: The Chain of Two Minimum Set Cover Problems exists behind Adaptation to Shifts in Semantic Code Searchcited by 0
- 2026Resource-Adaptive Federated Text Generation with Differential Privacycited by 0
- 2026Prompt-Driven Code Summarization: A Systematic Literature Reviewcited by 0
- 2026Efficiently Learning Drifting Halfspaces with Massart Noisecited by 0
- 2026From Experience to Expertise: Adoption-Aware Memory Learning for Data-Scarce NPU Kernel Synthesiscited by 0
- 2026From Experience to Expertise: Adoption-Aware Memory Learning for Data-Scarce NPU Kernel Synthesis28 Sep 2026
- 2026Efficiently Learning Drifting Halfspaces with Massart Noise9 Jun 2026
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review16 Apr 2026
- 2026Resource-Adaptive Federated Text Generation with Differential Privacy7 Mar 2026
- 2025JaxSGMC: Modular stochastic gradient MCMC in JAX16 May 2025
- 2025Risk Assessment Framework for Code LLMs via Leveraging Internal States20 Apr 2025
- 2025URECA: The Chain of Two Minimum Set Cover Problems exists behind Adaptation to Shifts in Semantic Code Search11 Feb 2025
- 2024Automatically Generating UI Code from Screenshot: A Divide-and-Conquer-Based Approach24 Jun 2024
- 2024Automatic Programming: Large Language Models and Beyond3 May 2024
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023