{"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/code-generation-as-a-dual-task-of-code","title":"Code Generation as a Dual Task of Code Summarization","arxiv_id":"1910.05923","date":"2019-10-14","proceeding":"NeurIPS 2019 12","authors":["Bolin Wei","Ge Li","Xin Xia","Zhiyi Fu","Zhi Jin"],"abstract":"Code summarization (CS) and code generation (CG) are two crucial tasks in the field of automatic software development. Various neural network-based approaches are proposed to solve these two tasks separately. However, there exists a specific intuitive correlation between CS and CG, which have not been exploited in previous work. In this paper, we apply the relations between two tasks to improve the performance of both tasks. In other words, exploiting the duality between the two tasks, we propose a dual training framework to train the two tasks simultaneously. In this framework, we consider the dualities on probability and attention weights, and design corresponding regularization terms to constrain the duality. We evaluate our approach on two datasets collected from GitHub, and experimental results show that our dual framework can improve the performance of CS and CG tasks over baselines.","url_abs":"https://arxiv.org/abs/1910.05923v1","url_pdf":"https://arxiv.org/pdf/1910.05923v1.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":"code-generation-as-a-dual-task-of-code","repo_url":"https://github.com/Bolin0215/CSCGDual","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"code-generation-as-a-dual-task-of-code","repo_url":"https://github.com/code-gen/cgcs","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"code-summarization-1","task_name":"Code Summarization"},{"task_slug":"code-summarization","task_name":"Source Code Summarization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1910.05923","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1910.05923"}},"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/code-gen/cgcs","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Bolin0215/CSCGDual","reach":null}],"summary":{"ran_honours":2,"ran_fixture":1,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1},"listed":{"samples":4,"ran":1,"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":3,"samples":[{"code_sha256_prefix":"d2ed25a42e05d009","entry":"input_transpose","repo":"Bolin0215/CSCGDual","repo_kind":"official","path":"nmt/model.py","file_url":"https://github.com/Bolin0215/CSCGDual/blob/HEAD/nmt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d2ed25a42e05d009"}},{"code_sha256_prefix":"6aaf07ccda31ac5f","entry":"repackage_hidden","repo":"code-gen/cgcs","repo_kind":"listed","path":"language_model/lm_train.py","file_url":"https://github.com/code-gen/cgcs/blob/HEAD/language_model/lm_train.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6aaf07ccda31ac5f"}},{"code_sha256_prefix":"a9090d706c05b137","entry":"tensor_transform","repo":"Bolin0215/CSCGDual","repo_kind":"official","path":"nmt/model.py","file_url":"https://github.com/Bolin0215/CSCGDual/blob/HEAD/nmt/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a9090d706c05b137"}},{"code_sha256_prefix":"bfd4a7f346c5a4e6","entry":"word2id","repo":"Bolin0215/CSCGDual","repo_kind":"official","path":"nmt/model.py","file_url":"https://github.com/Bolin0215/CSCGDual/blob/HEAD/nmt/model.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":"bfd4a7f346c5a4e6"}},{"code_sha256_prefix":"bbb1abc416d6331e","entry":"batchify","repo":"code-gen/cgcs","repo_kind":"listed","path":"language_model/lm_train.py","file_url":"https://github.com/code-gen/cgcs/blob/HEAD/language_model/lm_train.py","link_basis":"harvester_set","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":"bbb1abc416d6331e"}},{"code_sha256_prefix":"eea2e3f3d0c4b1c0","entry":"get_batch","repo":"code-gen/cgcs","repo_kind":"listed","path":"language_model/lm_train.py","file_url":"https://github.com/code-gen/cgcs/blob/HEAD/language_model/lm_train.py","link_basis":"harvester_set","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":"eea2e3f3d0c4b1c0"}},{"code_sha256_prefix":"bd07c5a783ad5f05","entry":"load_pt_glove","repo":"code-gen/cgcs","repo_kind":"listed","path":"loaders.py","file_url":"https://github.com/code-gen/cgcs/blob/HEAD/loaders.py","link_basis":"harvester_set","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":"bd07c5a783ad5f05"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}