BioCoder: A Benchmark for Bioinformatics Code Generation with Large Language Models
Paper · 2023 · Xiangru Tang, Bill Qian, Rick Gao et al.
Summary
Most LLM code-generation benchmarks use short, generic functions and ignore the domain knowledge and project context that real scientific code needs. BioCoder fills this gap for bioinformatics. The authors mined GitHub repositories cited in peer-reviewed bioinformatics publications, parsed them with AST-based tools, and filtered candidate functions through automated and manual checks. Each problem comes with its full context: imports, class declarations, global variables and helper functions. Tasks from the Rosalind Project were also added. Generated code is run against fuzz tests in Docker containers, and results are reported as Pass@K. Nine models were evaluated, from InCoder and CodeGen to GPT-4, and StarCoder was additionally fine-tuned on BioCoder training data. GPT-3.5 and GPT-4 solved about half of the problems, while smaller open models reached 25% at most. Fine-tuning gave StarCoder consistent gains. The results indicate that strong models need two things: the ability to use long, dependency-heavy prompts and real biological domain knowledge. BioCoder therefore offers a realistic yardstick for specialized code generation.
Key points
- Dataset: 1,026 Python functions and 1,243 Java methods drawn from 1,720 bioinformatics repositories, plus 253 Rosalind problems. It is split into public (460), hidden (2,269) and similar (460) sets.
- Evaluation relies on a scalable fuzz-testing framework inside Docker. Topic modeling is used to show that the tasks cover the breadth of bioinformatics work.
- Models tested: InCoder, CodeGen, CodeGen2, SantaCoder, StarCoder, StarCoder+, InstructCodeT5+, GPT-3.5 and GPT-4. GPT models reach about 50% versus at most 25% for the others. Successful models handle prompts longer than 2,600 tokens.
- Fine-tuning StarCoder on BioCoder data raised Pass@K by more than 3% in every prompt setup and by over 15% in some.
- Acknowledged limitations:
- possible training-data contamination for closed models;
- reproducibility issues with evolving APIs;
- curation bias from using OpenAI GPT to select samples.
- Resources are available at github.com/gersteinlab/biocoder.
Institutions
Fields, topics and concepts
📚 Shelves 7The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 worksInformation Systems · 1,888 worksDecision Sciences · 306 worksInformation Systems and Management · 96 works
🧭 Topics 2Research subjects and languages the work is about.Evaluation & benchmarks · 1,394 worksCode & programming languages · 194 works
Cite
Cite as Xiangru Tang, Bill Qian, Rick Gao, Jiakang Chen, Xinyun Chen and Mark Gerstein. 2023. BioCoder: A Benchmark for Bioinformatics Code Generation with Large Language Models. arXiv:2308.16458.
@misc{tang2023biocoder,
title = {{BioCoder: A Benchmark for Bioinformatics Code Generation with Large Language Models}},
author = {Xiangru Tang, Bill Qian, Rick Gao, Jiakang Chen, Xinyun Chen and Mark Gerstein},
year = {2023},
doi = {10.48550/arxiv.2308.16458},
eprint = {2308.16458},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2308.16458}
}References
- Allal, L. B., Li, R., Kocetkov, D. et al. (2023). Santacoder: don’t reach for the stars! arXiv preprint arXiv:2301.03988.
- Askell, A., Bai, Y., Chen, A. et al. (2021). A general language assistant as a laboratory for alignment. arXiv preprint arXiv:2112.00861. find
- Athiwaratkun, B., Gouda, S. K., Wang, Z. et al. (2023). Multi-lingual evaluation of code generation models.
- Austin, J., Odena, A., Nye, M. et al. (2021). Program synthesis with large language models.
- Bai, Y., Jones, A., Ndousse, K. et al. (2022). Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862. find
- Barke, S., James, M. B. and Polikarpova, N. (2023). Grounded copilot: How programmers interact with code-generating models. Proceedings of the ACM on Programming Languages, 7(OOPSLA1), 85–111. find
- Biderman, S., Schoelkopf, H., Anthony, Q. et al. (2023). Pythia: A suite for analyzing large language models across training and scaling. find
- Bommasani, R., Hudson, D. A., Adeli, E. et al. (2022). On the opportunities and risks of foundation models.
- Brown, T. B., Mann, B., Ryder, N. et al. (2020). Language models are few-shot learners. arXiv preprint arXiv:2005.14165.
- Bui, N. D., Le, H., Wang, Y. et al. (2023). Codetf: One-stop transformer library for state-of-the-art code llm. arXiv preprint arXiv:2306.00029. — [arXiv:2306.00029](https://arxiv.org/abs/2306.00029) find
- Cassano, F., Gouwar, J., Nguyen, D. et al. (2023). MultiPL-E: a scalable and polyglot approach to benchmarking neural code generation. IEEE Transactions on Software Engineering, pages 1–17. find
- BioCoder Chen, B., Zhang, F., Nguyen, A. et al. (2022). Codet: Code generation with generated tests. arXiv preprint arXiv:2207.10397. find
- Chen, M., Tworek, J., Jun, H. et al. (2021). Evaluating large language models trained on code.
- Chen, T. Y., Ho, J. W., Liu, H. et al. (2009). An innovative approach for testing bioinformatics programs using metamorphic testing. BMC Bioinformatics, 10(1), 24. find
- Chen, X., Lin, M., SchÃd’rli, N. et al. (2023). Teaching large language models to self-debug. find
- Chowdhery, A., Narang, S., Devlin, J. et al. (2022). Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311.
- Christopoulou, F., Lampouras, G., Gritta, M. et al. (2022). PanGu-Coder: program synthesis with function-level language modeling. arXiv preprint arXiv:2207.11280.
- Du, X., Liu, M., Wang, K. et al. (2023). Classeval: A manually-crafted benchmark for evaluating llms on class-level code generation. arXiv preprint arXiv:2308.01861. — [arXiv:2308.01861](https://arxiv.org/abs/2308.01861) find
- Fried, D., Aghajanyan, A., Lin, J. et al. (2023). Incoder: A generative model for code infilling and synthesis. find
- Gao, L., Tow, J., Biderman, S. et al. (2022). Eleutherai/lm-evaluation-harness: v0.3.0. find
- Hendrycks, D., Basart, S., Kadavath, S. et al. (2021). Measuring coding challenge competence with apps.
- NeurIPS. Hoffmann, J., Borgeaud, S., Mensch, A. et al. (2022). Training compute-optimal large language models.
- Khlaaf, H., Mishkin, P., Achiam, J. et al. (2022). A hazard analysis framework for code synthesis large language models. arXiv preprint arXiv:2207.14157. — [arXiv:2207.14157](https://arxiv.org/abs/2207.14157) find
- Lai, Y., Li, C., Wang, Y. et al. (2022). DS-1000: a natural and reliable benchmark for data science code generation. ArXiv, abs/2211.11501. find
- Lee, T., Hong, S., Ahn, J. et al. (2023). Who wrote this code? watermarking for code generation. arXiv preprint arXiv:2305.15060.
- Li, R., Allal, L. B., Zi, Y. et al. (2023). Starcoder: may the source be with you! Li, Y., Choi, D., Chung, J. et al. (2022). Competition-level code generation with alphacode. arXiv preprint arXiv:2203.07814.
- Liu, T., Xu, C. and McAuley, J. (2023). Repobench: Benchmarking repository-level code auto-completion systems.
- Luo, Z., Xu, C., Zhao, P. et al. (2023). Wizardcoder: Empowering code large language models with evol-instruct. arXiv preprint arXiv:2306.08568. find
- Mikolov, T., Chen, K., Corrado, G. et al. (2013). Efficient estimation of word representations in vector space.
- Mitchell, M., Luccioni, A. S., Lambert, N. et al. (2023). Measuring data. find
- MOI, A., Patry, N., Cistac, P. et al. (2022). huggingface/tokenizers: Rust 0.13.2. find
- Muennighoff, N., Wang, T., Sutawika, L. et al. (2023a). Crosslingual generalization through multitask finetuning.
- Muennighoff, N., Liu, Q., Zebaze, A. et al. (2023b). Octopack: Instruction tuning code large language models. arXiv preprint arXiv:2308.07124. find
- Nijkamp, E., Pang, B., Hayashi, H. et al. (2023a). CodeGen: an open large language model for code with multi-turn program synthesis. In The Eleventh International Conference on Learning Representations. find
- Nijkamp, E., Hayashi, H., Xiong, C. et al. (2023b). Codegen2: Lessons for training llms on programming and natural languages. arXiv preprint.
- Olausson, T. X., Inala, J. P., Wang, C. et al. (2023). Demystifying gpt self-repair for code generation. arXiv preprint arXiv:2306.09896.
- OpenAI (2023). Gpt-4 technical report.
- Orlanski, G., Xiao, K., Garcia, X. et al. (2023). Measuring the impact of programming language distribution. In International Conference on Machine Learning, pages 26619–26645.
- PMLR. Pan, R., Ibrahimzada, A. R., Krishna, R. et al. (2023). Understanding the effectiveness of large language models in code translation. arXiv preprint arXiv:2308.03109.
- Patil, S. G., Zhang, T., Wang, X. et al. (2023). Gorilla: Large language model connected with massive apis. arXiv preprint arXiv:2305.15334.
- Qin, Y., Liang, S., Ye, Y. et al. (2023). Toolllm: Facilitating large language models to master 16000+ real-world apis. arXiv preprint arXiv:2307.16789.
- Radford, A., Wu, J., Child, R. et al. (2019). Language models are unsupervised multitask learners. OpenAI blog, 1(8), 9. find
- Russell, P. H., Johnson, R. L., Ananthan, S. et al. (2018). A large-scale analysis of bioinformatics code on github. PloS one, 13(10), e0205898. find
- Shen, B., Zhang, J., Chen, T. et al. (2023). Pangu-coder2: Boosting large language models for code with ranking feedback. arXiv preprint arXiv:2307.14936. — [arXiv:2307.14936](https://arxiv.org/abs/2307.14936) find
- Shrivastava, D., Kocetkov, D., de Vries, H. et al. (2023). Repofusion: Training code models to understand your repository. find
- Thoppilan, R., Freitas, D. D., Hall, J. et al. (2022). Lamda: Language models for dialog applications.
- Touvron, H., Lavril, T., Izacard, G. et al. (2023). LLaMA: open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
- Wang, S., Li, Z., Qian, H. et al. (2022a). Recode: Robustness evaluation of code generation models. arXiv preprint arXiv:2212.10264. find
- Wang, Y., Wang, W., Joty, S. et al. (2021). Codet5: Identifier-aware unified pre-trained encoder-decoder models for code understanding and generation. find
- Wang, Y., Le, H., Gotmare, A. D. et al. (2023a). Codet5+: Open code large language models for code understanding and generation. arXiv preprint arXiv:2305.07922. find
- Wang, Z., Zhou, S., Fried, D. et al. (2022b). Execution-based evaluation for open-domain code generation. arXiv preprint arXiv:2212.10481.
- Wang, Z., Cuenca, G., Zhou, S. et al. (2023b). Mconala: A benchmark for code generation from multiple natural languages. find
- Wong, M.-F., Guo, S., Hang, C.-N. et al. (2023). Natural language generation and understanding of big code for ai-assisted programming: A review. Entropy, 25(6), 888. find
- Xu, Q., Hong, F., Li, B. et al. (2023). On the tool manipulation capability of open-source large language models. arXiv preprint arXiv:2305.16504.
- Yu, H., Shen, B., Ran, D. et al. (2023). Codereval: A benchmark of pragmatic code generation with generative pre-trained models. arXiv preprint. find
- Yuan, Z., Liu, J., Zi, Q. et al. (2023). Evaluating instruction-tuned large language models on code comprehension and generation. arXiv preprint arXiv:2308.01240. — [arXiv:2308.01240](https://arxiv.org/abs/2308.01240) find
- Zan, D., Chen, B., Yang, D. et al. (2022a). Cert: Continual pre-training on sketches for library-oriented code generation. find
- Zan, D., Chen, B., Lin, Z. et al. (2022b). When language model meets private library. In Conference on Empirical Methods in Natural Language Processing. find
- Zan, D., Chen, B., Zhang, F. et al. (2023). Large language models meet nl2code: A survey. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 7443–7464. find
- Zeng, A., Liu, X., Du, Z. et al. (2022). GLM-130B: an open bilingual pre-trained model. arXiv preprint arXiv:2210.02414.
- Zhang, F., Chen, B., Zhang, Y. et al. (2023a). find
- Zhang, S. D., Tigges, C., Biderman, S. et al. (2023b). Can transformers learn to solve problems recursively? arXiv preprint arXiv:2305.14699.
- Zheng, Q., Xia, X., Zou, X. et al. (2023). Codegeex: A pre-trained model for code generation with multilingual evaluations on humaneval-x. find
- Zhuo, T. Y. (2023). Large language models are state-of-the-art evaluators of code generation. arXiv preprint arXiv:2304.14317.
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/tang-2023-biocoder-benchmark-bioinformatics-code-generation/