{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/coffe-a-code-efficiency-benchmark-for-code","title":"COFFE: A Code Efficiency Benchmark for Code Generation","arxiv_id":"2502.02827","date":"2025-02-05","proceeding":null,"authors":["Yun Peng","Jun Wan","Yichen Li","Xiaoxue Ren"],"abstract":"Code generation has largely improved development efficiency in the era of large language models (LLMs). With the ability to follow instructions, current LLMs can be prompted to generate code solutions given detailed descriptions in natural language. Many research efforts are being devoted to improving the correctness of LLM-generated code, and many benchmarks are proposed to evaluate the correctness comprehensively. Despite the focus on correctness, the time efficiency of LLM-generated code solutions is under-explored. Current correctness benchmarks are not suitable for time efficiency evaluation since their test cases cannot well distinguish the time efficiency of different code solutions. Besides, the current execution time measurement is not stable and comprehensive, threatening the validity of the time efficiency evaluation. To address the challenges in the time efficiency evaluation of code generation, we propose COFFE, a code generation benchmark for evaluating the time efficiency of LLM-generated code solutions. COFFE contains 398 and 358 problems for function-level and file-level code generation, respectively. To improve the distinguishability, we design a novel stressful test case generation approach with contracts and two new formats of test cases to improve the accuracy of generation. For the time evaluation metric, we propose efficienct@k based on CPU instruction count to ensure a stable and solid comparison between different solutions. We evaluate 14 popular LLMs on COFFE and identify four findings. Based on the findings, we draw some implications for LLM researchers and software practitioners to facilitate future research and usage of LLMs in code generation.","url_abs":"https://arxiv.org/abs/2502.02827v1","url_pdf":"https://arxiv.org/pdf/2502.02827v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"coffe-a-code-efficiency-benchmark-for-code","repo_url":"https://github.com/JohnnyPeng18/Coffe","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[],"methods":[],"datasets_introduced":[{"slug":"coffe","name":"COFFE","full_name":"COFFE: A Code Efficiency Benchmark for Code Generation"}],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2502.02827","atlas_url":"https://app.syntology.ai/?focus=2502.02827","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.02827"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JohnnyPeng18/Coffe","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":4,"unverified":4},"by_repo_kind":{"official":{"samples":8,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"a99028d7a0ae23f5","entry":"is_floats","repo":"JohnnyPeng18/Coffe","repo_kind":"official","path":"coffe/code_execution.py","file_url":"https://github.com/JohnnyPeng18/Coffe/blob/HEAD/coffe/code_execution.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a99028d7a0ae23f5"}},{"code_sha256_prefix":"124b966feb5dd7d1","entry":"set_default","repo":"JohnnyPeng18/Coffe","repo_kind":"official","path":"coffe/evaluate.py","file_url":"https://github.com/JohnnyPeng18/Coffe/blob/HEAD/coffe/evaluate.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"124b966feb5dd7d1"}},{"code_sha256_prefix":"d7d30a99e0029e36","entry":"syntax_check","repo":"JohnnyPeng18/Coffe","repo_kind":"official","path":"coffe/sanitize.py","file_url":"https://github.com/JohnnyPeng18/Coffe/blob/HEAD/coffe/sanitize.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d7d30a99e0029e36"}},{"code_sha256_prefix":"38d648df1d3df8c0","entry":"trasform_tuples_into_lists","repo":"JohnnyPeng18/Coffe","repo_kind":"official","path":"coffe/code_execution.py","file_url":"https://github.com/JohnnyPeng18/Coffe/blob/HEAD/coffe/code_execution.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"38d648df1d3df8c0"}},{"code_sha256_prefix":"0bf2e66e104d3db2","entry":"is_equal","repo":"JohnnyPeng18/Coffe","repo_kind":"official","path":"coffe/code_execution.py","file_url":"https://github.com/JohnnyPeng18/Coffe/blob/HEAD/coffe/code_execution.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0bf2e66e104d3db2"}},{"code_sha256_prefix":"10a3082e3d6be3dd","entry":"make_request","repo":"JohnnyPeng18/Coffe","repo_kind":"official","path":"stgen/utils.py","file_url":"https://github.com/JohnnyPeng18/Coffe/blob/HEAD/stgen/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"10a3082e3d6be3dd"}},{"code_sha256_prefix":"ab85ac3a71c6adc6","entry":"remove_unindented_lines","repo":"JohnnyPeng18/Coffe","repo_kind":"official","path":"coffe/sanitize.py","file_url":"https://github.com/JohnnyPeng18/Coffe/blob/HEAD/coffe/sanitize.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ab85ac3a71c6adc6"}},{"code_sha256_prefix":"1ee4e2e0c50ef32e","entry":"to_four_space_indents","repo":"JohnnyPeng18/Coffe","repo_kind":"official","path":"coffe/sanitize.py","file_url":"https://github.com/JohnnyPeng18/Coffe/blob/HEAD/coffe/sanitize.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1ee4e2e0c50ef32e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}