NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AutoCode: LLMs as Problem Setters for Competitive Programming

Shang Zhou, Zihan Zheng, Kaiyuan Liu, Zeyu Shen, Zerui Cheng, Zexing Chen, Hansen He, Jianzhu Yao, Huanzhi Mao, Qiuyang Mang, Tianfu Fu, Beichen Li, Dongruixuan Li, Wenhao Chai, Zhuang Liu, Aleksandra Korolova, Peter Henderson, Natasha Jaques, Pramod Viswanath, Saining Xie, Jingbo Shang

TL;DR

AutoCode is a novel framework that elevates Large Language Models (LLMs) from merely solving competitive programming tasks to actively designing them. By employing a multi-role validation loop, the system generates robust test suites with up to 98.7% consistency to official judgments. Furthermore, it creates novel, contest-grade problems that even human Grandmasters recognize as top-tier.

The Challenge of Problem Setting

In competitive programming (CP), solving a problem is difficult, but setting one is arguably harder. A skilled problem setter must design constraints that prevent "cheating" (e.g., ensuring a simple greedy algorithm cannot pass a complex dynamic programming task), provide exhaustive test cases for edge cases, and perfectly calibrate the difficulty.

Current LLM benchmarks for coding often suffer from weak test suites. This leads to high False Positive Rates (FPR)—where incorrect code passes—and False Negative Rates (FNR)—where valid code fails due to malformed test data. This distorted evaluation landscape makes it difficult to use these benchmarks for training advanced models via Reinforcement Learning (RL). If an LLM can reliably set a high-quality problem, it demonstrates a much deeper algorithmic understanding than simply solving one.

Methods: The AutoCode Framework

To tackle this, the authors introduce AutoCode, a closed-loop, multi-role framework that mirrors the workflow of human experts.

AutoCode Framework Workflow
  1. Validator-Generator-Checker Loop:
  2. Validator: Ensures inputs strictly adhere to problem constraints.
  3. Generator: Employs three strategies: exhaustive small-case coverage, randomized/extreme data (to catch overflows or precision errors), and "TLE-inducing" data (specifically designed to make slow algorithms time out).
  4. Checker: Compares contestant output against a reference solution.
  5. Dual-Verification Protocol: To generate new problems, AutoCode starts with a "seed" problem and modifies it. To ensure the new problem is valid without human intervention, it generates both an efficient reference solution (std.cpp) and a slow-but-reliable brute-force solution (brute.cpp). The problem is only accepted if both solutions produce identical results across all test cases.
  6. Mutant-based Discrimination: For complex "interactive" problems, AutoCode creates "mutant" versions of the solution (introducing subtle bugs) to verify that the Interactor program can successfully distinguish between correct and flawed logic.

Key Insights

  • The "Self-Solving" Paradox: LLMs can generate solvable, logically sound problems that they themselves cannot solve (occurring about 4.2% of the time). This suggests that problem-setting capabilities can outpace problem-solving capabilities, providing a potential path for model self-improvement.
  • Recombinational vs. Conceptual Novelty: LLMs tend to innovate by "recombination"—mixing and matching known algorithmic tricks (e.g., embedding a segment tree inside a graph problem). They still struggle to invent entirely new reasoning paradigms.
  • Difficulty as a Quality Proxy: There is almost zero correlation between an LLM's self-evaluation of a problem's elegance and a human expert's evaluation. However, an LLM's ability to estimate "difficulty gain" (how much harder the new problem is than the seed) is a reliable signal for identifying high-quality problems.

Key Results

AutoCode was evaluated on massive datasets, including a 7,538-problem benchmark and a newly curated 720-problem Codeforces set.

  • State-of-the-Art Consistency: AutoCode achieved 91.1% consistency with official judgments on the large-scale benchmark, far surpassing the previous state-of-the-art (HardTests at 81%). On the recent Codeforces benchmark, it reached an impressive 98.7% consistency.
  • Error Reduction: It reduced the False Positive Rate to just 3.7% (compared to ~12% for baselines) and significantly lowered the False Negative Rate.
  • Human-Verified Quality: Human Grandmasters (the top 0.3% of programmers) evaluated the generated problems.
Problem Quality Filtering Funnel

As shown in the filtering funnel, over 61% of the generated problems were deemed high enough quality to serve as training data for other LLMs, and 3.2% were judged to be of "ICPC/IOI-level"—the highest tier of international competition.

Limitations and Future Work

Because LLMs cannot yet reliably judge abstract concepts like "elegance" or "novelty," human experts are still required for the final filtering of elite problems. Additionally, the most capable models remain closed-source, limiting the ability to integrate AutoCode into a tight, automated RL loop. Future work will focus on prompting strategies that encourage true "conceptual leaps" rather than just clever combinations of existing algorithms.

Summary updated

BibTeX
@inproceedings{zhou2026autocode,
  author = {Shang Zhou and Zihan Zheng and Kaiyuan Liu and Zeyu Shen and Zerui Cheng and Zexing Chen and Hansen He and Jianzhu Yao and Huanzhi Mao and Qiuyang Mang and Tianfu Fu and Beichen Li and Dongruixuan Li and Wenhao Chai and Zhuang Liu and Aleksandra Korolova and Peter Henderson and Natasha Jaques and Pramod Viswanath and Saining Xie and Jingbo Shang},
  title = {{AutoCode: LLMs as Problem Setters for Competitive Programming}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=F96nsbbhXC},
}
Figure