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

CoCo-Bench: A Comprehensive Code Benchmark For Multi-task Large Language Model Evaluation

Wenjing Yin, Tianze Sun, Yijiong Yu, Jiawei Fang, Su Guangyao, Wang Jiancheng, Zekun Wang, Wei Wang, Ran Chen, Ziyun Dai, Shuai Yuan, Menghang Dong, Peng Luo, Dong Cao, Da Lei, Yajun Zhang, Hao Chen, Xiang Ma, Yong Liu, Weifeng Liu, Yuanjian Xu, Ji PeiarXiv 2025 · DOI

Abstract

Traditional code benchmarks for Large Language Models (LLMs), such as HumanEval and MBPP, focus almost exclusively on code generation from docstrings. However, real-world software engineering encompasses a much broader lifecycle, including understanding legacy code, modifying existing logic, and performing rigorous code reviews. We present CoCo-Bench, a comprehensive benchmark designed to evaluate LLMs across four key dimensions: Code Understanding (CU), Code Generation (CG), Code Modification (CM), and Code Review (CR). Our analysis reveals that a model's ability to generate code does not inherently translate to proficiency in editing or reviewing it, highlighting a critical "capability gap" in current AI coding assistants.

Introduction

The rapid advancement of LLMs has transformed software development, yet our methods for evaluating these models remain limited. Most existing benchmarks are "narrow-spectrum," testing only the ability to write standalone functions. This approach ignores the complexities of professional development, such as debugging and architectural analysis. Furthermore, the simplicity of these benchmarks often leads to "data contamination," where models may appear performant simply by memorizing training data.

To address these issues, we introduce CoCo-Bench. This framework serves as a "stress test" for LLMs, moving beyond simple generation to reflect the holistic needs of developers. By evaluating models on their ability to understand, modify, and review code, we provide a more accurate measure of their utility in a production environment.

The CoCo-Bench Framework

CoCo-Bench evaluates models across four distinct but interrelated tasks that mirror the software development lifecycle:

  1. Code Understanding (CU): Models must demonstrate "Forward Reasoning" (predicting output from input) and "Reverse Reasoning" (deducing input from a desired output).
  2. Code Generation (CG): This includes both function-level creation and sentence-level completion (filling in specific lines).
  3. Code Modification (CM): Models are tasked with detecting errors or updating code to accommodate new API changes or requirements.
  4. Code Review (CR): A multi-label classification task where models identify security vulnerabilities, performance bottlenecks, and logical errors.
The CoCo-Bench framework maps code tasks to real-world work scenarios and LLM capabilities.

Methodology and Dataset

The benchmark consists of 705 high-quality samples across four major programming languages: Python (54.6%), Java (20.4%), C++ (19.0%), and SQL (6.0%). Data was sourced from LeetCode and various open-source repositories to ensure practical relevance and "freshness."

To maintain a high level of difficulty, over 50% of the tasks are categorized as "Hard." For modification and review tasks, the authors employed a "bug implantation" process, creating realistic scenarios where models must identify and fix specific issues. The final "CoCo-Score" is calculated using the TrueSkill2 algorithm, which weights performance based on task difficulty.

Examples of the four core tasks in CoCo-Bench: Understanding, Generation, Modification, and Review.

Key Insights

Our evaluation of state-of-the-art models yielded several critical insights:

  • The Foundation of Understanding: We found a high correlation (0.94) between Code Understanding and Code Generation. This suggests that a model's ability to "mentalize" code execution is a prerequisite for writing it effectively.
  • The Modification Paradox: Conversely, there is a much lower correlation (0.36) between Code Generation and Code Modification. This indicates that being a "prolific writer" of code does not make a model a good "editor." Fixing existing code requires distinct latent capabilities.
  • The Complexity of Review: Code Review performance showed a low correlation with basic execution logic, implying that high-quality review requires specialized knowledge of security best practices and style guides.
  • Instruction Tuning: Instruction-tuned models significantly outperformed base models, demonstrating a superior ability to follow the complex, multi-step constraints inherent in modification and review tasks.

Results and Discussion

OpenAI’s o1-mini and GPT-4 currently lead the CoCo-Bench leaderboard. Among open-weight models, DeepSeek-Coder-V2-Instruct showed exceptional performance. However, even top-tier models struggle with "Reverse Reasoning" and "Code Review" tasks. For instance, while DeepSeek-Coder-33b-instruct performs well in generation (39.53), its score drops precipitously in reverse reasoning (10.74).

We also observed that "Structured" tasks (like Understanding) benefit from deterministic decoding settings, whereas "Creative" tasks (like Modification) benefit from higher diversity in decoding.

Conclusion and Future Work

CoCo-Bench provides a more nuanced "physical exam" for AI coding assistants. While current models excel at simple generation, significant gaps remain in their ability to handle the full software lifecycle. Future iterations of CoCo-Bench will expand to include a wider array of programming languages and introduce multimodal tasks, such as interpreting system architecture diagrams, to further challenge the next generation of LLMs.

Summary updated

BibTeX
@misc{yin2025coco,
  author = {Wenjing Yin and Tianze Sun and Yijiong Yu and Jiawei Fang and Su Guangyao and Wang Jiancheng and Zekun Wang and Wei Wang and Ran Chen and Ziyun Dai and Shuai Yuan and Menghang Dong and Peng Luo and Dong Cao and Da Lei and Yajun Zhang and Hao Chen and Xiang Ma and Yong Liu and Weifeng Liu and Yuanjian Xu and Ji Pei},
  title = {{CoCo-Bench: A Comprehensive Code Benchmark For Multi-task Large Language Model Evaluation}},
  year = {2025},
  eprint = {2504.20673},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.20673},
}
Figure