{"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/learning-python-code-suggestion-with-a-sparse","title":"Learning Python Code Suggestion with a Sparse Pointer Network","arxiv_id":"1611.08307","date":"2016-11-24","proceeding":null,"authors":["Avishkar Bhoopchand","Tim Rocktäschel","Earl Barr","Sebastian Riedel"],"abstract":"To enhance developer productivity, all modern integrated development\nenvironments (IDEs) include code suggestion functionality that proposes likely\nnext tokens at the cursor. While current IDEs work well for statically-typed\nlanguages, their reliance on type annotations means that they do not provide\nthe same level of support for dynamic programming languages as for\nstatically-typed languages. Moreover, suggestion engines in modern IDEs do not\npropose expressions or multi-statement idiomatic code. Recent work has shown\nthat language models can improve code suggestion systems by learning from\nsoftware repositories. This paper introduces a neural language model with a\nsparse pointer network aimed at capturing very long-range dependencies. We\nrelease a large-scale code suggestion corpus of 41M lines of Python code\ncrawled from GitHub. On this corpus, we found standard neural language models\nto perform well at suggesting local phenomena, but struggle to refer to\nidentifiers that are introduced many tokens in the past. By augmenting a neural\nlanguage model with a pointer network specialized in referring to predefined\nclasses of identifiers, we obtain a much lower perplexity and a 5 percentage\npoints increase in accuracy for code suggestion compared to an LSTM baseline.\nIn fact, this increase in code suggestion accuracy is due to a 13 times more\naccurate prediction of identifiers. Furthermore, a qualitative analysis shows\nthis model indeed captures interesting long-range dependencies, like referring\nto a class member defined over 60 tokens in the past.","url_abs":"http://arxiv.org/abs/1611.08307v1","url_pdf":"http://arxiv.org/pdf/1611.08307v1.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":"learning-python-code-suggestion-with-a-sparse","repo_url":"https://github.com/uclmr/pycodesuggest","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"learning-python-code-suggestion-with-a-sparse","repo_url":"https://github.com/Avmb/code-docstring-corpus","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"unanswered"}},{"paper_slug":"learning-python-code-suggestion-with-a-sparse","repo_url":"https://github.com/EdinburghNLP/code-docstring-corpus","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null},{"paper_slug":"learning-python-code-suggestion-with-a-sparse","repo_url":"https://github.com/SamuelGabriel/R252","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"learning-python-code-suggestion-with-a-sparse","repo_url":"https://github.com/uclnlp/pycodesuggest","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"lstm","method_name":"LSTM"},{"method_slug":"pointer-net","method_name":"Pointer Network"},{"method_slug":"sigmoid-activation","method_name":"Sigmoid Activation"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"tanh-activation","method_name":"Tanh Activation"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=1611.08307","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1611.08307"}},"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/EdinburghNLP/code-docstring-corpus","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/uclnlp/pycodesuggest","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Avmb/code-docstring-corpus","reach":{"status":"unanswered"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/SamuelGabriel/R252","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/uclmr/pycodesuggest","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":1,"ran_draft_wrong":2,"ran":1,"unverified":5},"by_repo_kind":{"official":{"samples":5,"ran":0,"repositories":1},"listed":{"samples":4,"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":"21ecd560e4d4c5d4","entry":"construct_feed_dict","repo":"uclnlp/pycodesuggest","repo_kind":"listed","path":"lm/Trainer.py","file_url":"https://github.com/uclnlp/pycodesuggest/blob/HEAD/lm/Trainer.py","link_basis":"first_harvest_node","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":"21ecd560e4d4c5d4"}},{"code_sha256_prefix":"cafacac10b08f067","entry":"create_repos","repo":"uclnlp/pycodesuggest","repo_kind":"listed","path":"github-scraper/scraper.py","file_url":"https://github.com/uclnlp/pycodesuggest/blob/HEAD/github-scraper/scraper.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cafacac10b08f067"}},{"code_sha256_prefix":"46b2d065f3655464","entry":"get_evals","repo":"uclnlp/pycodesuggest","repo_kind":"listed","path":"lm/Trainer.py","file_url":"https://github.com/uclnlp/pycodesuggest/blob/HEAD/lm/Trainer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"46b2d065f3655464"}},{"code_sha256_prefix":"9dd711194f468a2d","entry":"get_initial_state","repo":"uclnlp/pycodesuggest","repo_kind":"listed","path":"lm/Trainer.py","file_url":"https://github.com/uclnlp/pycodesuggest/blob/HEAD/lm/Trainer.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":"9dd711194f468a2d"}},{"code_sha256_prefix":"15b1ab9da68f5ce2","entry":"check_duplicates","repo":"uclmr/pycodesuggest","repo_kind":"official","path":"github-scraper/processFiles.py","file_url":"https://github.com/uclmr/pycodesuggest/blob/HEAD/github-scraper/processFiles.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":"15b1ab9da68f5ce2"}},{"code_sha256_prefix":"a6b4c3bfba079b22","entry":"get_position","repo":"uclmr/pycodesuggest","repo_kind":"official","path":"github-scraper/astwalker.py","file_url":"https://github.com/uclmr/pycodesuggest/blob/HEAD/github-scraper/astwalker.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":"a6b4c3bfba079b22"}},{"code_sha256_prefix":"316f1ff96e8a3964","entry":"get_source_tree","repo":"uclmr/pycodesuggest","repo_kind":"official","path":"github-scraper/normalisation.py","file_url":"https://github.com/uclmr/pycodesuggest/blob/HEAD/github-scraper/normalisation.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":"316f1ff96e8a3964"}},{"code_sha256_prefix":"3e636a771fe0e881","entry":"read_data","repo":"uclmr/pycodesuggest","repo_kind":"official","path":"github-scraper/processFiles.py","file_url":"https://github.com/uclmr/pycodesuggest/blob/HEAD/github-scraper/processFiles.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":"3e636a771fe0e881"}},{"code_sha256_prefix":"074cae12ca9e9f50","entry":"replace_source","repo":"uclmr/pycodesuggest","repo_kind":"official","path":"github-scraper/normalisation.py","file_url":"https://github.com/uclmr/pycodesuggest/blob/HEAD/github-scraper/normalisation.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":"074cae12ca9e9f50"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}