AixBench: A Code Generation Benchmark Dataset

Yiyang Hao, Ge Li, Yongqiang Liu, Xiaowei Miao, He Zong, Siyuan Jiang, Yang Liu, He WeiarXiv 2022 · DOI

Introduction

The rapid advancement of Large Language Models (LLMs) like OpenAI's Codex and GitHub Copilot has fundamentally changed the landscape of automated software development. Despite these breakthroughs, the methodologies used to evaluate these models have often lagged behind. Most existing benchmarks, such as HumanEval or APPS, are predominantly Python-centric and focus on "programming contest" style problems—algorithmic puzzles that rarely reflect the day-to-day tasks of a professional developer.

AixBench is introduced as a specialized benchmark designed to evaluate method-level code generation specifically for Java. By focusing on enterprise-relevant tasks and introducing more nuanced evaluation metrics, AixBench aims to provide a more realistic assessment of how AI tools perform in a production environment.

Methodology: Redefining Success with AvgPassRatio

A core contribution of AixBench is the introduction of the AvgPassRatio metric. Standard evaluation metrics like pass@k are binary: a generated code snippet is considered a success only if it passes 100% of the associated unit tests. However, the authors argue that this does not align with the reality of AI-assisted coding.

In a typical developer workflow, an AI is a "co-pilot." A generated function that passes 90% of test cases is still immensely valuable; a human developer can identify and fix the remaining edge cases much faster than writing the entire function from scratch. AvgPassRatio calculates the average percentage of test cases passed across all samples, rewarding models that get the "core logic" right even if they miss a minor detail.

The dataset itself was meticulously curated. Rather than simple scraping, the authors extracted "Method Comment - Method Implementation" pairs from high-quality open-source projects. These pairs were filtered based on strict criteria: the comments had to be descriptive of the objective (not the steps), and the functions had to be independent of complex project-specific business logic to ensure the benchmark tests pure coding ability.

Dataset Composition and Structure

AixBench is divided into two distinct subsets to facilitate both automated and human-centric evaluation:

  1. Automated Test Dataset (175 samples): This subset includes natural language descriptions in both English and Chinese, a precise function signature, and a suite of hand-crafted unit tests. It is designed to provide a rigorous measure of functional correctness.
  2. NL Task Description Dataset (161 samples): This set contains more ambiguous, "real-world" descriptions that are harder to verify automatically. These are intended for manual grading by experts across three dimensions: Correctness, Code Quality, and Maintainability.
Examples of task descriptions and function signatures in the AixBench dataset, showing both English and Chinese prompts.

Comparative Evaluation: aiXcoder XL vs. Copilot

The researchers used AixBench to conduct a head-to-head comparison between aiXcoder XL and GitHub Copilot. The results highlight the competitive nature of current state-of-the-art models.

Quantitative performance comparison between aiXcoder XL and GitHub Copilot on the automated test dataset.

As shown in the table above, aiXcoder XL demonstrated a slight advantage in the pass@1 metric, achieving 49.14% compared to Copilot's 46.29%. This suggests that aiXcoder XL is more likely to produce a perfectly correct solution on its first attempt. However, when evaluating based on AvgPassRatio, the two models were nearly identical, with Copilot slightly leading at 69.55%. This indicates that while Copilot might miss a perfect score more often, its "failed" attempts often contain a high percentage of correct logic.

Manual evaluation further confirmed this parity. Human graders rated both models similarly, with scores generally falling between 2.2 and 3.0 on a 5-point scale. These results suggest that while models are becoming proficient at generating functional code, they still struggle with the nuanced requirements and "anti-disturbance" challenges (such as grammatical errors in prompts) present in real-world task descriptions.

Conclusion and Future Directions

AixBench fills a critical gap in the code generation evaluation ecosystem by focusing on Java and practical, method-level tasks. By moving away from binary "pass/fail" metrics toward the more representative AvgPassRatio, it provides a clearer picture of an AI's utility to a human developer.

While the current dataset is high-quality, its relatively small size (336 total samples) and focus on a single language are areas for future expansion. The authors envision expanding AixBench to include more complex multi-method tasks and a wider variety of programming languages to keep pace with the rapidly evolving capabilities of LLMs.

Summary updated

BibTeX
@misc{hao2022aixbench,
  author = {Yiyang Hao and Ge Li and Yongqiang Liu and Xiaowei Miao and He Zong and Siyuan Jiang and Yang Liu and He Wei},
  title = {{AixBench: A Code Generation Benchmark Dataset}},
  year = {2022},
  eprint = {2206.13179},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.13179},
}
Figure