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

语言模型可以自学更好地编程

Language Models Can Teach Themselves to Program Better

Microsoft Research(微软研究院);MIT(麻省理工学院)

Patrick Haluptzok, Matthew Bowers, Adam Tauman Kalai

AI总结:

本文提出让语言模型利用 Python 解释器过滤自生成的编程谜题与解答并进行自我微调,实验表明测试准确率提升一倍以上,证明代码语言模型能够通过自我生成教学问题来改进自身编程能力。

摘要:

最近的语言模型(LMs)在基于人类编写的问题进行训练时,在代码生成方面取得了突破性表现,甚至能解决一些竞赛编程问题。自我对弈(self-play)已在围棋等游戏中证明有效,因此自然要问:语言模型能否生成自己的有指导性的编程问题来提升自身表现?我们证明,语言模型能够合成编程问题和解答,并通过 Python 解释器对正确性进行过滤。随后,当该语言模型在自己的合成问题和已验证解答上进行微调时,其表现得到提升;因此该模型利用 Python 解释器“自我改进”。问题以编程谜题(programming puzzles)[Schuster et al., 2021]的形式正式指定,这是一种基于代码的问题格式,其解答可以通过执行轻松验证正确性。在公开可用的语言模型上的实验中,测试准确率提高了一倍以上。这项工作展示了带有解释器的代码语言模型在生成有指导性问题并提升自身表现方面的潜力。

英文摘要:

Recent Language Models (LMs) achieve breakthrough performance in code generation when trained on human-authored problems, even solving some competitive-programming problems. Self-play has proven useful in games such as Go, and thus it is natural to ask whether LMs can generate their own instructive programming problems to improve their performance. We show that it is possible for an LM to synthesize programming problems and solutions, which are filtered for correctness by a Python interpreter. The LM's performance is then seen to improve when it is fine-tuned on its own synthetic problems and verified solutions; thus the model 'improves itself' using the Python interpreter. Problems are specified formally as programming puzzles [Schuster et al., 2021], a code-based problem format where solutions can easily be verified for correctness by execution. In experiments on publicly-available LMs, test accuracy more than doubles. This work demonstrates the potential for code LMs, with an interpreter, to generate instructive problems and improve their own performance.

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

↑