Cited by 32Software Engineering ResearchTopic ModelingScientific Computing and Data Management

BioCoder: a benchmark for bioinformatics code generation with large language models

Open access
Tang, Xiangru, Qian, Bill, Gao, Rick, Chen, Jiakang, Chen, Xinyun, Gerstein, Mark B·2024·Bioinformatics

Abstract

Summary: Pretrained large language models (LLMs) have significantly improved code generation. As these models scale up, there is an increasing need for the output to handle more intricate tasks and to be appropriately specialized to particular domains. Here, we target bioinformatics due to the amount of domain knowledge, algorithms, and data operations this discipline requires. We present BioCoder, a benchmark developed to evaluate LLMs in generating bioinformatics-specific code. BioCoder spans much of the field, covering cross-file dependencies, class declarations, and global variables. It incorporates 1026 Python functions and 1243 Java methods extracted from GitHub, along with 253 examples from the Rosalind Project, all pertaining to bioinformatics. Using topic modeling, we show that the overall coverage of the included code is representative of the full spectrum of bioinformatics calculations. BioCoder incorporates a fuzz-testing framework for evaluation. We have applied it to evaluate various models including InCoder, CodeGen, CodeGen2, SantaCoder, StarCoder, StarCoder+, InstructCodeT5+, GPT-3.5, and GPT-4. Furthermore, we fine-tuned one model (StarCoder), demonstrating that our training dataset can enhance the performance on our testing benchmark (by >15% in terms of Pass@K under certain prompt configurations and always >3%). The results highlight two key aspects of successful models: (i) Successful models accommodate a long prompt (>2600 tokens) with full context, including functional dependencies. (ii) They contain domain-specific knowledge of bioinformatics, beyond just general coding capability. This is evident from the performance gain of GPT-3.5/4 compared to the smaller models on our benchmark (50% versus up to 25%). Availability and implementation: All datasets, benchmark, Docker images, and scripts required for testing are available at: https://github.com/gersteinlab/biocoder and https://biocoder-benchmark.github.io/.

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.1093/bioinformatics/btae230

Cites

8 of 8 references verified0 citation errors · 0 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • Existing code-generation benchmarks such as SWE-Bench, BioCoder-Py, ML-Bench, and MLAgentBench only consist of tasks found on secondary sources such as GitHub and Kaggle.

    “Yet, these benchmarks only consist of tasks found on secondary sources, such as GitHub and Kaggle.”

    From ScienceAgentBench: Toward Rigorous Assessment of Language Agents for Data-Driven Scientific Discovery (2024) · cites this paper as Tang et al., 2024c

    Section 3.1 says BioCoder’s dataset originated from bioinformatics-related GitHub repositories, and Section 3.4 identifies BioCoder-Py as part of the benchmark. The paper does not establish that SWE-Bench, ML-Bench, or MLAgentBench use only tasks from GitHub, Kaggle, or other secondary sources; nor does its account of BioCoder establish the word “only.” (LLM, conf=0.82)

    Experimental — accuracy not yet measured

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Research works printed but not linked: 55

  1. Allal LB, Li R, Kocetkov D et al Santacoder: don’t reach for the stars!. arXiv preprint arXiv:2301.03988. 2023. · arXiv
  2. Askell A, Bai Y, Chen A et al A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861. 2021. · arXiv
  3. Athiwaratkun B, Gouda SK, Wang Z et al Multi-lingual evaluation of code generation models. arXiv preprint arXiv:2210.14868. 2022. · arXiv
  4. Austin J, Odena A, Nye M et al Program synthesis with large language models. arXiv preprint arXiv:2108.07732. 2021. · arXiv
  5. Bai Y, Jones A, Ndousse K et al Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862. 2022. · arXiv
  6. Biderman S, Schoelkopf H, Anthony Q et al Pythia: A suite for analyzing large language models across training and scaling. In: International Conference on Machine Learning 2023 (pp. 2397-2430). PMLR.
  7. Bommasani R, Hudson DA, Adeli E et al On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258. 2021. · arXiv
  8. Brown TB, Mann B, Ryder N et al Language models are few-shot learners. Advances in Neural Information Processing Systems. 2020;33: 1877– 901.
  9. Bui ND, Le H, Wang Y et al Codetf: One-stop transformer library for state-of-the-art code llm. arXiv preprint arXiv:2306.00029. 2023. · arXiv
  10. Chen B, Zhang F, Nguyen A et al CodeT: Code Generation with Generated Tests. In: The Eleventh International Conference on Learning Representations 2022.
  11. Chen M, Tworek J, Jun H et al Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. 2021. · arXiv
  12. Chen X, Lin M, Schärli N et al Teaching large language models to self-debug. arXiv preprint arXiv:2304.05128. 2023. · arXiv
  13. Chowdhery A, Narang S, Devlin J et al Palm: Scaling language modeling with pathways. Journal of Machine Learning Research. 2023;24(240): 1– 13.
  14. Christopoulou F, Lampouras G, Gritta M et al Pangu-coder: Program synthesis with function-level language modeling. arXiv preprint arXiv:2207.11280. 2022. · arXiv
  15. Du X, Liu M, Wang K et al Classeval: A manually-crafted benchmark for evaluating llms on class-level code generation. arXiv preprint arXiv:2308.01861. 2023. · arXiv
  16. Fried D, Aghajanyan A, Lin J et al InCoder: A Generative Model for Code Infilling and Synthesis. In: The Eleventh International Conference on Learning Representations 2022.
  17. Hendrycks D, Basart S, Kadavath S et al Measuring Coding Challenge Competence With APPS. In: Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track. 2021.
  18. Hoffmann J, Borgeaud S, Mensch A et al Training compute-optimal large language models. arXiv preprint arXiv:2203.15556. 2022. · arXiv
  19. Khlaaf H, Mishkin P, Achiam J et al A hazard analysis framework for code synthesis large language models. arXiv preprint arXiv:2207.14157. 2022. · arXiv
  20. Lai Y, Li C, Wang Y et al DS-1000: A natural and reliable benchmark for data science code generation. In: International Conference on Machine Learning 2023 (pp. 18319-18345). PMLR.
  21. Lee T, Hong S, Ahn J et al Who wrote this code? watermarking for code generation. arXiv preprint arXiv:2305.15060. 2023. · arXiv
  22. Li R, Allal LB, Zi Y et al StarCoder: may the source be with you!. arXiv preprint arXiv:2305.06161. 2023. · arXiv
  23. Liu T, Xu C, McAuley J. 2023. RepoBench: Benchmarking Repository-Level Code Auto-Completion Systems. In: The Twelfth International Conference on Learning Representations 2023.
  24. Luo Z, Xu C, Zhao P et al WizardCoder: Empowering Code Large Language Models with Evol-Instruct. In: The Twelfth International Conference on Learning Representations 2023.
  25. Mikolov T, Chen K, Corrado G et al Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781. 2013. · arXiv
  26. Mitchell M, Luccioni AS, Lambert N et al Measuring data. arXiv preprint arXiv:2212.05129. 2022. · arXiv
  27. Muennighoff N, Wang T, Sutawika L et al Crosslingual Generalization through Multitask Finetuning. In: The 61st Annual Meeting Of The Association For Computational Linguistics 2023.
  28. Muennighoff N, Liu Q, Zebaze A et al OctoPack: Instruction Tuning Code Large Language Models. In: The Twelfth International Conference on Learning Representations 2024.
  29. Nijkamp E, Pang B, Hayashi H et al CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis. In: The Eleventh International Conference on Learning Representations 2022.
  30. Nijkamp E, Hayashi H, Xiong C et al Codegen2: Lessons for training llms on programming and natural languages. arXiv preprint arXiv:2305.02309. 2023. · arXiv
  31. Olausson TX, Inala JP, Wang C et al Demystifying gpt self-repair for code generation. arXiv preprint arXiv:2306.09896. 2023. · arXiv
  32. OpenAI 2023. GPT-4 technical report. arXiv preprint arXiv:2303.08774. 2023. · arXiv
  33. Pan R, Ibrahimzada AR, Krishna R et al Understanding the effectiveness of large language models in code translation. arXiv preprint arXiv:2308.03109. 2023. · arXiv
  34. Patil SG, Zhang T, Wang X et al Gorilla: Large language model connected with massive apis. arXiv preprint arXiv:2305.15334. 2023. · arXiv
  35. Qin Y, Liang S, Ye Y et al Toolllm: Facilitating large language models to master 16000+ real-world apis. arXiv preprint arXiv:2307.16789. 2023. · arXiv
  36. Radford A, Wu J, Child R et al Language models are unsupervised multitask learners. OpenAI Blog 2019; 1: 9.
  37. Shen B, Zhang J, Chen T et al Pangu-coder2: Boosting large language models for code with ranking feedback. arXiv preprint arXiv:2307.14936. 2023. · arXiv
  38. Shrivastava D, Kocetkov D, de Vries H et al RepoFusion: Training Code Models to Understand Your Repository. arXiv preprint arXiv:2306.10998. 2023. · arXiv
  39. Thoppilan R, Freitas DD, Hall J et al Lamda: Language models for dialog applications. arXiv preprint arXiv:2201.08239. 2022. · arXiv
  40. Touvron H, Lavril T, Izacard G et al Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971. 2023. · arXiv
  41. Wang S, Li Z, Qian H et al ReCode: Robustness Evaluation of Code Generation Models. In: The 61st Annual Meeting Of The Association For Computational Linguistics 2023
  42. Wang Y, Wang W, Joty S et al CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation. In: Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing 2021 (pp. 8696-8708).
  43. Wang Y, Le H, Gotmare AD et al CodeT5+: Open Code Large Language Models for Code Understanding and Generation. In: Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing 2023 (pp. 1069-1088).
  44. Wang Z, Zhou S, Fried D et al Execution-Based Evaluation for Open-Domain Code Generation. In: Findings of the Association for Computational Linguistics: EMNLP 2023 2023 (pp. 1271-1290).
  45. Wang Z, Cuenca G, Zhou S et al MCoNaLa: A Benchmark for Code Generation from Multiple Natural Languages. In: Findings of the Association for Computational Linguistics: EACL 2023 2023 (pp. 265-273).
  46. Xu Q, Hong F, Li B et al On the Tool Manipulation Capability of Open-sourced Large Language Models. In: NeurIPS 2023 Foundation Models for Decision Making Workshop 2023.
  47. Yu H, Shen B, Ran D et al Codereval: A benchmark of pragmatic code generation with generative pre-trained models. In: Proceedings of the 46th IEEE/ACM International Conference on Software Engineering 2024 (pp. 1-12).
  48. Yuan Z, Liu J, Zi Q et al Evaluating instruction-tuned large language models on code comprehension and generation. arXiv preprint arXiv:2308.01240. 2023. · arXiv
  49. Zan D, Chen B, Yang D et al CERT: continual pre-training on sketches for library-oriented code generation. arXiv preprint arXiv:2206.06888. 2022. · arXiv
  50. Zan D, Chen B, Lin Z et al When Language Model Meets Private Library. In: Findings of the Association for Computational Linguistics: EMNLP 2022 2022b (pp. 277-288).
  51. Zan D, Chen B, Zhang F et al Large Language Models Meet NL2Code: A Survey. In: Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) 2023 (pp. 7443-7464).
  52. Zeng A, Liu X, Du Z et al GLM-130B: An Open Bilingual Pre-trained Model. In: The Eleventh International Conference on Learning Representations 2022.
  53. Zhang SD, Tigges C, Biderman S et alCan Transformers Learn to Solve Problems Recursively?. arXiv preprint arXiv:2305.14699. 2023. · arXiv
  54. Zheng Q, Xia X, Zou X et al Codegeex: A pre-trained model for code generation with multilingual evaluations on humaneval-x. arXiv preprint arXiv:2303.17568. 2023. · arXiv
  55. Zhuo TY. Large language models are state-of-the-art evaluators of code generation. arXiv preprint arXiv:2304.14317. 2023. · arXiv

Cited by

Sorted by citations

Authors
Tang, X., Qian, B., Gao, R., Chen, J., Chen, X., & Gerstein, M. B.
Affiliations
  • Yale University (US)
  • Google (United States) (US)
Corresponding author
Gerstein, Mark B
Venue
Bioinformatics
Published
2024-06-28
Volume
40
Issue
Supplement_1
Pages
i266-i276
ISSN
  • 1367-4803 (ISSN-L)
  • 1367-4811
OpenAlex
W4400140877
Cited by
30
References
6
Citations by year
2026: 11 · 2025: 13 · 2024: 5 · 2023: 1
FWCI
10.90
Type
journal article
Language
en
Open access
Locations
  • Bioinformatics (publishedVersion, cc-by)
  • PubMed Central (publishedVersion, cc-by)
  • PubMed (publishedVersion)
  • arXiv (Cornell University) (submittedVersion, cc-by)
  • arXiv (Cornell University) (cc-by)
Funders
Schmidt Futures
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Social Sciences › Decision Sciences › Information Systems and Management › Scientific Computing and Data Management
Keywords
large language models, benchmark, Python, Java, global variables, fuzzing, StarCoder, GPT-4, prompt length, domain knowledge, fine-tuning
MeSH terms
Algorithms, Programming Languages, Software, Computational Biology, Benchmarking

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review