CodeGen2: Lessons for Training LLMs on Programming and Natural Languages
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have demonstrated remarkable abilities in representation learning for program synthesis and understanding tasks. The quality of the learned representations appears to be dictated by the neural scaling laws as a function of the number of model parameters and observations, while imposing upper bounds on the model performance by the amount of available data and compute, which is costly. In this study, we attempt to render the training of LLMs for program synthesis more efficient by unifying four key components: (1) model architectures, (2) learning methods, (3) infill sampling, and, (4) data distributions. Specifically, for the model architecture, we attempt to unify encoder and decoder-based models into a single prefix-LM. For learning methods, (i) causal language modeling, (ii) span corruption, (iii) infilling are unified into a simple learning algorithm. For infill sampling, we explore the claim of a "free lunch" hypothesis. For data distributions, the effect of a mixture distribution and multi-epoch training of programming and natural languages on model performance is explored. We conduct a comprehensive series of empirical experiments on 1B LLMs, for which failures and successes of this exploration are distilled into five lessons. We will provide a final recipe for training and release CodeGen2 models in size 1B, 3.7B, 7B, and, 16B parameters, along with the training framework as open-source: https://github.com/salesforce/CodeGen.
Key facts. Cited by 124 papers in the map (data through 7 Oct 2026). Builds on 26 of its 31 references that are in the map. First posted on arXiv 3 May 2023.
Builds on
26 of 31 references.
References · 26
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,818
- 2022Emergent Abilities of Large Language Modelscited by 2,483
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2019SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systemscited by 1,718
14 more
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,308
- 2022LaMDA: Language Models for Dialog Applicationscited by 1,218
- 2021GLM: General Language Model Pretraining with Autoregressive Blank Infillingcited by 1,026
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 960
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2023Data Selection for Language Models via Importance Resamplingcited by 322
- 2022Efficient Training of Language Models to Fill in the Middlecited by 248
- 2023SantaCoder: don't reach for the stars!cited by 169
- 2022What Language Model Architecture and Pretraining Objective Work Best for Zero-Shot Generalization?cited by 149
- 2022Transcending Scaling Laws with 0.1% Extra Computecited by 55
Built on by
Citing papers per year: 2023: 25; 2024: 63; 2025: 33; 2026: 3.
124 papers.
Sort:
By area:
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,302
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2023Textbooks Are All You Needcited by 561
- 2024Large Language Models: A Surveycited by 506
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2024Continual Learning of Large Language Models: A Comprehensive Surveycited by 228
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 183
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
38 more
- 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Modelscited by 127
- 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 106
- 2024BetterV: Controlled Verilog Generation with Discriminative Guidancecited by 99
- 2024VerilogCoder: Autonomous Verilog Coding Agents with Graph-based Planning and Abstract Syntax Tree (AST)-based Waveform Tracing Toolcited by 85
- 2024When LLMs Meet Cybersecurity: A Systematic Literature Reviewcited by 70
- 2024Preble: Efficient Distributed Prompt Scheduling for LLM Servingcited by 68
- 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 63
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2023CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modulescited by 58
- 2023Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repaircited by 55
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
- 2023Bias Testing and Mitigation in LLM-based Code Generationcited by 53
- 2024AgentOhana: Design Unified Data and Training Pipeline for Effective Agent Learningcited by 53
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2023Knowledge Transfer from High-Resource to Low-Resource Programming Languages for Code LLMscited by 45
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?cited by 44
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Modelcited by 40
- 2024Finetuning Large Language Models for Vulnerability Detectioncited by 39
- 2024LeDex: Training LLMs to Better Self-Debug and Explain Codecited by 39
- 2023Text2Analysis: A Benchmark of Table Question Answering with Advanced Data Analysis and Unclear Queriescited by 38
- 2024AutoVCoder: A Systematic Framework for Automated Verilog Code Generation using LLMscited by 36
- 2023SALLM: Security Assessment of Generated Codecited by 35
- 2025OmniRouter: Budget and Performance Controllable Multi-LLM Routingcited by 35
- 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarkscited by 34
- 2024CodeXEmbed: A Generalist Embedding Model Family for Multiligual and Multi-task Code Retrievalcited by 33
- 2024AST-T5: Structure-Aware Pretraining for Code Generation and Understandingcited by 32
- 2024REPOFUSE: Repository-Level Code Completion with Fused Dual Contextcited by 32
- 2024LaMAGIC: Language-Model-based Topology Generation for Analog Integrated Circuitscited by 32
- 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisationcited by 31
- 2024History, Development, and Principles of Large Language Models-An Introductory Surveycited by 30
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2024Between Lines of Code: Unraveling the Distinct Patterns of Machine and Human Programmerscited by 27
- 2023BioCoder: A Benchmark for Bioinformatics Code Generation with Large Language Modelscited by 24
- 2024NoFunEval: Funny How Code LMs Falter on Requirements Beyond Functional Correctnesscited by 23
- 2023L2CEval: Evaluating Language-to-Code Generation Capabilities of Large Language Modelscited by 22
- 2023LLM for SoC Security: A Paradigm Shiftcited by 22
- 2024CodeEditorBench: Evaluating Code Editing Capability of Large Language Modelscited by 22
- 2025QualityFlow: An Agentic Workflow for Program Synthesis Controlled by LLM Quality Checkscited by 22
50 most cited of 124 All 124 (JSON)
- 2026A Taxonomy of Programming Languages for Code Generation31 Mar 2026
- 2026DreamOn: Diffusion Language Models For Code Infilling Beyond Fixed-size Canvas1 Feb 2026
- 2026Evaluating and Achieving Controllable Code Completion in Code LLM22 Jan 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025Large Language Model for Verilog Code Generation: Literature Review and the Road Ahead29 Oct 2025
- 2025Selecting and Combining Large Language Models for Scalable Code Clone Detection17 Oct 2025
- 2025Secure-Instruct: An Automated Pipeline for Synthesizing Instruction-Tuning Datasets Using LLMs for Secure Code Generation8 Oct 2025
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025LLM-based Vulnerability Discovery through the Lens of Code Metrics23 Sep 2025
- 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMs16 Sep 2025
- 2025Uncovering Scaling Laws for Large Language Models via Inverse Problems9 Sep 2025
- 2025QAgent: An LLM-based Multi-Agent System for Autonomous OpenQASM programming26 Aug 2025
38 more
- 2025Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction History13 Aug 2025
- 2025AdaptFlow: Adaptive Workflow Optimization via Meta-Learning11 Aug 2025
- 2025Cluster Purge Loss: Structuring Transformer Embeddings for Equivalent Mutants Detection26 Jul 2025
- 2025Dr. Boot: Bootstrapping Program Synthesis Language Models to Perform Repairing20 Jul 2025
- 2025Semantic Source Code Segmentation using Small and Large Language Models11 Jul 2025
- 2025White-Basilisk: A Hybrid Model for Code Vulnerability Detection11 Jul 2025
- 2025Failure by Interference: Language Models Make Balanced Parentheses Errors When Faulty Mechanisms Overshadow Sound Ones30 Jun 2025
- 2025LaMAGIC2: Advanced Circuit Formulations for Language Model-Based Analog Topology Generation11 Jun 2025
- 2025Truly Assessing Fluid Intelligence of Large Language Models through Dynamic Reasoning Evaluation3 Jun 2025
- 2025Multimodal DeepResearcher: Generating Text-Chart Interleaved Reports From Scratch with Agentic Framework3 Jun 2025
- 2025EFIM: Efficient Serving of LLMs for Infilling Tasks with Improved KV Cache Reuse28 May 2025
- 2025Large Language Models for Computer-Aided Design: A Survey13 May 2025
- 2025CodeBC: A More Secure Large Language Model for Smart Contract Code Generation in Blockchain28 Apr 2025
- 2025A Simple Ensemble Strategy for LLM Inference: Towards More Stable Text Classification26 Apr 2025
- 2025AGENT: An Aerial Vehicle Generation and Design Tool Using Large Language Models11 Apr 2025
- 2025Aligning Crowd-sourced Human Feedback for Reinforcement Learning on Code Generation by Large Language Models19 Mar 2025
- 2025Enhancing Code LLM Training with Programmer Attention19 Mar 2025
- 2025TestForge: Feedback-Driven, Agentic Test Suite Generation18 Mar 2025
- 2025VeriContaminated: Assessing LLM-Driven Verilog Coding for Data Contamination17 Mar 2025
- 2025OmniRouter: Budget and Performance Controllable Multi-LLM Routing27 Feb 2025
- 2025CodeIF: Benchmarking the Instruction-Following Capabilities of Large Language Models for Code Generation26 Feb 2025
- 2025Facilitating Long Context Understanding via Supervised Chain-of-Thought Reasoning18 Feb 2025
- 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarks10 Feb 2025
- 2025QualityFlow: An Agentic Workflow for Program Synthesis Controlled by LLM Quality Checks20 Jan 2025
- 2024ExecRepoBench: Multi-level Executable Code Completion Evaluation16 Dec 2024
- 2024IntellectSeeker: A Personalized Literature Management System with the Probabilistic Model and Large Language Model10 Dec 2024
- 2024Strategic Prompting for Conversational Tasks: A Comparative Analysis of Large Language Models Across Diverse Conversational Tasks26 Nov 2024
- 2024CodeXEmbed: A Generalist Embedding Model Family for Multiligual and Multi-task Code Retrieval19 Nov 2024
- 2024Enhancing Reverse Engineering: Investigating and Benchmarking Large Language Models for Vulnerability Analysis in Decompiled Binaries7 Nov 2024
- 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Models7 Nov 2024
- 2024Parameter-Efficient Fine-Tuning of Large Language Models for Unit Test Generation: An Empirical Study4 Nov 2024
- 2024Metamorphic Malware Evolution: The Potential and Peril of Large Language Models31 Oct 2024
- 2024VisualCoder: Guiding Large Language Models in Code Execution with Fine-grained Multimodal Chain-of-Thought Reasoning30 Oct 2024
- 2024Generalists vs. Specialists: Evaluating LLMs on Highly-Constrained Biophysical Sequence Optimization Tasks29 Oct 2024
- 2024LLM-Pilot: Characterize and Optimize Performance of your LLM Inference Services3 Oct 2024
- 2024Detecting Buggy Contracts via Smart Testing6 Sep 2024
- 2024Enhancing Source Code Security with LLMs: Demystifying The Challenges and Generating Reliable Repairs1 Sep 2024
- 2024VerilogCoder: Autonomous Verilog Coding Agents with Graph-based Planning and Abstract Syntax Tree (AST)-based Waveform Tracing Tool15 Aug 2024
50 newest of 124 All 124 (JSON)
- 2024VerilogCoder: Autonomous Verilog Coding Agents with Graph-based Planning and Abstract Syntax Tree (AST)-based Waveform Tracing Toolcited by 85
- 2024AgentOhana: Design Unified Data and Training Pipeline for Effective Agent Learningcited by 53
- 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisationcited by 31
- 2025QualityFlow: An Agentic Workflow for Program Synthesis Controlled by LLM Quality Checkscited by 22
- 2025Multimodal DeepResearcher: Generating Text-Chart Interleaved Reports From Scratch with Agentic Frameworkcited by 20
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2025QAgent: An LLM-based Multi-Agent System for Autonomous OpenQASM programmingcited by 9
- 2025TestForge: Feedback-Driven, Agentic Test Suite Generationcited by 8
- 2025AdaptFlow: Adaptive Workflow Optimization via Meta-Learningcited by 4
- 2025Aligning Crowd-sourced Human Feedback for Reinforcement Learning on Code Generation by Large Language Modelscited by 3
- 2025AGENT: An Aerial Vehicle Generation and Design Tool Using Large Language Modelscited by 0
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025QAgent: An LLM-based Multi-Agent System for Autonomous OpenQASM programming26 Aug 2025
- 2025AdaptFlow: Adaptive Workflow Optimization via Meta-Learning11 Aug 2025
- 2025Multimodal DeepResearcher: Generating Text-Chart Interleaved Reports From Scratch with Agentic Framework3 Jun 2025
- 2025AGENT: An Aerial Vehicle Generation and Design Tool Using Large Language Models11 Apr 2025
- 2025Aligning Crowd-sourced Human Feedback for Reinforcement Learning on Code Generation by Large Language Models19 Mar 2025
- 2025TestForge: Feedback-Driven, Agentic Test Suite Generation18 Mar 2025
- 2025QualityFlow: An Agentic Workflow for Program Synthesis Controlled by LLM Quality Checks20 Jan 2025
- 2024VerilogCoder: Autonomous Verilog Coding Agents with Graph-based Planning and Abstract Syntax Tree (AST)-based Waveform Tracing Tool15 Aug 2024
- 2024AgentOhana: Design Unified Data and Training Pipeline for Effective Agent Learning23 Feb 2024
- 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisation20 Dec 2023
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,302
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?cited by 44
- 2025Facilitating Long Context Understanding via Supervised Chain-of-Thought Reasoningcited by 6
- 2025Truly Assessing Fluid Intelligence of Large Language Models through Dynamic Reasoning Evaluationcited by 6
- 2024VisualCoder: Guiding Large Language Models in Code Execution with Fine-grained Multimodal Chain-of-Thought Reasoningcited by 3
- 2025Truly Assessing Fluid Intelligence of Large Language Models through Dynamic Reasoning Evaluation3 Jun 2025
- 2025Facilitating Long Context Understanding via Supervised Chain-of-Thought Reasoning18 Feb 2025
- 2024VisualCoder: Guiding Large Language Models in Code Execution with Fine-grained Multimodal Chain-of-Thought Reasoning30 Oct 2024
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?25 Mar 2024
- 2023Code Llama: Open Foundation Models for Code24 Aug 2023
- 2023Gorilla: Large Language Model Connected with Massive APIs24 May 2023
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Modelcited by 40
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 20
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model11 Jun 2024
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completion15 Mar 2024
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2023Textbooks Are All You Needcited by 561
- 2024Large Language Models: A Surveycited by 506
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2024Continual Learning of Large Language Models: A Comprehensive Surveycited by 228
- 2024CodeS: Towards Building Open-source Language Models for Text-to-SQLcited by 183
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 178
- 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Modelscited by 127
- 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 106
12 most cited of 98 All 98 (JSON)
- 2026A Taxonomy of Programming Languages for Code Generation31 Mar 2026
- 2026Evaluating and Achieving Controllable Code Completion in Code LLM22 Jan 2026
- 2025Large Language Model for Verilog Code Generation: Literature Review and the Road Ahead29 Oct 2025
- 2025Selecting and Combining Large Language Models for Scalable Code Clone Detection17 Oct 2025
- 2025LLM-based Vulnerability Discovery through the Lens of Code Metrics23 Sep 2025
- 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMs16 Sep 2025
- 2025Uncovering Scaling Laws for Large Language Models via Inverse Problems9 Sep 2025
- 2025Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction History13 Aug 2025
- 2025Cluster Purge Loss: Structuring Transformer Embeddings for Equivalent Mutants Detection26 Jul 2025
- 2025Semantic Source Code Segmentation using Small and Large Language Models11 Jul 2025
- 2025White-Basilisk: A Hybrid Model for Code Vulnerability Detection11 Jul 2025
- 2025Failure by Interference: Language Models Make Balanced Parentheses Errors When Faulty Mechanisms Overshadow Sound Ones30 Jun 2025
12 newest of 98 All 98 (JSON)