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

OJBench: A Competition Level Code Benchmark For Large Language Models

Zhexu Wang, Yiping Liu, Yejie Wang, Wenyang He, Bofei Gao, Muxi Diao, Yanxu Chen, Kelin Fu, Flood Sung, Zhilin Yang, Tianyu Liu, Weiran Xu · DOI

Introduction

OJBench is a new, high-difficulty benchmark featuring 232 problems from elite programming competitions like the National Olympiad in Informatics (NOI) and the ICPC. The results show a stark reality: while current LLMs excel at "interview-level" coding, even state-of-the-art reasoning models like OpenAI’s o4-mini and Gemini 2.5 Pro struggle significantly with the complex algorithmic logic required at the competitive level.

The Challenge of Competitive Programming

As Large Language Models (LLMs) evolve, standard coding benchmarks are suffering from "ceiling effects." Popular benchmarks like HumanEval or LiveCodeBench primarily focus on interview-style questions and basic algorithms. Many top-tier models now achieve similar, high scores on these sets, making it difficult to distinguish between a "good" coder and a "world-class" algorithmic reasoner.

Furthermore, most existing benchmarks evaluate models solely on Python. In the world of competitive programming, C++ (CPP) is the gold standard due to its execution speed and memory efficiency. By ignoring CPP, researchers miss how models handle strict time-complexity constraints. OJBench addresses these gaps by providing a rigorous, multi-language, competition-level testbed.

Methodology

The researchers introduced a pipeline to curate and validate high-quality competition problems, involving automated crawling, unit test filtering, and manual checklist verification.

The OJBench data curation and evaluation pipeline.
  1. Curation & Filtering: They collected problems from NOI and ICPC, filtering out those with incomplete test cases or those requiring "special judges" (where multiple different outputs could be correct), ensuring a clean, automated evaluation.
  2. Difficulty Classification: Problems were categorized into Easy, Medium, and Hard based on actual human contestant success rates and official difficulty ratings.
  3. Dual-Language Evaluation: Unlike many predecessors, OJBench supports both Python and CPP, allowing researchers to see if models "think" differently or perform better in more performant languages.
  4. Iterative Refinement: The authors also experimented with "environmental feedback," where a model is given the error message from a failed execution (like a Compile Error or Time Limit Exceeded) and asked to fix its own code.

Dataset Composition

The primary contribution is OJBench, which consists of:

  • 232 problems in total.
  • 159 problems from NOI (China’s premier informatics olympiad).
  • 73 problems from ICPC (International Collegiate Programming Contest).
  • Comparison Benchmarks: The paper uses LiveCodeBench as a baseline to demonstrate that OJBench is significantly more challenging.

Key Insights

  • The Complexity Wall: There is a massive performance drop-off when moving from interview-level tasks to competition-level tasks. For example, o4-mini drops from a ~63% pass rate on LiveCodeBench to just ~33% on OJBench.
  • CPP is the "Reasoning" Language: For advanced reasoning models (like the OpenAI 'o' series), using CPP generally yields better results than Python. This aligns with human experience; competitive problems often have tight time limits that Python simply cannot meet, forcing the model to use a more efficient language.
  • The TLE Trap: Models are surprisingly good at fixing Compile Errors (CE) when given feedback. However, they are terrible at fixing Time Limit Exceeded (TLE) errors. Fixing a TLE error requires a fundamental rethink of the algorithm's efficiency (e.g., moving from $O(n^2)$ to $O(n \log n)$), a level of deep architectural reasoning that current LLMs still lack.
  • Reasoning Models are in a Different League: "Reasoning-oriented" models (trained with long Chain-of-Thought or Reinforcement Learning, like DeepSeek-R1 or o1) vastly outperform standard "Coder" models, which often score 0% on the Hardest problems.

Results and Evaluation

The researchers evaluated 37 different models. Figure 3 highlights the performance disparity between C++ and Python across the top models, showing that reasoning-oriented models often achieve higher success rates in C++.

Performance comparison (Pass@8) between C++ and Python across evaluated models.
  • Top Performers: Gemini-2.5-pro-exp-03-25 took the lead with a 38.91% Pass@1 (Python), followed closely by o4-mini at 33.30%.
  • Open Source vs. Closed Source: Closed-source models still generally lead, but open-source reasoning models like DeepSeek-R1 (26.02%) and Qwen3-235B (25.97%) are narrowing the gap significantly.
  • Hard Difficulty: On the "Hard" subset of problems, performance is sobering. Most models fail completely; even the top-performing Gemini model only achieved a 9.48% pass rate.

Conclusion

The authors acknowledge limitations in coverage (focused on NOI and ICPC) and task diversity (classic algorithms only). Future work will involve expanding the problem set and investigating how to help models overcome the "algorithmic bottleneck" evidenced by their struggle with Time Limit Exceeded errors. OJBench serves as a vital new yardstick for measuring the true reasoning capabilities of the next generation of AI coders.

Summary updated

BibTeX
@misc{wang2025ojbench,
  author = {Zhexu Wang and Yiping Liu and Yejie Wang and Wenyang He and Bofei Gao and Muxi Diao and Yanxu Chen and Kelin Fu and Flood Sung and Zhilin Yang and Tianyu Liu and Weiran Xu},
  title = {{OJBench: A Competition Level Code Benchmark For Large Language Models}},
  year = {2025},
  eprint = {2506.16395},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.16395},
}
Figure