CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Execution

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Xu, Ruiyang, Cao, Jialun, Lu, Yaojie, Wen, Ming, Lin, Hongyu, Han, Xianpei, He, Ben, Cheung, Shing-Chi, Sun, Le
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912380327297024
author Xu, Ruiyang
Cao, Jialun
Lu, Yaojie
Wen, Ming
Lin, Hongyu
Han, Xianpei
He, Ben
Cheung, Shing-Chi
Sun, Le
author_facet Xu, Ruiyang
Cao, Jialun
Lu, Yaojie
Wen, Ming
Lin, Hongyu
Han, Xianpei
He, Ben
Cheung, Shing-Chi
Sun, Le
contents Code benchmarks such as HumanEval are widely adopted to evaluate Large Language Models' (LLMs) coding capabilities. However, there is an unignorable programming language bias in existing code benchmarks -- over 95% code generation benchmarks are dominated by Python, leaving the LLMs' capabilities in other programming languages such as Java and C/C++ unknown. Moreover, coding task bias is also crucial. Most benchmarks focus on code generation capability, while benchmarks for code reasoning (given input, reasoning output; and given output, reasoning input), an essential coding capability, are insufficient. Yet, constructing multi-lingual benchmarks can be expensive and labor-intensive, and codes in contest websites such as Leetcode suffer from data contamination during training. To fill this gap, we propose CRUXEVAL-X, a multi-lingual code reasoning benchmark that contains 19 programming languages. It comprises at least 600 subjects for each language, along with 19K content-consistent tests in total. In particular, the construction pipeline of CRUXEVAL-X works in a fully automated and test-guided manner, which iteratively generates and repairs based on execution feedback. Also, to cross language barriers (e.g., dynamic/static type systems in Python/C++), we formulated various transition rules between language pairs to facilitate translation. Our intensive evaluation of 24 representative LLMs reveals the correlation between language pairs. For example, TypeScript and JavaScript show a significant positive correlation, while Racket has less correlation with other languages. More interestingly, even a model trained solely on Python can achieve at most 34.4% Pass@1 in other languages, revealing the cross-language generalization of LLMs.
format Preprint
id arxiv_https___arxiv_org_abs_2408_13001
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Execution
Xu, Ruiyang
Cao, Jialun
Lu, Yaojie
Wen, Ming
Lin, Hongyu
Han, Xianpei
He, Ben
Cheung, Shing-Chi
Sun, Le
Artificial Intelligence
Code benchmarks such as HumanEval are widely adopted to evaluate Large Language Models' (LLMs) coding capabilities. However, there is an unignorable programming language bias in existing code benchmarks -- over 95% code generation benchmarks are dominated by Python, leaving the LLMs' capabilities in other programming languages such as Java and C/C++ unknown. Moreover, coding task bias is also crucial. Most benchmarks focus on code generation capability, while benchmarks for code reasoning (given input, reasoning output; and given output, reasoning input), an essential coding capability, are insufficient. Yet, constructing multi-lingual benchmarks can be expensive and labor-intensive, and codes in contest websites such as Leetcode suffer from data contamination during training. To fill this gap, we propose CRUXEVAL-X, a multi-lingual code reasoning benchmark that contains 19 programming languages. It comprises at least 600 subjects for each language, along with 19K content-consistent tests in total. In particular, the construction pipeline of CRUXEVAL-X works in a fully automated and test-guided manner, which iteratively generates and repairs based on execution feedback. Also, to cross language barriers (e.g., dynamic/static type systems in Python/C++), we formulated various transition rules between language pairs to facilitate translation. Our intensive evaluation of 24 representative LLMs reveals the correlation between language pairs. For example, TypeScript and JavaScript show a significant positive correlation, while Racket has less correlation with other languages. More interestingly, even a model trained solely on Python can achieve at most 34.4% Pass@1 in other languages, revealing the cross-language generalization of LLMs.
title CRUXEval-X: A Benchmark for Multilingual Code Reasoning, Understanding and Execution
topic Artificial Intelligence
url https://arxiv.org/abs/2408.13001