{"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/cert-continual-pre-training-on-sketches-for","title":"CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generation","arxiv_id":"2206.06888","date":"2022-06-14","proceeding":null,"authors":["Daoguang Zan","Bei Chen","Dejian Yang","Zeqi Lin","Minsu Kim","Bei guan","Yongji Wang","Weizhu Chen","Jian-Guang Lou"],"abstract":"Code generation is a longstanding challenge, aiming to generate a code snippet based on a natural language description. Usually, expensive text-code paired data is essential for training a code generation model. Recently, thanks to the success of pre-training techniques, large language models are trained on large-scale unlabelled code corpora and perform well in code generation. In this paper, we investigate how to leverage an unlabelled code corpus to train a model for library-oriented code generation. Since it is a common practice for programmers to reuse third-party libraries, in which case the text-code paired data are harder to obtain due to the huge number of libraries. We observe that library-oriented code snippets are more likely to share similar code sketches. Hence, we present CERT with two steps: a sketcher generates the sketch, then a generator fills the details in the sketch. Both the sketcher and the generator are continually pre-trained upon a base model using unlabelled data. Furthermore, we craft two benchmarks named PandasEval and NumpyEval to evaluate library-oriented code generation. Experimental results demonstrate the impressive performance of CERT. For example, it surpasses the base model by an absolute 15.67% improvement in terms of pass@1 on PandasEval. Our work is available at https://github.com/microsoft/PyCodeGPT.","url_abs":"https://arxiv.org/abs/2206.06888v1","url_pdf":"https://arxiv.org/pdf/2206.06888v1.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":"cert-continual-pre-training-on-sketches-for","repo_url":"https://github.com/microsoft/pycodegpt","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":"library-oriented-code-generation","task_name":"Library-Oriented Code Generation"}],"methods":[{"method_slug":"base","method_name":"BASE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2206.06888","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2206.06888"}},"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/microsoft/pycodegpt","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/microsoft/PyCodeGPT","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"ran_fixture":2,"ran_draft_wrong":1,"unverified":4},"by_repo_kind":{"official":{"samples":10,"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":0,"samples":[{"code_sha256_prefix":"9a98005a158c5a7f","entry":"CodeGenConfig","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.py","link_basis":"first_harvest_node","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":"9a98005a158c5a7f"}},{"code_sha256_prefix":"54ceacab7967b07f","entry":"CodeGenMLP","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"54ceacab7967b07f"}},{"code_sha256_prefix":"0c1bb45c5236e470","entry":"CodeGenPreTrainedModel","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.py","link_basis":"first_harvest_node","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":"0c1bb45c5236e470"}},{"code_sha256_prefix":"e206028c02336479","entry":"apply_rotary_pos_emb","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e206028c02336479"}},{"code_sha256_prefix":"d586789103877809","entry":"fixed_pos_embedding","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d586789103877809"}},{"code_sha256_prefix":"965428aef96cf65e","entry":"rotate_every_two","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"965428aef96cf65e"}},{"code_sha256_prefix":"b4b48d095d30d89f","entry":"CodeGenAttention","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.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":"b4b48d095d30d89f"}},{"code_sha256_prefix":"214a0ce860b0d7f9","entry":"CodeGenBlock","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.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":"214a0ce860b0d7f9"}},{"code_sha256_prefix":"f345d1ad92797f35","entry":"CodeGenForCausalLM","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.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":"f345d1ad92797f35"}},{"code_sha256_prefix":"5c007506c5e12ee8","entry":"CodeGenModel","repo":"microsoft/PyCodeGPT","repo_kind":"official","path":"apicoder/CodeGenAPI/nl2code/modeling_codegen.py","file_url":"https://github.com/microsoft/PyCodeGPT/blob/HEAD/apicoder/CodeGenAPI/nl2code/modeling_codegen.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":"5c007506c5e12ee8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}