OJBench
收藏资源简介:
OJBench是一个全面且具有挑战性的基准数据集,专门设计用于评估大型语言模型在竞赛级别的代码推理能力。我们的数据集专注于人类编程竞赛,包含232个严格筛选的竞赛问题,源自中国国家信息学奥林匹克竞赛(NOI)和国际大学生程序设计竞赛(ICPC)。这些问题被精心分为三个难度等级(简单、中等和困难),基于参赛者投票和实际提交统计数据,并支持Python和C++的双语评估。
OJBench is a comprehensive and challenging benchmark dataset specifically designed to evaluate the competitive code reasoning capabilities of large language models. Our dataset focuses on human programming competitions and includes 232 rigorously selected contest problems, sourced from the National Olympiad in Informatics of China (NOI) and the International Collegiate Programming Contest (ICPC). These problems are meticulously categorized into three difficulty levels (easy, medium, and hard), based on participant voting and actual submission statistics, and supports bilingual evaluation in both Python and C++.
OJBench数据集概述
📘 数据集简介
- 名称:OJBench
- 目的:评估大型语言模型(LLMs)在竞赛级别的代码推理能力
- 来源:中国全国青少年信息学奥林匹克竞赛(NOI)和国际大学生程序设计竞赛(ICPC)
- 规模:包含232个经过严格筛选的竞赛题目
- 难度分级:Easy/Medium/Hard三个等级(基于参赛者投票和实际提交数据)
- 语言支持:Python和C++双语评估
🔥 最新动态
- 2025-7:开源评估代码并持续改进
- 2025-6:发布OJBench数据集和相关论文
📊 关键发现
- 先进模型表现:即使是o4-mini和Gemini-2.5-pro-exp等先进推理模型也难以应对高难度竞赛题
- 模型类型差异:推理导向模型显著优于非推理导向模型
- 开源闭源差距:开源模型在代码推理能力上仍落后于闭源模型
- 语言性能差异:多数长链思维模型使用C++表现优于Python
- 反馈利用:模型能够利用代码执行环境的反馈改进错误解决方案
🧰 系统要求
- C++17兼容编译器(g++ 7.0或更高版本)
- PyPy3解释器
💾 安装步骤
-
安装DMOJ: bash git clone https://github.com/DMOJ/judge-server.git cd judge-server git checkout f098cd3a49a60186d1fadde5132329ec5f4f2213 pip install .
-
克隆配置OJBench: bash git clone git@github.com:He-Ren/OJBench.git
- 修改runtime.yaml中的工具路径
-
下载测试数据: bash git clone https://huggingface.co/He-Ren/OJBench_testdata
📚 API功能
-
初始化函数:
init(problem_dirs, config_path=..., runtime_path=..., compile_lock_path=...)- 设置评判环境
- 必需参数:问题目录路径
-
评判函数:
judge_jsonl(input_path, output_path=None, num_workers=16, worker_log_path=None, identifier=None)judge_jsonl_data(input, num_workers=16, worker_log_path=None, identifier=None)- 输出包含:最终裁决、测试用例详细结果、部分测试裁决等
💬 引用格式
bibtex @misc{wang2025ojbenchcompetitionlevelcode, title={OJBench: A Competition Level Code Benchmark For Large Language Models}, 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}, year={2025}, eprint={2506.16395}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2506.16395}, }



