humaneval-x-eval
CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X — Zheng et al. (2023) (arXiv:2303.17568, 2023)
What this evaluates
Evaluates multilingual code generation and code translation capabilities across five programming languages (C++, Java, JavaScript, Go, Python). It measures functional correctness by executing generated code against a suite of test cases for each problem.
Datasets
- HumanEval-X — total 820; splits: test (820)
Metrics
pass@k (primary) — range: [0, 1]
- Estimates the probability that at least one of k samples passes all test cases out of n total generations: pass@k = E[1 - C(n-c, k) / C(n, k)], where c is the number of samples passing all tests, n=200, and k∈{1, 10, 100}. Averaged over all problems.
Input / output format
Input: For code generation: function declaration and docstring. For code translation: function declaration in the target language and canonical solution in the source language.
Output: Generated function implementation in the target language.
Scoring recipe
def compute_pass_at_k(generations, test_cases, k=10, n=200):
passed = [1 if run_tests(gen, test_cases) else 0 for gen in generations]
c = sum(passed)
if n < k or c == n: return 1.0
return 1.0 - comb(n - c, k) / comb(n, k)
# Average single-problem pass@k over all problems in the dataset
Common pitfalls
- Using string similarity metrics like BLEU or CodeBLEU instead of functional correctness via test execution.
- Ignoring language-specific behaviors in test cases (e.g., rounding rules, string prefixes) which can cause false negatives if not handled per language.
- Failing to account for budget allocation when evaluating multilingual models across multiple languages simultaneously.
Evidence (verbatim from paper)
Metric. For both tasks, we use test cases to evaluate the exact functional correctness of the generated code, measuring the performance with pass@$k$ (Kulal et al., 2019), making it real-world useful and also completely different from the string similarity metrics like BLEU(Papineni et al., 2002), and CodeBLEU(Ren et al., 2020; Lu et al., 2021; Zhu et al., 2022). Specifically, we use the unbiased method to estimate pass@$k$ (Chen et al., 2021): pass@k:=E[1-(n-c k)/(n k)],n=200,k∈{1,10,100} where n is the total number of generation (n=200 in this work), k is the sampling budget (typically k∈{1, 10, 100}) and c is the number of samples that pass all test cases.
Citation
@misc{zheng2023codegeex,
title={CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X},
author={Zheng et al. (2023)},
year={2023},
note={arXiv:2303.17568}
}
1---2name: humaneval-x-eval3description: Evaluates multilingual code generation and code translation capabilities across five programming languages (C++, Java, JavaScript, Go, Python). It measures functional correctness by executing generated code against a suite of test cases for each problem. Use when the user wants to benchmark on HumanEval-X, or asks about evaluating this task. Reports pass@k.4metadata:5 source: https://skillmd.com/skills/qhjqhj00/humaneval-x-eval6 skill_kind: dataset_eval7 source_arxiv: 2303.175688 bibtex_key: zheng2023codegeex9 confidence: high10---1112# humaneval-x-eval1314> CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X — Zheng et al. (2023) (arXiv:2303.17568, 2023)1516## What this evaluates1718Evaluates multilingual code generation and code translation capabilities across five programming languages (C++, Java, JavaScript, Go, Python). It measures functional correctness by executing generated code against a suite of test cases for each problem.1920## Datasets2122- **HumanEval-X** — total 820; splits: test (820)2324## Metrics2526- `pass@k` **(primary)** — range: [0, 1]27 - Estimates the probability that at least one of k samples passes all test cases out of n total generations: pass@k = E[1 - C(n-c, k) / C(n, k)], where c is the number of samples passing all tests, n=200, and k∈{1, 10, 100}. Averaged over all problems.2829## Input / output format3031**Input**: For code generation: function declaration and docstring. For code translation: function declaration in the target language and canonical solution in the source language.3233**Output**: Generated function implementation in the target language.3435## Scoring recipe3637```python38def compute_pass_at_k(generations, test_cases, k=10, n=200):39 passed = [1 if run_tests(gen, test_cases) else 0 for gen in generations]40 c = sum(passed)41 if n < k or c == n: return 1.042 return 1.0 - comb(n - c, k) / comb(n, k)4344# Average single-problem pass@k over all problems in the dataset45```4647## Common pitfalls4849- Using string similarity metrics like BLEU or CodeBLEU instead of functional correctness via test execution.50- Ignoring language-specific behaviors in test cases (e.g., rounding rules, string prefixes) which can cause false negatives if not handled per language.51- Failing to account for budget allocation when evaluating multilingual models across multiple languages simultaneously.5253## Evidence (verbatim from paper)5455> Metric. For both tasks, we use test cases to evaluate the exact functional correctness of the generated code, measuring the performance with pass@$k$ (Kulal et al., 2019), making it real-world useful and also completely different from the string similarity metrics like BLEU(Papineni et al., 2002), and CodeBLEU(Ren et al., 2020; Lu et al., 2021; Zhu et al., 2022). Specifically, we use the unbiased method to estimate pass@$k$ (Chen et al., 2021): pass@k:=E[1-(n-c k)/(n k)],n=200,k∈{1,10,100} where n is the total number of generation (n=200 in this work), k is the sampling budget (typically k∈{1, 10, 100}) and c is the number of samples that pass all test cases.5657## Citation5859```bibtex60@misc{zheng2023codegeex,61 title={CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-X},62 author={Zheng et al. (2023)},63 year={2023},64 note={arXiv:2303.17568}65}66```6768- arXiv: 2303.17568