Can Language Models Solve Olympiad Programming?

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Shi, Quan, Tang, Michael, Narasimhan, Karthik, Yao, Shunyu
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866909172464877568
author Shi, Quan
Tang, Michael
Narasimhan, Karthik
Yao, Shunyu
author_facet Shi, Quan
Tang, Michael
Narasimhan, Karthik
Yao, Shunyu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2404_10952
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Can Language Models Solve Olympiad Programming?
Shi, Quan
Tang, Michael
Narasimhan, Karthik
Yao, Shunyu
Computation and Language
Artificial Intelligence
Programming Languages
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.
title Can Language Models Solve Olympiad Programming?
topic Computation and Language
Artificial Intelligence
Programming Languages
url https://arxiv.org/abs/2404.10952