Learning Python Code Suggestion with a Sparse Pointer Network
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). First posted on arXiv 24 Nov 2016.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 4; 2022: 3; 2023: 3; 2024: 0; 2025: 1; 2026: 1.
12 papers.
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
- 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphscited by 30
- 2023The Larger They Are, the Harder They Fail: Language Models do not Recognize Identifier Swaps in Pythoncited by 29
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
- 2022A Survey of Deep Learning Models for Structural Code Understandingcited by 4
- 2021Senatus -- A Fast and Accurate Code-to-Code Recommendation Enginecited by 3
- 2022NeuDep: Neural Binary Memory Dependence Analysiscited by 3
- 2023Neural Machine Translation for Code Generationcited by 3
- 2023Deduplicating and Ranking Solution Programs for Suggesting Reference Solutionscited by 1
- 2021Borrowing from Similar Code: A Deep Learning NLP-Based Approach for Log Statement Automationcited by 0
- 2022Code Sophistication: From Code Recommendation to Logic Recommendationcited by 0
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond26 Mar 2025
- 2023Deduplicating and Ranking Solution Programs for Suggesting Reference Solutions16 Jul 2023
- 2023The Larger They Are, the Harder They Fail: Language Models do not Recognize Identifier Swaps in Python24 May 2023
- 2023Neural Machine Translation for Code Generation22 May 2023
- 2022NeuDep: Neural Binary Memory Dependence Analysis4 Oct 2022
- 2022A Survey of Deep Learning Models for Structural Code Understanding3 May 2022
- 2022Code Sophistication: From Code Recommendation to Logic Recommendation19 Jan 2022
- 2021Borrowing from Similar Code: A Deep Learning NLP-Based Approach for Log Statement Automation2 Dec 2021
- 2021Senatus -- A Fast and Accurate Code-to-Code Recommendation Engine5 Nov 2021
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Context21 Mar 2021
- 2021Code Completion by Modeling Flattened Abstract Syntax Trees as Graphs17 Mar 2021