Preprint · 2022
DS-1000: A Natural and Reliable Benchmark for Data Science Code Generation
| Venue | arXiv |
|---|---|
| DOI | 10.48550/arXiv.2211.11501 |
| URL | http://arxiv.org/abs/2211.11501 |
| Topics | ReplicHAI / Agent Evals / 02 Software engineering & coding |
| Tags | Computer Science - Computation and Language, Computer Science - Software Engineering |
| archiveID | arXiv:2211.11501 |
| extra | arXiv:2211.11501 [cs.SE] |
| libraryCatalog | arXiv.org |
| shortTitle | DS-1000 |
Abstract
We introduce DS-1000, a code generation benchmark with a thousand data science problems spanning seven Python libraries, such as NumPy and Pandas. Compared to prior works, DS-1000 incorporates three core features. First, our problems reflect diverse, realistic, and practical use cases since we collected them from StackOverflow. Second, our automatic evaluation is highly specific (reliable) -- across all Codex-002-predicted solutions that our evaluation accept, only 1.8% of them are incorrect; we achieve this with multi-criteria metrics, checking both functional correctness by running test cases and surface-form constraints by restricting API usages or keywords. Finally, we proactively defend against memorization by slightly modifying our problems to be different from the original StackOverflow source; consequently, models cannot answer them correctly by memorizing the solutions from pre-training. The current best public system (Codex-002) achieves 43.3% accuracy, leaving ample room for improvement. We release our benchmark at https://ds1000-code-gen.github.io.
BibTeX
@misc{lai_ds-1000_2022,
title = {{DS}-1000: {A} {Natural} and {Reliable} {Benchmark} for {Data} {Science} {Code} {Generation}},
shorttitle = {{DS}-1000},
url = {http://arxiv.org/abs/2211.11501},
doi = {10.48550/arXiv.2211.11501},
abstract = {We introduce DS-1000, a code generation benchmark with a thousand data science problems spanning seven Python libraries, such as NumPy and Pandas. Compared to prior works, DS-1000 incorporates three core features. First, our problems reflect diverse, realistic, and practical use cases since we collected them from StackOverflow. Second, our automatic evaluation is highly specific (reliable) -- across all Codex-002-predicted solutions that our evaluation accept, only 1.8\% of them are incorrect; we achieve this with multi-criteria metrics, checking both functional correctness by running test cases and surface-form constraints by restricting API usages or keywords. Finally, we proactively defend against memorization by slightly modifying our problems to be different from the original StackOverflow source; consequently, models cannot answer them correctly by memorizing the solutions from pre-training. The current best public system (Codex-002) achieves 43.3\% accuracy, leaving ample room for improvement. We release our benchmark at https://ds1000-code-gen.github.io.},
urldate = {2026-11-06},
publisher = {arXiv},
author = {Lai, Yuhang and Li, Chengxi and Wang, Yiming and Zhang, Tianyi and Zhong, Ruiqi and Zettlemoyer, Luke and Yih, Scott Wen-tau and Fried, Daniel and Wang, Sida and Yu, Tao},
month = nov,
year = {2022},
note = {arXiv:2211.11501 [cs.SE]},
keywords = {Computer Science - Computation and Language, Computer Science - Software Engineering},
}