语言模型能否解决奥林匹克编程问题?
Can Language Models Solve Olympiad Programming?
AI总结:
该研究提出包含307道题的USACO竞技编程基准,测试发现GPT-4零样本思维链准确率仅8.7%,结合自我反思与情景知识检索的方法可提升至20.2%,少量针对性提示能大幅提升其解题能力,为语言模型算法推理研究提供了基础。
摘要:
信息学奥林匹克竞赛包含了一些对人类而言最具挑战性的问题,除了需要生成高效代码外,还要求复杂的算法推理和解谜能力。然而,该领域作为语言模型(LM)评估方向的研究仍显不足。本文提出了USACO基准,包含来自美国信息学奥林匹克竞赛的307道题目,每道题均配有高质量单元测试、参考代码和官方题解。这些资源让我们首次能够构建并测试一系列面向竞技编程的语言模型推理方法。研究发现,GPT-4在零样本思维链提示下的pass@1准确率仅为8.7%,而我们提出的最优推理方法结合了自我反思和情景知识检索,将该准确率提升至20.2%,但这距离解决该基准仍有很大差距。为了更好地理解剩余的挑战,我们设计了一项新颖的人机协同研究,意外发现少量针对性提示就能让GPT-4解决15道此前任何模型和方法都无法解决的题目中的13道。我们的基准、基线方法、量化结果和定性分析为迈向具备扎实、创造性算法推理能力的语言模型迈出了初步一步。
英文摘要:
Computing olympiads contain some of the most challenging problems for humans, requiring complex algorithmic reasoning, puzzle solving, in addition to generating efficient code. However, it has been understudied as a domain to evaluate language models (LMs). In this paper, we introduce the USACO benchmark with 307 problems from the USA Computing Olympiad, along with high-quality unit tests, reference code, and official analyses for each problem. These resources enable us to construct and test a range of LM inference methods for competitive programming for the first time. We find GPT-4 only achieves a 8.7% pass@1 accuracy with zero-shot chain-of-thought prompting, and our best inference method improves it to 20.2% using a combination of self-reflection and retrieval over episodic knowledge. However, this is far from solving the benchmark. To better understand the remaining challenges, we design a novel human-in-the-loop study and surprisingly find that a small number of targeted hints enable GPT-4 to solve 13 out of 15 problems previously unsolvable by any model and method. Our benchmark, baseline methods, quantitative results, and qualitative analysis serve as an initial step toward LMs with grounded, creative, and algorithmic reasoning.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。