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

Idea First, Code Later: Disentangling Problem Solving from Code Generation in Evaluating LLMs for Competitive Programming

Sama Hadhoud, Alaa Elsetohy, Frederikus Hudi, Jan Christian Blaise Cruz, Steven Halim, Alham Fikri Aji

TL;DR

Standard benchmarks for competitive programming evaluate Large Language Models (LLMs) on a purely end-to-end basis (problem statement to code), conflating high-level algorithmic reasoning with low-level implementation. This paper introduces an editorial-centric evaluation pipeline that decouples these two skills, revealing that while expert-written plans significantly boost LLM performance, models face severe bottlenecks in both designing correct algorithms and translating those designs into bug-free code.

What Problem Does This Paper Address?

When an LLM fails to solve a complex competitive programming (CP) problem, why does it fail? Did it misunderstand the problem, design an incorrect or inefficient algorithm, or simply make a syntax error while coding?

Current evaluation protocols cannot answer this question because they treat competitive programming as a single problem-to-code mapping. This end-to-end approach conflates problem solving (devising the algorithmic plan) with implementation (coding the plan). To address this gap, the authors propose using natural-language "editorials"—the step-by-step explanations human programmers use to describe solutions—as an explicit intermediate artifact to isolate and evaluate these two distinct capabilities.

Methods

The authors introduce an editorial-centric evaluation pipeline consisting of three distinct settings:

  1. w/oEd (Baseline): The standard direct problem-to-code generation.
  2. w/GenEd: A two-stage process where the model first generates its own natural-language editorial and then writes code conditioned on that editorial.
  3. w/GoldEd: The model is given an expert-written "gold" editorial and is tasked solely with implementing it into code.
Overview of the evaluation pipeline and annotation rubric

To scale the evaluation of model-generated editorials, they validate an LLM-as-a-judge protocol using Gemini 3 Pro, which evaluates the generated text across problem understanding, algorithmic paradigm tags, and algorithmic correctness. They also explore cross-model editorial transfer, testing whether an editorial written by a strong reasoning model (a "writer") can successfully guide a different model (a "coder").

Datasets

The authors curated a new dataset of 83 ICPC-style problems spanning seven contests from 2017 to 2025. To minimize data contamination risks, the problems were sourced from regional ICPC contests and internal National University of Singapore (NUS) course examinations that are not hosted on major public online judges. Each problem package includes the original problem statement, an expert-written gold editorial, and the full official test suite.

Key Insights and Ideas

  • The Implementation Bottleneck is Real: Even when provided with a flawless, expert-written algorithmic plan (w/GoldEd), models still fail frequently. Devising the idea is only half the battle; translating abstract logic into optimal code remains a massive hurdle for LLMs.
  • The Problem-Solving Bottleneck: The massive performance gap between w/GenEd and w/GoldEd highlights that models struggle heavily to independently discover correct and complete algorithms, particularly as problem difficulty increases.
  • Reasoning and Coding Can Be Modularized: The cross-model transfer experiments showed that editorials function as an effective, model-agnostic interface. Pairing a strong "writer" model (like DeepSeek-R1) with a competent "coder" model often yields better results than running a single model end-to-end.
  • Correctness $\neq$ Clarity: Interestingly, qualitative analysis revealed that model-generated editorials are often significantly longer and more explicit than human gold editorials. While human experts rely on shared jargon and assume familiarity with standard abstractions, LLMs explicitly spell out every step, occasionally making their correct editorials easier to follow than the gold standard.

Key Results

The authors evaluated 19 contemporary LLMs, observing a clear asymmetry between self-generated and gold editorials:

  • Gold Editorials Provide Massive Boosts: Across all 19 models, providing a gold editorial (w/GoldEd) improved the average pass@1 rate from 23.2% to 37.7%. Frontier models saw the highest jumps; for instance, GPT-5's pass@1 rate climbed from 67.5% to 83.1%.
  • Self-Generated Editorials are Hit-or-Miss: Writing an editorial first (w/GenEd) only provided modest or model-dependent gains (the overall average pass@1 actually slightly decreased to 23.1%). However, strong reasoning models like DeepSeek-R1 benefited significantly, jumping from 28.9% to 45.8%.
  • Human Competitiveness: When evaluated as virtual teams on official contest scoreboards, very few models achieved high human-relative rankings without gold guidance.
Mean virtual rank percentiles across different settings
  • Failure Modes: Wrong Answers (WA) dominated the failure types across all settings, though Time Limit Exceeded (TLE) verdicts became more prominent for stronger models like Claude, indicating that they often find a correct but suboptimal algorithm.
Distribution of failure types across models

Limitations and Future Work

The study is bounded by a relatively small dataset (83 problems) and focuses primarily on C++, the dominant language in ICPC contests. Additionally, all evaluations were conducted using a single-shot deterministic setup without test-time sampling, majority voting, or multi-turn feedback loops.

The authors suggest that future competitive programming benchmarks should move away from simple pass/fail code metrics and adopt multi-stage evaluation frameworks that explicitly separate and score algorithmic planning from code generation.

Summary updated

BibTeX
@inproceedings{hadhoud2026idea,
  author = {Sama Hadhoud and Alaa Elsetohy and Frederikus Hudi and Jan Christian Blaise Cruz and Steven Halim and Alham Fikri Aji},
  title = {{Idea First, Code Later: Disentangling Problem Solving from Code Generation in Evaluating LLMs for Competitive Programming}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.1778},
}
Figure