{"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/a-conversational-paradigm-for-program","title":"CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis","arxiv_id":"2203.13474","date":"2022-03-25","proceeding":null,"authors":["Erik Nijkamp","Bo Pang","Hiroaki Hayashi","Lifu Tu","Huan Wang","Yingbo Zhou","Silvio Savarese","Caiming Xiong"],"abstract":"Program synthesis strives to generate a computer program as a solution to a given problem specification, expressed with input-output examples or natural language descriptions. The prevalence of large language models advances the state-of-the-art for program synthesis, though limited training resources and data impede open access to such models. To democratize this, we train and release a family of large language models up to 16.1B parameters, called CODEGEN, on natural language and programming language data, and open source the training library JAXFORMER. We show the utility of the trained model by demonstrating that it is competitive with the previous state-of-the-art on zero-shot Python code generation on HumanEval. We further investigate the multi-step paradigm for program synthesis, where a single program is factorized into multiple prompts specifying subproblems. To this end, we construct an open benchmark, Multi-Turn Programming Benchmark (MTPB), consisting of 115 diverse problem sets that are factorized into multi-turn prompts. Our analysis on MTPB shows that the same intent provided to CODEGEN in multi-turn fashion significantly improves program synthesis over that provided as a single turn. We make the training library JAXFORMER and model checkpoints available as open source contribution: https://github.com/salesforce/CodeGen.","url_abs":"https://arxiv.org/abs/2203.13474v5","url_pdf":"https://arxiv.org/pdf/2203.13474v5.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":"a-conversational-paradigm-for-program","repo_url":"https://github.com/salesforce/CodeGen","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":null},{"paper_slug":"a-conversational-paradigm-for-program","repo_url":"https://github.com/salesforce/jaxformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"paper_slug":"a-conversational-paradigm-for-program","repo_url":"https://github.com/DIRECT-BIT/SRA-MCTS","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null},{"paper_slug":"a-conversational-paradigm-for-program","repo_url":"https://github.com/eth-sri/sven","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null},{"paper_slug":"a-conversational-paradigm-for-program","repo_url":"https://github.com/openlmlab/moss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"a-conversational-paradigm-for-program","repo_url":"https://github.com/openmoss/moss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"a-conversational-paradigm-for-program","repo_url":"https://github.com/2024-MindSpore-1/Code2/tree/main/model-1/codegen","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"a-conversational-paradigm-for-program","repo_url":"https://github.com/Mind23-2/MindCode-134","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":{"status":"ok"}}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"humaneval","task_name":"HumanEval"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"program-synthesis","task_name":"Program Synthesis"}],"methods":[{"method_slug":"codegen","method_name":"CodeGen"}],"datasets_introduced":[],"methods_introduced":[{"slug":"codegen","name":"CodeGen","full_name":"CodeGen"}],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2203.13474","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.13474"}},"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/openlmlab/moss","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2024-MindSpore-1/Code2/tree/main/model-1/codegen","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/openmoss/moss","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/DIRECT-BIT/SRA-MCTS","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/salesforce/jaxformer","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Mind23-2/MindCode-134","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/salesforce/CodeGen","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/eth-sri/sven","reach":null}],"summary":{"ran_fixture":2,"ran":3,"ran_draft_wrong":4,"ran_violates":1},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1},"listed":{"samples":7,"ran":7,"repositories":2}},"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":"2f6618868885e7ca","entry":"apply_rotary_pos_emb","repo":"salesforce/CodeGen","repo_kind":"official","path":"codegen1/jaxformer/hf/codegen/modeling_codegen.py","file_url":"https://github.com/salesforce/CodeGen/blob/HEAD/codegen1/jaxformer/hf/codegen/modeling_codegen.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2f6618868885e7ca"}},{"code_sha256_prefix":"d11e60ed4e63403d","entry":"apply_rotary_pos_emb","repo":"openlmlab/moss","repo_kind":"listed","path":"models/modeling_moss.py","file_url":"https://github.com/openlmlab/moss/blob/HEAD/models/modeling_moss.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":"d11e60ed4e63403d"}},{"code_sha256_prefix":"c2217cd556fe5607","entry":"create_sinusoidal_positions","repo":"openlmlab/moss","repo_kind":"listed","path":"models/modeling_moss.py","file_url":"https://github.com/openlmlab/moss/blob/HEAD/models/modeling_moss.py","link_basis":"harvester_set","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":"c2217cd556fe5607"}},{"code_sha256_prefix":"a9e7f2cdf016b88b","entry":"find_layers","repo":"openlmlab/moss","repo_kind":"listed","path":"models/quantization.py","file_url":"https://github.com/openlmlab/moss/blob/HEAD/models/quantization.py","link_basis":"harvester_set","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":"a9e7f2cdf016b88b"}},{"code_sha256_prefix":"423269b3cef0af9c","entry":"fixed_pos_embedding","repo":"salesforce/CodeGen","repo_kind":"official","path":"codegen1/jaxformer/hf/codegen/modeling_codegen.py","file_url":"https://github.com/salesforce/CodeGen/blob/HEAD/codegen1/jaxformer/hf/codegen/modeling_codegen.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"423269b3cef0af9c"}},{"code_sha256_prefix":"c083e60f5001bd38","entry":"get_pairs","repo":"openlmlab/moss","repo_kind":"listed","path":"models/tokenization_moss.py","file_url":"https://github.com/openlmlab/moss/blob/HEAD/models/tokenization_moss.py","link_basis":"harvester_set","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":"c083e60f5001bd38"}},{"code_sha256_prefix":"826ceb601fb31250","entry":"parse_text","repo":"openlmlab/moss","repo_kind":"listed","path":"moss_web_demo_gradio.py","file_url":"https://github.com/openlmlab/moss/blob/HEAD/moss_web_demo_gradio.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"826ceb601fb31250"}},{"code_sha256_prefix":"c66149010337c505","entry":"rotate_every_two","repo":"salesforce/CodeGen","repo_kind":"official","path":"codegen1/jaxformer/hf/codegen/modeling_codegen.py","file_url":"https://github.com/salesforce/CodeGen/blob/HEAD/codegen1/jaxformer/hf/codegen/modeling_codegen.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c66149010337c505"}},{"code_sha256_prefix":"2e3bec9f0c9b1973","entry":"rotate_every_two","repo":"openlmlab/moss","repo_kind":"listed","path":"models/modeling_moss.py","file_url":"https://github.com/openlmlab/moss/blob/HEAD/models/modeling_moss.py","link_basis":"harvester_set","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":"2e3bec9f0c9b1973"}},{"code_sha256_prefix":"f3ac5c7092505639","entry":"trim_code","repo":"eth-sri/sven","repo_kind":"listed","path":"scripts/human_eval_gen.py","file_url":"https://github.com/eth-sri/sven/blob/HEAD/scripts/human_eval_gen.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f3ac5c7092505639"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}