Papers › Learning Python Code Suggestion with a Sparse Pointer Network

Learning Python Code Suggestion with a Sparse Pointer Network

24 Nov 2016arXiv:1611.08307archive 2025-07-28

Avishkar Bhoopchand, Tim Rocktäschel, Earl Barr, Sebastian Riedel

To enhance developer productivity, all modern integrated development environments (IDEs) include code suggestion functionality that proposes likely next tokens at the cursor. While current IDEs work well for statically-typed languages, their reliance on type annotations means that they do not provide the same level of support for dynamic programming languages as for statically-typed languages. Moreover, suggestion engines in modern IDEs do not propose expressions or multi-statement idiomatic code. Recent work has shown that language models can improve code suggestion systems by learning from software repositories. This paper introduces a neural language model with a sparse pointer network aimed at capturing very long-range dependencies. We release a large-scale code suggestion corpus of 41M lines of Python code crawled from GitHub. On this corpus, we found standard neural language models to perform well at suggesting local phenomena, but struggle to refer to identifiers that are introduced many tokens in the past. By augmenting a neural language model with a pointer network specialized in referring to predefined classes of identifiers, we obtain a much lower perplexity and a 5 percentage points increase in accuracy for code suggestion compared to an LSTM baseline. In fact, this increase in code suggestion accuracy is due to a 13 times more accurate prediction of identifiers. Furthermore, a qualitative analysis shows this model indeed captures interesting long-range dependencies, like referring to a class member defined over 60 tokens in the past.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1611.08307")

Code

Syntology Ran 4 of 9 code samples harvested from 2 repositories linked to this paper; 5 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 1 ran · fixture could not drive it; 1 ran with no contract checked.

By repository: official repository: 5 samples from 1 repository, 0 ran; community (archive-listed): 4 samples from 1 repository, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

uclmr/pycodesuggest officialmentioned in papermentioned on GitHubtfMIT report
Avmb/code-docstring-corpus mentioned on GitHub report
SamuelGabriel/R252 mentioned on GitHubtf report
uclnlp/pycodesuggest mentioned on GitHubtf report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 4 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
1ran · fixture could not drive it
1ran
5unverified

Licence: 0 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

check_duplicates uclmr/pycodesuggest/github-scraper/processFiles.py official repository unverified MIT (permissive) · 15b1ab9da68f5ce2 · report
get_position uclmr/pycodesuggest/github-scraper/astwalker.py official repository unverified MIT (permissive) · a6b4c3bfba079b22 · report
get_source_tree uclmr/pycodesuggest/github-scraper/normalisation.py official repository unverified MIT (permissive) · 316f1ff96e8a3964 · report
read_data uclmr/pycodesuggest/github-scraper/processFiles.py official repository unverified MIT (permissive) · 3e636a771fe0e881 · report
replace_source uclmr/pycodesuggest/github-scraper/normalisation.py official repository unverified MIT (permissive) · 074cae12ca9e9f50 · report
construct_feed_dict uclnlp/pycodesuggest/lm/Trainer.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · 21ecd560e4d4c5d4 · report
create_repos uclnlp/pycodesuggest/github-scraper/scraper.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · cafacac10b08f067 · report
get_evals uclnlp/pycodesuggest/lm/Trainer.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 46b2d065f3655464 · report
get_initial_state uclnlp/pycodesuggest/lm/Trainer.py community (archive-listed) ran MIT (permissive) · 9dd711194f468a2d · report

Tasks

Language ModelingLanguage Modelling

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

LSTMPointer NetworkSigmoid ActivationSoftmaxTanh Activation

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections