arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2408.10914cs.CL
收藏

编码还是不编码?探究预训练中代码的影响

To Code, or Not To Code? Exploring Impact of Code in Pre-training

Cohere For AI;Cohere

Viraat Aryabumi, Yixuan Su, Raymond Ma, Adrien Morisot, Ivan Zhang, Acyr Locatelli, Marzieh Fadaee, Ahmet Üstün, Sara Hooker

AI总结:

本研究系统探究预训练中代码数据对通用性能的影响,发现代码是泛化关键,能显著提升推理、知识、生成及代码任务表现。

摘要:

将代码纳入预训练数据混合中,即使对于并非专门为代码设计的模型,也已成为大语言模型(LLM)预训练的常见做法。尽管从业者之间已有共识(尽管是轶事性的)认为代码数据在通用大语言模型的性能中起着至关重要的作用,但只有有限的工作分析了代码对非代码任务的精确影响。在这项工作中,我们系统地研究了代码数据对通用性能的影响。我们提出疑问:“预训练中使用的代码数据对超越代码生成的广泛下游任务有何影响?”我们进行了广泛的消融实验,并在涵盖自然语言推理任务、世界知识任务、代码基准以及大语言模型作为评判者的胜率等多个方面进行了评估,模型规模从470M到2.8B参数不等。在各种设置中,我们发现一致的结果:代码是超越编码任务的泛化的关键构建块,代码质量的改进对所有任务都有超比例的影响。特别是,与仅文本预训练相比,添加代码导致自然语言(NL)推理相对提升高达8.2%,世界知识提升4.2%,生成胜率提升6.6%,代码性能提升12倍。我们的工作表明,投资于代码质量并在预训练中保留代码具有积极影响。

英文摘要:

Including code in the pre-training data mixture, even for models not specifically designed for code, has become a common practice in LLMs pre-training. While there has been anecdotal consensus among practitioners that code data plays a vital role in general LLMs' performance, there is only limited work analyzing the precise impact of code on non-code tasks. In this work, we systematically investigate the impact of code data on general performance. We ask "what is the impact of code data used in pre-training on a large variety of downstream tasks beyond code generation". We conduct extensive ablations and evaluate across a broad range of natural language reasoning tasks, world knowledge tasks, code benchmarks, and LLM-as-a-judge win-rates for models with sizes ranging from 470M to 2.8B parameters. Across settings, we find a consistent results that code is a critical building block for generalization far beyond coding tasks and improvements to code quality have an outsized impact across all tasks. In particular, compared to text-only pre-training, the addition of code results in up to relative increase of 8.2% in natural language (NL) reasoning, 4.2% in world knowledge, 6.6% improvement in generative win-rates, and a 12x boost in code performance respectively. Our work suggests investments in code quality and preserving code during pre-training have positive impacts.

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

↑