{"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/retrieval-augmented-code-generation-and","title":"Retrieval Augmented Code Generation and Summarization","arxiv_id":"2108.11601","date":"2021-08-26","proceeding":"Findings (EMNLP) 2021 11","authors":["Md Rizwan Parvez","Wasi Uddin Ahmad","Saikat Chakraborty","Baishakhi Ray","Kai-Wei Chang"],"abstract":"Software developers write a lot of source code and documentation during software development. Intrinsically, developers often recall parts of source code or code summaries that they had written in the past while implementing software or documenting them. To mimic developers' code or summary generation behavior, we propose a retrieval augmented framework, REDCODER, that retrieves relevant code or summaries from a retrieval database and provides them as a supplement to code generation or summarization models. REDCODER has a couple of uniqueness. First, it extends the state-of-the-art dense retrieval technique to search for relevant code or summaries. Second, it can work with retrieval databases that include unimodal (only code or natural language description) or bimodal instances (code-description pairs). We conduct experiments and extensive analysis on two benchmark datasets of code generation and summarization in Java and Python, and the promising results endorse the effectiveness of our proposed retrieval augmented framework.","url_abs":"https://arxiv.org/abs/2108.11601v2","url_pdf":"https://arxiv.org/pdf/2108.11601v2.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":"retrieval-augmented-code-generation-and","repo_url":"https://github.com/rizwan09/redcoder","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"retrieval-augmented-code-generation-and","repo_url":"https://github.com/kagnlp/CodeGenerator","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","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":"retrieval","task_name":"Retrieval"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/code-generation-on-concode","task":"Code Generation","dataset":"CONCODE","model":"Redcoder-ext","rank_in_archive_order":1,"of":2,"metrics":{"BLEU":"42.5","CodeBLEU":"43.4","Exact Match":"23.4"},"uses_additional_data":false},{"leaderboard":"/sota/code-generation-on-codexglue-codesearchnet","task":"Code Generation","dataset":"CodeXGLUE - CodeSearchNet","model":"Redcoder-ext","rank_in_archive_order":1,"of":2,"metrics":{"Java/BLEU":"28.98","Java/CodeBLEU":"33.18","Java/EM":"10.21","Python/BLEU":"24.43","Python/CodeBLEU":"30.21","Python/EM":"9.61"},"uses_additional_data":true}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2108.11601","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.11601"}},"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/kagnlp/CodeGenerator","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rizwan09/redcoder","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran_honours":1,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":3,"ran":2,"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":"37b63f7e859b05e6","entry":"count_file_lines","repo":"rizwan09/redcoder","repo_kind":"official","path":"SCODE-G/code_to_text/dpr_process.py","file_url":"https://github.com/rizwan09/redcoder/blob/HEAD/SCODE-G/code_to_text/dpr_process.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":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"37b63f7e859b05e6"}},{"code_sha256_prefix":"a78bc2e70d6d5dd9","entry":"get_masked_sent","repo":"rizwan09/redcoder","repo_kind":"official","path":"SCODE-G/code_to_text/dpr_process.py","file_url":"https://github.com/rizwan09/redcoder/blob/HEAD/SCODE-G/code_to_text/dpr_process.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a78bc2e70d6d5dd9"}},{"code_sha256_prefix":"29110d0c54b68187","entry":"load_passages","repo":"rizwan09/redcoder","repo_kind":"official","path":"SCODE-R/dense_retriever.py","file_url":"https://github.com/rizwan09/redcoder/blob/HEAD/SCODE-R/dense_retriever.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"29110d0c54b68187"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}