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

ComPile:一个来自生产源码的大规模 IR 数据集

ComPile: A Large IR Dataset from Production Sources

Aiden Grossman, Ludger Paehler, Konstantinos Parasyris, Tal Ben-Nun, Jacob Hegna, William Moses, Jose M Monsalve Diaz, Mircea Trofin, Johannes Doerfert

AI总结:

本文提出 ComPile 数据集,通过接入 LLVM 编译器基础设施从 Rust、Swift、Julia 和 C/C++ 等生产级程序中提取了 182B token 的 LLVM IR 数据,用于训练基于中间表示的模型并支持编译器组件的内省分析。

摘要:

代码正日益成为现代机器学习研究的核心数据模态,不仅影响我们使用 OpenAI 的 ChatGPT、Google 的 Bard 或 Anthropic 的 Claude 等对话式智能体编写代码的方式,影响我们将代码从一种语言翻译成另一种语言的方式,也影响支撑这些语言的编译器基础设施。虽然建模方法可能不同,表示形式也各异,但在各类模型中,目标任务往往保持不变。仅仅依赖现代模型从非结构化代码中提取信息的能力,未能利用 70 年来编程语言和编译器的发展成果,因为数据收集过程中没有利用程序固有的结构。这既降低了在输入代码的标记化表示上工作的模型性能,也阻碍了这些模型在编译器本身中的应用。为了推动首批基于中间表示(IR)的模型的发展,我们充分利用多种语言共享的 LLVM 编译器基础设施,生成了一个包含 182B 个 token 的 LLVM IR 数据集。我们从构建在共享 LLVM 基础设施之上的编程语言(包括 Rust、Swift、Julia 和 C/C++)中生成了该数据集,具体方法是通过语言的包管理器或直接通过编译器接入 LLVM 代码生成过程,从生产级程序中提取中间表示数据集。统计分析证明了该数据集的实用性,不仅可用于大语言模型训练,还可用于对代码生成过程本身进行内省分析,该数据集在机器学习编译器组件方面展现出巨大前景。

英文摘要:

Code is increasingly becoming a core data modality of modern machine learning research impacting not only the way we write code with conversational agents like OpenAI's ChatGPT, Google's Bard, or Anthropic's Claude, the way we translate code from one language into another, but also the compiler infrastructure underlying the language. While modeling approaches may vary and representations differ, the targeted tasks often remain the same within the individual classes of models. Relying solely on the ability of modern models to extract information from unstructured code does not take advantage of 70 years of programming language and compiler development by not utilizing the structure inherent to programs in the data collection. This detracts from the performance of models working over a tokenized representation of input code and precludes the use of these models in the compiler itself. To work towards the first intermediate representation (IR) based models, we fully utilize the LLVM compiler infrastructure, shared by a number of languages, to generate a 182B token dataset of LLVM IR. We generated this dataset from programming languages built on the shared LLVM infrastructure, including Rust, Swift, Julia, and C/C++, by hooking into LLVM code generation either through the language's package manager or the compiler directly to extract the dataset of intermediate representations from production grade programs. Statistical analysis proves the utility of our dataset not only for large language model training, but also for the introspection into the code generation process itself with the dataset showing great promise for machine-learned compiler components.

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

↑