CodeElo: Benchmarking Competition-level Code Generation of LLMs with Human-comparable Elo Ratings

Shanghaoran Quan, Jiaxi Yang, Bowen Yu, Bo Zheng, Dayiheng Liu, An Yang, Xuancheng Ren, Bofei Gao, Yibo Miao, Yunlong Feng, Zekun Wang, Jian Yang, Zeyu Cui, Yang Fan, Yichang Zhang, Binyuan Hui, Junyang LinarXiv 2025 · DOI

TL;DR

This paper introduces CodeElo, a novel benchmark for evaluating Large Language Models (LLMs) on competitive programming tasks. By leveraging the official CodeForces platform for judging and a human-comparable Elo rating system, CodeElo offers a more realistic and challenging assessment of LLMs' code generation and reasoning abilities than existing benchmarks.

What Problem Does This Paper Address?

As LLMs become increasingly adept at code generation, there's a growing need for robust benchmarks that can truly test their sophisticated reasoning skills in competitive programming scenarios. Existing benchmarks often fall short because they:

  • Lack private test cases: This leads to models potentially overfitting to publicly available solutions.
  • Don't support "special judges": Some competitive programming problems require custom logic to verify correctness, which many benchmarks can't handle.
  • Have misaligned execution environments: Running tests on local machines can lead to inconsistencies in performance evaluation, especially concerning execution time, a critical factor in competitive programming.
  • Don't provide human-comparable metrics: It's hard to gauge an LLM's progress against human performance without a standardized, relatable metric.

CodeElo aims to bridge these gaps by creating a benchmark that mimics the real competitive programming experience as closely as possible.

Methods

The core of CodeElo lies in its innovative evaluation methodology:

  • Direct Submission to CodeForces: Instead of relying on scraped test cases or local execution, CodeElo automatically submits LLM-generated solutions directly to the CodeForces platform. This ensures that solutions are judged against the platform's official test cases and special judges, guaranteeing zero false positives and accurate execution environment alignment.
  • Human-Comparable Elo Ratings: The benchmark employs an Elo rating system, similar to that used in competitive programming for human players. This system provides a standardized score that reflects a model's performance relative to human participants, offering a more intuitive understanding of their capabilities. The authors developed a system that aligns with CodeForces' Elo but with reduced variance.
  • Comprehensive Problem Set: CodeElo utilizes a curated set of recent CodeForces problems, categorized by contest division, problem difficulty rating, and algorithm tags. This allows for detailed analysis of LLM performance across various problem types and difficulty levels.

Datasets

The primary dataset used in this paper is derived from the CodeForces platform. The authors compiled problems from the platform's rated contests, focusing on recent ones to avoid data contamination. This dataset is then structured and categorized by:

  • Contest Difficulty Division: Div. 1, Div. 2, Div. 3, Div. 4, and combined divisions.
  • Problem Difficulty Rating: A numerical rating indicating the problem's difficulty.
  • Problem Algorithm Tags: Labels identifying the algorithms or techniques required to solve a problem (e.g., DP, greedy, data structures).

CodeElo itself is presented as a new benchmark, distinct from existing ones like LiveCodeBench and USACO due to its unique evaluation methodology.

Key Insights and Ideas

  • The power of direct platform evaluation: Submitting directly to CodeForces is crucial for accurate evaluation, especially for problems with special judges or strict time limits. This bypasses the limitations of offline testing and scraped datasets.
  • Elo ratings offer a better perspective: The Elo system provides a more nuanced understanding of LLM performance than simple pass@n metrics, accounting for multiple attempts and penalizing failed ones. It also encourages models to tackle harder problems.
  • C++ reigns supreme for competitive coding: Despite LLMs often defaulting to Python, they perform significantly better when prompted to use C++ for competitive programming tasks, aligning with human preferences and the need for runtime efficiency.
  • LLMs still struggle with complex algorithms: While models excel at math and implementation problems, they show significant weaknesses in areas like dynamic programming (DP) and graph traversal (DFS).

Key Results

The paper evaluated 30 open-source and 3 proprietary LLMs. The standout performers were:

  • o1-mini: Achieved the highest Elo rating of 1578, placing it in the top 10% of human participants.
  • QwQ-32B-Preview: Showed strong performance with an Elo rating of 1261, ranking in the 60th percentile among humans.

In contrast, most other models struggled, falling into the lowest 20th percentile of human participants, even on easier problems. The study also revealed that larger models generally outperformed smaller ones, and models achieved better performance when using C++ compared to Python.

Limitations and Future Work

The authors acknowledge two main limitations:

  • Limited Submissions: Allowing only eight submissions per problem, while balancing fairness and platform access, might lead to slightly lower Elo ratings than actual capabilities if models could make more attempts.
  • Platform Dependency: The reliance on the CodeForces platform for judging is necessary but means the benchmark cannot be run entirely offline.

Future work could involve expanding the dataset to reduce rating variance, further exploring the performance differences across various algorithms and programming languages, and potentially developing methods to overcome the platform dependency for offline evaluation. The authors also emphasize the need for ethical considerations and seek permission from CodeForces before open-sourcing the full evaluation scaffold.

Summary updated

BibTeX
@misc{quan2025codeelo,
  author = {Shanghaoran Quan and Jiaxi Yang and Bowen Yu and Bo Zheng and Dayiheng Liu and An Yang and Xuancheng Ren and Bofei Gao and Yibo Miao and Yunlong Feng and Zekun Wang and Jian Yang and Zeyu Cui and Yang Fan and Yichang Zhang and Binyuan Hui and Junyang Lin},
  title = {{CodeElo: Benchmarking Competition-level Code Generation of LLMs with Human-comparable Elo Ratings}},
  year = {2025},
  eprint = {2501.01257},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.01257},
}
Figure