Abstract
Code generation is a core capability of large language models (LLMs), yet mainstream benchmarks (e.g., APPs and LiveCodeBench) contain questions with medium-level difficulty and pose no challenge to advanced LLMs. To better reflected the advanced reasoning and code generation ability, We introduce Humanity’s Last Code Exam (HLCE), comprising 235 most challenging problems from the International Collegiate Programming Contest (ICPC World Finals) and the International Olympiad in Informatics (IOI) spanning 2010 – 2024. As part of HLCE, we design a harmonized online–offline sandbox that guarantees fully reproducible evaluation. Through our comprehensive evaluation, we observe that even the strongest reasoning LLMs: o4-mini(high) and Gemini-2.5 Pro, achieve pass@1 rates of only 15.9% and 11.4%, respectively. Meanwhile, we propose a novel “self-recognition” task to measure LLMs’ awareness of their own capabilities. Results indicate that LLMs’ self-recognition abilities are not proportionally correlated with their code generation performance. Finally, our empirical validation of test-time scaling laws reveals that current advanced LLMs have substantial room for improvement on complex programming tasks. We expect HLCE to become a milestone challenge for code generation and to catalyze advances in high-performance reasoning and human–AI collaborative programming.
Introduction
Current code generation benchmarks are reaching a point of saturation. Popular datasets like HumanEval and MBPP, which once served as rigorous tests for AI, are now being solved with near-perfect accuracy. This trend creates a misleading narrative that LLMs have mastered programming, whereas they have primarily mastered introductory-level tasks.
The researchers identify three critical gaps in current evaluation frameworks:
- Limited Difficulty: Existing benchmarks lack the deep, multi-step algorithmic reasoning required for top-tier human competitions.
- Lack of Interactive Evaluation: High-level competitions like the IOI require code to interact with a real-time "judge," a dynamic setting ignored by static I/O benchmarks.
- Underexplored Scaling Laws: The impact of test-time compute on exceptionally difficult problems remains poorly understood.
Methodology and Dataset Construction
To address these gaps, we introduce Humanity’s Last Code Exam (HLCE), a benchmark consisting of 235 problems from the ICPC World Finals (146 problems) and the IOI (89 problems) spanning 2010–2024.
The HLCE framework introduces two distinct tasks:
- Code Generation: Standard generation based on complex problem statements.
- Self-Recognition: A novel task where the LLM acts as a "code reviewer," determining if a given solution (correct or incorrect) will pass all test cases. This measures the model's metacognitive ability.
The evaluation uses a "harmonized online-offline sandbox." ICPC problems are evaluated via standard I/O, while IOI problems utilize an automated bot interfacing with the official Codeforces judging system to handle interactive requirements.
Key Insights and Results
The evaluation reveals a massive "difficulty cliff" between standard benchmarks and HLCE. While top models like Gemini-2.5-Pro and o4-mini achieve 98-99% on HumanEval, their performance drops to 11.4% and 15.9%, respectively, on HLCE.
The Socratic Paradox
A surprising finding was the lack of correlation between a model's ability to write code and its ability to recognize correct code. For instance, chatgpt-4o-latest demonstrated superior self-recognition (AUC of 0.84) despite mediocre generation performance. Conversely, the strongest generators were often poor judges of their own work.
Reasoning and Scaling
"Reasoning-enhanced" models (e.g., o1, o4-mini, Gemini 2.5 Pro) significantly outperformed non-reasoning counterparts by factors of 4x to 5x. Furthermore, test-time scaling—providing more "thinking time"—continues to improve performance even on these extreme tasks, suggesting that we have not yet reached the ceiling of model potential.
Conclusion
HLCE establishes a new frontier for code generation, shifting the focus from simple completion to human-competitive algorithmic reasoning. While current LLMs can reach "medal-level" performance in some ICPC years, they still struggle with the interactive complexity of the IOI. This benchmark serves as a catalyst for future advances in high-performance reasoning and human-AI collaboration.
Summary updated