{"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/coder-reviewer-reranking-for-code-generation","title":"Coder Reviewer Reranking for Code Generation","arxiv_id":"2211.16490","date":"2022-11-29","proceeding":null,"authors":["Tianyi Zhang","Tao Yu","Tatsunori B. Hashimoto","Mike Lewis","Wen-tau Yih","Daniel Fried","Sida I. Wang"],"abstract":"Sampling diverse programs from a code language model and reranking with model likelihood is a popular method for code generation but it is prone to preferring degenerate solutions. Inspired by collaborative programming, we propose Coder-Reviewer reranking. We augment Coder language models from past work, which generate programs given language instructions, with Reviewer models, which evaluate the likelihood of the instruction given the generated programs. We perform an extensive study across six datasets with eight models from three model families. Experimental results show that Coder-Reviewer reranking leads to consistent and significant improvement (up to 17% absolute accuracy gain) over reranking with the Coder model only. When combined with executability filtering, Coder-Reviewer reranking can often outperform the minimum Bayes risk method. Coder-Reviewer reranking is easy to implement by prompting, can generalize to different programming languages, and works well with off-the-shelf hyperparameters.","url_abs":"https://arxiv.org/abs/2211.16490v1","url_pdf":"https://arxiv.org/pdf/2211.16490v1.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":"coder-reviewer-reranking-for-code-generation","repo_url":"https://github.com/facebookresearch/coder_reviewer_reranking","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"reranking","task_name":"Reranking"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"code-davinci-002 175B + Reviewer","rank_in_archive_order":36,"of":99,"metrics":{"Accuracy":"66.9"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"code-davinci-002 175B + Coder-Reviewer","rank_in_archive_order":37,"of":99,"metrics":{"Accuracy":"66.4"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"code-davinci-002 175B + MBR-Exec","rank_in_archive_order":42,"of":99,"metrics":{"Accuracy":"63"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"code-cushman-001 12B + MBR-Exec","rank_in_archive_order":66,"of":99,"metrics":{"Accuracy":"48.3"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"CodeGen 16B + MBR-Exec","rank_in_archive_order":69,"of":99,"metrics":{"Accuracy":"47.3"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"CodeGen 16B + Coder-Reviewer","rank_in_archive_order":73,"of":99,"metrics":{"Accuracy":"46.2"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"CodeGen 16B + Reviewer","rank_in_archive_order":78,"of":99,"metrics":{"Accuracy":"44.1"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"InCoder 6.7B + MBR-Exec","rank_in_archive_order":92,"of":99,"metrics":{"Accuracy":"26.7"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"InCoder 6.7B + Coder-Reviewer","rank_in_archive_order":93,"of":99,"metrics":{"Accuracy":"26.1"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-mbpp","task":"Code Generation","dataset":"MBPP","model":"InCoder 6.7B + Reviewer","rank_in_archive_order":94,"of":99,"metrics":{"Accuracy":"24.4"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2211.16490","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.16490"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/facebookresearch/coder_reviewer_reranking","reach":null}],"summary":{"ran_violates":1,"ran_honours":1},"by_repo_kind":{"official":{"samples":2,"ran":2,"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":"64d47c9d4e0d0c5e","entry":"filter_repeat","repo":"facebookresearch/coder_reviewer_reranking","repo_kind":"official","path":"sample_selectors.py","file_url":"https://github.com/facebookresearch/coder_reviewer_reranking/blob/HEAD/sample_selectors.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"64d47c9d4e0d0c5e"}},{"code_sha256_prefix":"e0d0a3c69f5ae939","entry":"single_exec_result_matching","repo":"facebookresearch/coder_reviewer_reranking","repo_kind":"official","path":"sample_selectors.py","file_url":"https://github.com/facebookresearch/coder_reviewer_reranking/blob/HEAD/sample_selectors.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e0d0a3c69f5ae939"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}