CodeMMLU: A Multi-Task Benchmark for Assessing Code Understanding & Reasoning Capabilities of CodeLLMs
Dung Nguyen Manh, Thang Phan Chau, Nam Le Hai, Thong T. Doan, Nam V. Nguyen, Quang Pham, Nghi D. Q. Bui
TL;DR
CodeMMLU introduces a large-scale MCQ benchmark to assess code understanding and reasoning in CodeLLMs, addressing limitations of generation-focused benchmarks. It consists of nearly 20,000 questions across 52 topics and 10+ programming languages, organized into knowledge-based tests and fundamental coding tasks. The study shows that despite strong performance on knowledge tests, many models struggle with execution and real-world coding tasks, and that prompting strategies like CoT can hurt performance. The results highlight a need for robust, bias-aware evaluation and provide guidance for building more reliable AI-assisted coding tools.
Abstract
Recent advances in Code Large Language Models (CodeLLMs) have primarily focused on open-ended code generation, often overlooking the crucial aspect of code understanding and reasoning. To bridge this gap, we introduce CodeMMLU, a comprehensive multiple-choice benchmark designed to evaluate the depth of software and code comprehension in LLMs. CodeMMLU includes nearly 20,000 questions spanning diverse domains, including code analysis, defect detection, and software engineering principles across multiple programming languages. Unlike traditional benchmarks that emphasize code generation, CodeMMLU assesses a model's ability to reason about programs across a wide-range of tasks such as code repair, execution reasoning, and fill-in-the-blank challenges. Our extensive evaluation reveals that even state-of-the-art models struggle with CodeMMLU, highlighting significant gaps in comprehension beyond generation. By emphasizing the essential connection between code understanding and effective AI-assisted development, CodeMMLU provides a critical resource for advancing more reliable and capable coding assistants.
