arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.02309cs.LG
收藏

CodeGen2:在编程语言与自然语言上训练 LLM 的经验教训

CodeGen2: Lessons for Training LLMs on Programming and Natural Languages

Salesforce Research(赛富时研究院)

Erik Nijkamp, Hiroaki Hayashi, Caiming Xiong, Silvio Savarese, Yingbo Zhou

AI总结:

本文提出 CodeGen2,通过统一模型架构、学习方法、补全采样与数据分布提升程序合成 LLM 的训练效率,并基于 1B 实验总结五条经验,开源 1B 至 16B 模型及训练框架。

摘要:

大型语言模型(LLM)已在程序合成与理解任务的表征学习中展现出卓越能力。所学表征的质量似乎由神经缩放律决定,该定律是模型参数数量和观测数量的函数;同时,可用数据量与计算量会对模型性能施加上限,而二者成本高昂。在本研究中,我们试图通过统一四个关键组成部分,使面向程序合成的 LLM 训练更高效:(1)模型架构,(2)学习方法,(3)补全采样,以及(4)数据分布。具体而言,在模型架构方面,我们尝试将基于编码器和解码器的模型统一为单一的 prefix-LM。在学习方法方面,将(i)因果语言建模、(ii)跨度损坏、(iii)填充统一为一种简单的学习算法。在补全采样方面,我们探究了“免费午餐”假说这一主张。在数据分布方面,研究了编程语言与自然语言的混合分布以及多轮训练对模型性能的影响。我们在 1B 规模的 LLM 上开展了一系列全面的实证实验,并将此次探索中的失败与成功提炼为五条经验教训。我们将给出最终训练配方,并发布参数量分别为 1B、3.7B、7B 和 16B 的 CodeGen2 模型,同时将训练框架开源:https://github.com/salesforce/CodeGen。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑