arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2409.04556cs.CLcs.LG

代码预训练如何影响语言模型的任务性能?

How Does Code Pretraining Affect Language Model Task Performance?

New York University(纽约大学);Google Research(谷歌研究院)

Jackson Petty, Sjoerd van Steenkiste, Tal Linzen

AI总结:

该研究通过控制语言与代码数据比例的预训练实验,发现代码预训练提升组合与数学任务性能,但损害语言结构敏感及现实知识任务。

摘要:

大型语言模型越来越多地在包含自然语言和非语言数据(如源代码)的语料库上进行训练。除了有助于编程相关任务外,轶事证据表明,在预训练语料库中包含代码可能会提高其他不相关任务的性能,然而迄今为止,还没有工作能够通过控制语言和代码数据之间的差异来建立因果关系。在这里,我们正是这样做的。我们在两种不同设置下对交错自然语言和代码的数据集进行语言模型预训练:加性设置,其中预训练期间看到的数据总量保持不变;竞争性设置,其中语言数据的量保持不变。我们研究了预训练混合比例如何影响(a)BigBench基准中包含的多种任务集合的性能,以及(b)组合性,通过语义解析和句法变换的泛化准确性来衡量。我们发现,在更高比例的代码上进行预训练可以提高涉及结构化输出(如语义解析)的组合任务以及数学任务的性能。相反,增加代码混合比例可能会损害其他任务的性能,包括需要对语言结构(如句法或形态)敏感的任务,以及衡量现实世界知识的任务。

英文摘要:

Large language models are increasingly trained on corpora containing both natural language and non-linguistic data like source code. Aside from aiding programming-related tasks, anecdotal evidence suggests that including code in pretraining corpora may improve performance on other, unrelated tasks, yet to date no work has been able to establish a causal connection by controlling between language and code data. Here we do just this. We pretrain language models on datasets which interleave natural language and code in two different settings: additive, in which the total volume of data seen during pretraining is held constant; and competitive, in which the volume of language data is held constant. We study how the pretraining mixture affects performance on (a) a diverse collection of tasks included in the BigBench benchmark, and (b) compositionality, measured by generalization accuracy on semantic parsing and syntactic transformations. We find that pretraining on higher proportions of code improves performance on compositional tasks involving structured output (like semantic parsing), and mathematics. Conversely, increase code mixture can harm performance on other tasks, including on tasks that requires sensitivity to linguistic structure such as syntax or morphology, and tasks measuring real-world knowledge.

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

↑