PreprintCited by 3Topic ModelingTeaching and Learning ProgrammingSoftware Engineering Research

Can Language Models Solve Olympiad Programming?

Open access
Shi, Quan, Tang, Michael, Narasimhan, Karthik, Yao, Shunyu·2024·arXiv

Abstract

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.

Integrity signals

Registry

DataCite · 10.48550/arxiv.2404.10952

Cites

Statistics

Recomputing p-values needs the paper’s full text.

Claims the paper makes

We couldn’t retrieve this paper’s full text, so its claims and self-check weren’t run. The registry and citation checks still apply.

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • The USACO benchmark evaluates AI agents on competitive programming problems from the USA Computing Olympiad.

    “The USACO benchmark evaluates AI agents on competitive programming problems from the USA Computing Olympiad.”

    From Holistic Agent Leaderboard: The Missing Infrastructure for AI Agent Evaluation (2025) · cites this paper as Shi et al. (2024)

  • USACO tasks range from Bronze (easiest) to Platinum (hardest) and require knowledge of data structures and algorithms.

    “Tasks range from Bronze (easiest) to Platinum (hardest) and require knowledge of data structures and algorithms.”

    From Holistic Agent Leaderboard: The Missing Infrastructure for AI Agent Evaluation (2025) · cites this paper as Shi et al. (2024)

  • The USACO benchmark consists of 307 problems, complete with exhaustive test cases, problem analyses, and difficulty labels.

    “It consists of 307 problems, complete with exhaustive test cases, problem analyses, and difficulty labels.”

    From Holistic Agent Leaderboard: The Missing Infrastructure for AI Agent Evaluation (2025) · cites this paper as Shi et al. (2024)

  • Human feedback might greatly increase accuracy.

    “Human feedback might greatly increase accuracy.”

    From AI Agents That Matter (2024) · cites this paper as [43]

  • Shi et al. find that simple feedback increases the performance of GPT-4 from 0% to over 86% on challenging programming problems.

    “For example, Shi et al. [43] find that simple feedback increases the performance of GPT-4 from 0% to over 86% on challenging programming problems-from entirely useless to almost perfect.”

    From AI Agents That Matter (2024) · cites this paper as [43]

No citation lists for this paper

No citation lists for this paper yet — checked again daily.

Cited by 3

Authors
Shi, Q., Tang, M., Narasimhan, K., & Yao, S.
Affiliations
Princeton University (US)
Venue
arXiv
Publisher
arXiv
Published
2024
ISSN
2331-8422 (ISSN-L)
OpenAlex
W4394947078
Cited by
3
References
0
Citations by year
2026: 2 · 2025: 1
Type
posted content
Language
en
Open access
Locations
  • arXiv (Cornell University) (submittedVersion, cc-by)
  • arXiv (Cornell University) (cc-by)
Topics
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
Keywords
language models, competitive programming, algorithmic reasoning, chain-of-thought prompting, self-reflection, retrieval-augmented generation, human-in-the-loop, GPT-4, benchmark, code generation

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review