{"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/codejudge-evaluating-code-generation-with","title":"CodeJudge: Evaluating Code Generation with Large Language Models","arxiv_id":"2410.02184","date":"2024-10-03","proceeding":null,"authors":["Weixi Tong","Tianyi Zhang"],"abstract":"Large Language Models (LLMs) have shown promising performance in code generation. However, how to reliably evaluate code generated by LLMs remains an unresolved problem. This paper presents CodeJudge, a code evaluation framework that leverages LLMs to evaluate the semantic correctness of generated code without the need for test cases. We investigate different ways to guide the LLM in performing \"slow thinking\" to arrive at an in-depth and reliable evaluation. We experimented with four LLMs as evaluators on four code generation datasets and five programming languages. The results show that CodeJudge significantly outperformed existing methods in most settings. Furthermore, compared with a SOTA GPT-3.5-based code evaluation method, CodeJudge achieved better results even when using a much smaller model, Llama-3-8B-Instruct. Our code and datasets are available on GitHub https://github.com/VichyTong/CodeJudge.","url_abs":"https://arxiv.org/abs/2410.02184v1","url_pdf":"https://arxiv.org/pdf/2410.02184v1.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":"abstracts"},"code_links":[{"paper_slug":"codejudge-evaluating-code-generation-with","repo_url":"https://github.com/VichyTong/CodeJudge","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-3","method_name":"GPT-3"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.02184","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.02184"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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":"deterministic:regex_extraction","url":"https://github.com/JetBrains-Research/codegen-metrics","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/neulab/code-bert-score","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/terryyz/ice-score","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/VichyTong/CodeJudge","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":12,"ran_honours":2,"ran_draft_wrong":1,"unverified":8},"by_repo_kind":{"official":{"samples":20,"ran":13,"repositories":1},"found_in_text":{"samples":1,"ran":0,"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":2,"samples":[{"code_sha256_prefix":"8f3951a30e7ab452","entry":"answer_to_score","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"code_model_score/utils.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/code_model_score/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8f3951a30e7ab452"}},{"code_sha256_prefix":"2dbad7c7765ac00d","entry":"calculate_correlation","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/apps/calculate_single_correlation.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/apps/calculate_single_correlation.py","link_basis":"first_harvest_node","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":"2dbad7c7765ac00d"}},{"code_sha256_prefix":"5216eb6022b6ac5b","entry":"calculate_correlation","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/apps/calculate_table.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/apps/calculate_table.py","link_basis":"first_harvest_node","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":"5216eb6022b6ac5b"}},{"code_sha256_prefix":"4bb7535462be56ac","entry":"calculate_other_correlation","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/apps/calculate_table.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/apps/calculate_table.py","link_basis":"first_harvest_node","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":"4bb7535462be56ac"}},{"code_sha256_prefix":"ded9c4a6757d8d95","entry":"code_llama_prompt","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"code_model_score/gpt_score.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/code_model_score/gpt_score.py","link_basis":"first_harvest_node","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":"ded9c4a6757d8d95"}},{"code_sha256_prefix":"507f475feb734647","entry":"compute_intermediate_size","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/model/convert_llama_weights_to_hf.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/model/convert_llama_weights_to_hf.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"507f475feb734647"}},{"code_sha256_prefix":"52f8f65294260a82","entry":"extend","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/apps/calculate_single_correlation.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/apps/calculate_single_correlation.py","link_basis":"first_harvest_node","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":"52f8f65294260a82"}},{"code_sha256_prefix":"9cb071c5ea904943","entry":"find_files_with_substring","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/apps/calculate_accuracy.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/apps/calculate_accuracy.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9cb071c5ea904943"}},{"code_sha256_prefix":"68c90a7c8006a85d","entry":"form_filling","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"code_model_score/gpt_score.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/code_model_score/gpt_score.py","link_basis":"first_harvest_node","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":"68c90a7c8006a85d"}},{"code_sha256_prefix":"b9229b89784c7b66","entry":"get_gpt_answer","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"b9229b89784c7b66"}},{"code_sha256_prefix":"da7ee7dddf48bf67","entry":"get_pair","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/humaneval/code_score.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/humaneval/code_score.py","link_basis":"first_harvest_node","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":"da7ee7dddf48bf67"}},{"code_sha256_prefix":"1756c2f56ede92e2","entry":"llama3_prompt","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"code_model_score/gpt_score.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/code_model_score/gpt_score.py","link_basis":"first_harvest_node","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":"1756c2f56ede92e2"}},{"code_sha256_prefix":"d3eca7c3807cab0d","entry":"process_raw_content","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"d3eca7c3807cab0d"}},{"code_sha256_prefix":"6da24498ded11eb5","entry":"process_raw_content","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"code_model_score/utils.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/code_model_score/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6da24498ded11eb5"}},{"code_sha256_prefix":"c5bcf01d18bba63d","entry":"read_json","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/model/convert_llama_weights_to_hf.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/model/convert_llama_weights_to_hf.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c5bcf01d18bba63d"}},{"code_sha256_prefix":"8afc902197b67802","entry":"calculate_correlation","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/apps/calculate_accuracy.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/apps/calculate_accuracy.py","link_basis":"first_harvest_node","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":"8afc902197b67802"}},{"code_sha256_prefix":"bcf3a566009fd040","entry":"evaluate","repo":"terryyz/ice-score","repo_kind":"found_in_text","path":"llm_code_eval/evaluator.py","file_url":"https://github.com/terryyz/ice-score/blob/HEAD/llm_code_eval/evaluator.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bcf3a566009fd040"}},{"code_sha256_prefix":"441183fe72976e33","entry":"load_model","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"code_model_score/utils.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/code_model_score/utils.py","link_basis":"first_harvest_node","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":"441183fe72976e33"}},{"code_sha256_prefix":"406265a924488a97","entry":"read_data","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/apps/code_score.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/apps/code_score.py","link_basis":"first_harvest_node","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":"406265a924488a97"}},{"code_sha256_prefix":"97104da8984d7e70","entry":"read_data","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/bigcodebench/code_score.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/bigcodebench/code_score.py","link_basis":"first_harvest_node","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":"97104da8984d7e70"}},{"code_sha256_prefix":"dbd4470654b4a66e","entry":"read_data","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/conala/code_score.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/conala/code_score.py","link_basis":"first_harvest_node","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":"dbd4470654b4a66e"}},{"code_sha256_prefix":"21fbaf2a4f026641","entry":"read_data","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/humaneval/code_score.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/humaneval/code_score.py","link_basis":"first_harvest_node","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":"21fbaf2a4f026641"}},{"code_sha256_prefix":"5f56e1f4e5b6ba8c","entry":"write_model","repo":"VichyTong/CodeJudge","repo_kind":"official","path":"evaluation/model/convert_llama_weights_to_hf.py","file_url":"https://github.com/VichyTong/CodeJudge/blob/HEAD/evaluation/model/convert_llama_weights_to_hf.py","link_basis":"first_harvest_node","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":"5f56e1f4e5b6ba8c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}