Introduction: The Challenge of Code Evaluation
Evaluating the proficiency of Large Language Models (LLMs) in programming is a complex endeavor. Traditional benchmarks like HumanEval or MBPP often fall short due to a narrow focus on Python and simple program synthesis. Furthermore, they frequently rely on surface-level text-similarity metrics like BLEU, which fail to capture functional correctness. A model might produce code that looks correct but contains fatal syntax errors, or conversely, it might generate an efficient, valid solution that differs significantly from the reference text.
To address these limitations, the authors introduce CodeScope, a comprehensive benchmark designed to provide a "reality check" for LLMs in practical software development scenarios. As shown in the comparison below, CodeScope is unique in its simultaneous support for execution-based metrics, multilingual support, and multidimensional task evaluation.
The CodeScope Framework
CodeScope evaluates models across 43 programming languages and eight diverse tasks, categorized into Code Understanding and Code Generation.
Multidimensional Evaluation
Unlike binary pass/fail systems, CodeScope employs a multidimensional approach to measure model robustness:
- Execution-Based: Using the MultiCodeEngine, an automated environment supporting 14 languages, the benchmark verifies functional correctness by running code against hidden test cases.
- Length & Difficulty: It analyzes how performance scales with code length and algorithmic complexity (from "Easy" to "Hard" competitive programming problems).
- Efficiency: For optimization tasks, it measures actual execution time and memory consumption.
Data Curation and Tasks
The benchmark leverages data from five independent sources to minimize bias. Key datasets include Codeforces4LLM for synthesis and repair, and Rosetta Code for multilingual summarization. The tasks span the software development lifecycle, including Code Summarization, Code Smell Detection, Code Review, Automated Testing, Program Synthesis, Code Translation, Code Repair, and Code Optimization.
Key Insights: The Generation-Understanding Gap
A significant finding from the study is the disconnect between code generation and understanding. While GPT-4 is the leader in generating code, it ranks lower in understanding tasks. Conversely, models like WizardCoder demonstrate superior performance in identifying code smells and summarizing logic but lag in generation.
Additionally, the "Python Bias" remains prevalent; models generally perform best in Python and struggle with low-level languages like C, where memory management and pointer operations introduce complexity. The study also confirms that text-matching metrics are weakly correlated with actual code functionality, underscoring the necessity of execution-based evaluation.
Experimental Results
The researchers evaluated eight mainstream LLMs, including GPT-4, PaLM 2, and CodeLLaMA. The results highlight specific strengths and weaknesses across different task categories.
- GPT-4 emerged as the overall champion with a score of 39.31, particularly excelling in Program Synthesis and Translation.
- WizardCoder proved to be an "Understanding Specialist," dominating the understanding dimension with a score of 50.14, as seen in the Code Smell and Summarization metrics.
- Automated Testing remains a major hurdle for all models; even GPT-4 struggled to generate test cases that accurately reflect data flow and execution outputs.
Conclusion and Future Directions
CodeScope reveals that even state-of-the-art models face significant challenges with "Hard" difficulty tasks and long-form code. Future work will focus on evaluating LLMs within complex, multi-file projects and exploring their potential as autonomous agents capable of iterative debugging. By moving beyond simple snippets, CodeScope sets a new standard for assessing the real-world utility of AI in software engineering.
Summary updated