{"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/outline-then-details-syntactically-guided","title":"Outline, Then Details: Syntactically Guided Coarse-To-Fine Code Generation","arxiv_id":"2305.00909","date":"2023-04-28","proceeding":null,"authors":["Wenqing Zheng","S P Sharan","Ajay Kumar Jaiswal","Kevin Wang","Yihan Xi","Dejia Xu","Zhangyang Wang"],"abstract":"For a complicated algorithm, its implementation by a human programmer usually starts with outlining a rough control flow followed by iterative enrichments, eventually yielding carefully generated syntactic structures and variables in a hierarchy. However, state-of-the-art large language models generate codes in a single pass, without intermediate warm-ups to reflect the structured thought process of \"outline-then-detail\". Inspired by the recent success of chain-of-thought prompting, we propose ChainCoder, a program synthesis language model that generates Python code progressively, i.e. from coarse to fine in multiple passes. We first decompose source code into layout frame components and accessory components via abstract syntax tree parsing to construct a hierarchical representation. We then reform our prediction target into a multi-pass objective, each pass generates a subsequence, which is concatenated in the hierarchy. Finally, a tailored transformer architecture is leveraged to jointly encode the natural language descriptions and syntactically aligned I/O data samples. Extensive evaluations show that ChainCoder outperforms state-of-the-arts, demonstrating that our progressive generation eases the reasoning procedure and guides the language model to generate higher-quality solutions. Our codes are available at: https://github.com/VITA-Group/ChainCoder.","url_abs":"https://arxiv.org/abs/2305.00909v4","url_pdf":"https://arxiv.org/pdf/2305.00909v4.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":"outline-then-details-syntactically-guided","repo_url":"https://github.com/vita-group/chaincoder","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"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":"program-synthesis","task_name":"Program Synthesis"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.00909","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.00909"}},"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/vita-group/chaincoder","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":2,"ran_honours":1,"ran":1,"unverified":5},"by_repo_kind":{"official":{"samples":9,"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":"a3e27bd1e8b628ed","entry":"Embedding","repo":"vita-group/chaincoder","repo_kind":"official","path":"model/transformer.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/model/transformer.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a3e27bd1e8b628ed"}},{"code_sha256_prefix":"b2470f4f0c09db41","entry":"get_masks","repo":"vita-group/chaincoder","repo_kind":"official","path":"model/transformer.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/model/transformer.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b2470f4f0c09db41"}},{"code_sha256_prefix":"5e4b02e5bc753357","entry":"similar","repo":"vita-group/chaincoder","repo_kind":"official","path":"create_data_step3_raw_to_codeAug.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/create_data_step3_raw_to_codeAug.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5e4b02e5bc753357"}},{"code_sha256_prefix":"9ef29a7930f6956c","entry":"top_k_top_p_filtering","repo":"vita-group/chaincoder","repo_kind":"official","path":"model/transformer.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/model/transformer.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9ef29a7930f6956c"}},{"code_sha256_prefix":"b6fdb4d96e812300","entry":"add_wrap","repo":"vita-group/chaincoder","repo_kind":"official","path":"create_data_step1_tokenize_vocab_and_raw.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/create_data_step1_tokenize_vocab_and_raw.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":"b6fdb4d96e812300"}},{"code_sha256_prefix":"9beb5daa445b8484","entry":"getMLP","repo":"vita-group/chaincoder","repo_kind":"official","path":"model/embedders.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/model/embedders.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":"9beb5daa445b8484"}},{"code_sha256_prefix":"200d75285c0c6bcc","entry":"get_model_tokenizer","repo":"vita-group/chaincoder","repo_kind":"official","path":"model/embedders.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/model/embedders.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":"200d75285c0c6bcc"}},{"code_sha256_prefix":"b63349d788143e3c","entry":"summarizer","repo":"vita-group/chaincoder","repo_kind":"official","path":"create_data_step3_raw_to_codeAug.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/create_data_step3_raw_to_codeAug.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":"b63349d788143e3c"}},{"code_sha256_prefix":"fa8c18242b863367","entry":"take_atleast_one_second","repo":"vita-group/chaincoder","repo_kind":"official","path":"create_data_step3_raw_to_codeAug.py","file_url":"https://github.com/vita-group/chaincoder/blob/HEAD/create_data_step3_raw_to_codeAug.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":"fa8c18242b863367"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}