{"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/self-infilling-code-generation","title":"Self-Infilling Code Generation","arxiv_id":"2311.17972","date":"2023-11-29","proceeding":null,"authors":["Lin Zheng","Jianbo Yuan","Zhi Zhang","Hongxia Yang","Lingpeng Kong"],"abstract":"This work introduces self-infilling code generation, a general framework that incorporates infilling operations into auto-regressive decoding. Our approach capitalizes on the observation that recent infilling-capable code language models can self-infill: whereas infilling operations aim to fill in the middle based on a predefined prefix and suffix, self-infilling sequentially generates both such surrounding context and the infilled content. We utilize this capability to introduce novel interruption and looping mechanisms in conventional decoding, evolving it into a non-monotonic process. Interruptions allow for postponing the generation of specific code until a definitive suffix is established, enhancing control over the output. Meanwhile, the looping mechanism, which leverages the complementary nature of self-infilling and left-to-right decoding, can iteratively update and synchronize each piece of generation cyclically. Extensive experiments are conducted to demonstrate that our proposed decoding process is effective in enhancing both regularity and quality across several code generation benchmarks.","url_abs":"https://arxiv.org/abs/2311.17972v3","url_pdf":"https://arxiv.org/pdf/2311.17972v3.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":"self-infilling-code-generation","repo_url":"https://github.com/LZhengisme/self-infilling","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.17972","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.17972"}},"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/LZhengisme/self-infilling","reach":null}],"summary":{"ran_draft_wrong":6,"unverified":1},"by_repo_kind":{"official":{"samples":7,"ran":6,"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":7,"samples":[{"code_sha256_prefix":"c02f953aa555f545","entry":"build_fim_sentinel_dict","repo":"LZhengisme/self-infilling","repo_kind":"official","path":"lm_eval/generation_pipelines/self_infill_utils.py","file_url":"https://github.com/LZhengisme/self-infilling/blob/HEAD/lm_eval/generation_pipelines/self_infill_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c02f953aa555f545"}},{"code_sha256_prefix":"7de75b34553621e8","entry":"build_l2r_prompt","repo":"LZhengisme/self-infilling","repo_kind":"official","path":"lm_eval/generation_pipelines/self_infill_utils.py","file_url":"https://github.com/LZhengisme/self-infilling/blob/HEAD/lm_eval/generation_pipelines/self_infill_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7de75b34553621e8"}},{"code_sha256_prefix":"4a296703e4fa9be7","entry":"build_si_prompt","repo":"LZhengisme/self-infilling","repo_kind":"official","path":"lm_eval/generation_pipelines/self_infill_utils.py","file_url":"https://github.com/LZhengisme/self-infilling/blob/HEAD/lm_eval/generation_pipelines/self_infill_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4a296703e4fa9be7"}},{"code_sha256_prefix":"9847f7e2d01710d9","entry":"compact_lines","repo":"LZhengisme/self-infilling","repo_kind":"official","path":"lm_eval/generation_pipelines/self_infill_utils.py","file_url":"https://github.com/LZhengisme/self-infilling/blob/HEAD/lm_eval/generation_pipelines/self_infill_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9847f7e2d01710d9"}},{"code_sha256_prefix":"0667bc404516e99a","entry":"rstrip_prompt","repo":"LZhengisme/self-infilling","repo_kind":"official","path":"lm_eval/generation_pipelines/self_infill_utils.py","file_url":"https://github.com/LZhengisme/self-infilling/blob/HEAD/lm_eval/generation_pipelines/self_infill_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0667bc404516e99a"}},{"code_sha256_prefix":"78f451db0be8f242","entry":"self_infill_split","repo":"LZhengisme/self-infilling","repo_kind":"official","path":"lm_eval/generation_pipelines/self_infill_utils.py","file_url":"https://github.com/LZhengisme/self-infilling/blob/HEAD/lm_eval/generation_pipelines/self_infill_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"78f451db0be8f242"}},{"code_sha256_prefix":"05e17b83fb506a8d","entry":"self_infill_completion","repo":"LZhengisme/self-infilling","repo_kind":"official","path":"lm_eval/generation_pipelines/self_infill_utils.py","file_url":"https://github.com/LZhengisme/self-infilling/blob/HEAD/lm_eval/generation_pipelines/self_infill_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"05e17b83fb506a8d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}