arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.06735cs.CLcs.AI
收藏

预训练阶段的哪种编程语言及其特征会影响下游逻辑推理性能?

Which Programming Language and What Features at Pre-training Stage Affect Downstream Logical Inference Performance?

The University of Tokyo(东京大学)

Fumiya Uchiyama, Takeshi Kojima, Andrew Gambardella, Qi Cao, Yusuke Iwasawa, Yutaka Matsuo

AI总结:

本研究在相同条件下从头预训练模型,发现使用编程语言训练的模型在逻辑推理和指令遵循上优于自然语言模型,且抽象语法树深度也影响推理性能。

摘要:

最近的大型语言模型(LLMs)在数学和逻辑推理任务中展现出了卓越的泛化能力。先前的研究表明,使用编程语言数据预训练的LLMs具有较高的数学和推理能力;然而,这种因果关系尚未得到严格验证。我们的研究旨在验证在预训练阶段,哪些编程语言及其特征会影响逻辑推理性能。具体而言,我们在相同条件下,使用来自十种编程语言(如Python、C、Java)的数据集和三种自然语言数据集(Wikipedia、Fineweb、C4),从头预训练了基于解码器的语言模型。随后,我们在少样本上下文学习设置下,评估了训练好的模型在逻辑推理任务FLD和bAbi上的表现,这些任务不需要常识或世界知识。结果表明,几乎所有使用编程语言训练的模型都持续优于使用自然语言训练的模型,这表明编程语言包含激发逻辑推理性能的因素。此外,我们发现,与使用自然语言训练的模型相比,使用编程语言训练的模型表现出更好的指令遵循能力。进一步分析揭示,表示程序解析结果的抽象语法树的深度也会影响逻辑推理性能。这些发现将为获取LLMs基础能力的预训练核心要素提供深刻见解。

英文摘要:

Recent large language models (LLMs) have demonstrated remarkable generalization abilities in mathematics and logical reasoning tasks. Prior research indicates that LLMs pre-trained with programming language data exhibit high mathematical and reasoning abilities; however, this causal relationship has not been rigorously tested. Our research aims to verify which programming languages and features during pre-training affect logical inference performance. Specifically, we pre-trained decoder-based language models from scratch using datasets from ten programming languages (e.g., Python, C, Java) and three natural language datasets (Wikipedia, Fineweb, C4) under identical conditions. Thereafter, we evaluated the trained models in a few-shot in-context learning setting on logical reasoning tasks: FLD and bAbi, which do not require commonsense or world knowledge. The results demonstrate that nearly all models trained with programming languages consistently outperform those trained with natural languages, indicating that programming languages contain factors that elicit logic inference performance. In addition, we found that models trained with programming languages exhibit a better ability to follow instructions compared to those trained with natural languages. Further analysis reveals that the depth of Abstract Syntax Trees representing parsed results of programs also affects logical reasoning performance. These findings will offer insights into the essential elements of pre-training for acquiring the foundational abilities of LLMs.

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

↑