arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2106.05784cs.LGcs.AIcs.CLcs.PLcs.SE
收藏

编程难题

Programming Puzzles

MIT(麻省理工学院);Allen Inst. for AI(艾伦人工智能研究所);Microsoft Research(微软研究院)

Tal Schuster, Ashwin Kalyan, Oleksandr Polozov, Adam Tauman Kalai

摘要:

我们引入了一种新型的编程挑战,称为编程谜题,作为对程序合成的客观和全面的评估,并发布了Python编程谜题(P3)的开源数据集。每个谜题都由一个简短的Python程序$f$定义,目标是找到一个使$f$返回True的输入。这些谜题是客观的,因为每个谜题都完全由其验证者$f$的源代码指定,因此测试候选解所需的全部就是对$f$进行评估。它们不需要答案键或输入/输出示例,也不依赖于自然语言理解。该数据集是全面的,因为它跨越了一系列困难和领域的问题,从琐碎的字符串操作问题到经典的编程难题(例如,河内塔),面试/竞争性编程问题(例如,动态规划),算法和数学中长期存在的开放问题(例如,保理)。我们开发基线枚举程序合成,GPT-3和Codex求解器,这些求解器能够通过从自己过去的解决方案中学习来解决难题-即使没有任何参考解决方案。Codex的表现最好,在397个测试问题中,一次尝试解决了18%的问题,80%的问题在每个问题上尝试了1,000次。在一项小型用户研究中,我们发现解谜性能和编码经验之间存在正相关关系,人类和AI解决者的解谜难度之间也存在正相关关系。因此,对P3的进一步改进可能会对许多程序合成领域产生重大影响。

英文摘要:

We introduce a new type of programming challenge called programming puzzles, as an objective and comprehensive evaluation of program synthesis, and release an open-source dataset of Python Programming Puzzles (P3). Each puzzle is defined by a short Python program $f$, and the goal is to find an input which makes $f$ return True. The puzzles are objective in that each one is specified entirely by the source code of its verifier $f$, so evaluating $f$ is all that is needed to test a candidate solution. They do not require an answer key or input/output examples, nor do they depend on natural language understanding. The dataset is comprehensive in that it spans problems of a range of difficulties and domains, ranging from trivial string manipulation problems, to classic programming puzzles (e.g., Tower of Hanoi), to interview/competitive-programming problems (e.g., dynamic programming), to longstanding open problems in algorithms and mathematics (e.g., factoring). We develop baseline enumerative program synthesis, GPT-3 and Codex solvers that are capable of solving puzzles -- even without access to any reference solutions -- by learning from their own past solutions. Codex performs best, solving up to 18% of 397 test problems with a single try and 80% of the problems with 1,000 tries per problem. In a small user study, we find a positive correlation between puzzle-solving performance and coding experience, and between the puzzle difficulty for humans and AI solvers. Therefore, further improvements on P3 could have a significant impact on many program synthesis areas.

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

↑