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

面向代码LLM的从高资源到低资源编程语言的知识迁移

Knowledge Transfer from High-Resource to Low-Resource Programming Languages for Code LLMs

Northeastern University(东北大学);Wellesley College(韦尔斯利学院);Oberlin College(欧柏林学院);Stevens Institute of Technology(史蒂文斯理工学院);Microsoft Research(微软研究院);Roblox(罗布乐思公司)

Federico Cassano, John Gouwar, Francesca Lucchetti, Claire Schlesinger, Anders Freeman, Carolyn Jane Anderson, Molly Q Feldman, Michael Greenberg, Abhinav Jangda, Arjun Guha

AI总结:

本文提出MultiPL-T方法,利用半合成数据将高资源语言训练数据翻译为低资源语言数据,有效提升Code LLMs在Julia、OCaml等低资源语言上的性能。

摘要:

在过去几年中,代码大型语言模型(Code LLMs)开始对编程实践产生重大影响。Code LLMs也正成为编程语言和软件工程研究的构建块。然而,Code LLMs在训练数据中充分表示的编程语言(如Java、Python或JavaScript)上产生令人印象深刻的结果,但在训练数据有限的低资源语言上却表现不佳。低资源语言包括OCaml、Racket和其他几种语言。本文提出了一种有效的方法,使用半合成数据来提升Code LLMs在低资源语言上的性能。我们的方法MultiPL-T通过以下方式将训练数据从高资源语言翻译为低资源语言的训练数据。1)我们使用Code LLM为来自高资源语言的带注释代码合成测试,过滤掉有缺陷的测试和测试覆盖率低的代码。2)我们使用Code LLM将Python代码翻译为目标低资源语言,并使用测试来验证翻译。我们应用此方法为Julia、Lua、OCaml、R和Racket生成了数万个经过验证的训练项。此外,我们使用开放模型(StarCoderBase)和开放训练数据(The Stack),这使我们能够对基准进行去污,在不违反许可证的情况下训练模型,并运行原本无法进行的实验。使用MultiPL-T生成的数据,我们提出了StarCoderBase和Code Llama针对Julia、Lua、OCaml、R和Racket的微调版本。在既定基准(MultiPL-E)上,这些模型优于其他开放Code LLMs。MultiPL-T方法易于应用于新语言,并且比训练更长时间等替代方案显著更高效和有效。

英文摘要:

Over the past few years, Large Language Models of Code (Code LLMs) have started to have a significant impact on programming practice. Code LLMs are also emerging as building blocks for research in programming languages and software engineering. However, Code LLMs produce impressive results on programming languages that are well represented in their training data (e.g., Java, Python, or JavaScript), but struggle with low-resource languages that have limited training data available. Low resource languages include OCaml, Racket, and several others. This paper presents an effective approach for boosting the performance of Code LLMs on low-resource languages using semi-synthetic data. Our approach, MultiPL-T, translates training data from high-resource languages into training data for low-resource languages in the following way. 1) We use a Code LLM to synthesize tests for commented code from a high-resource language, filtering out faulty tests and code with low test coverage. 2) We use a Code LLM to translate Python code to a target low-resource language, and use tests to validate the translation. We apply this approach to generate tens of thousands of validated training items for Julia, Lua, OCaml, R, and Racket. Furthermore, we use an open model (StarCoderBase) with open training data (The Stack), which allows us to decontaminate benchmarks, train models without violating licenses, and run experiments that could not otherwise be done. With MultiPL-T generated data, we present fine-tuned versions of StarCoderBase and Code Llama for Julia, Lua, OCaml, R, and Racket. On established benchmarks (MultiPL-E), these models outperform other open Code LLMs. The MultiPL-T approach is easy to apply to new languages, and is significantly more efficient and effective than alternatives such as training longer.

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

↑