Reproduce “Code Completion with Neural Attention and Pointer Networks” on OpenResearch
Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Jian Li, Yue Wang, Michael R. Lyu, Irwin King
Researchers at The Chinese University of Hong Kong introduced an attentional Long Short-Term Memory (LSTM) network with a tailored parent attention mechanism and a pointer mixture network to enhance code completion for dynamically-typed languages. This model effectively addresses long-range dependencies and out-of-vocabulary words, achieving improved accuracy on JavaScript and Python benchmarks for predicting both next node types and values.
Key insights
- Incorporating AST structural information through a specific 'parent attention' mechanism in an attentional LSTM significantly improves the model's ability to handle long-range dependencies, particularly beneficial for next node type prediction.
- A hybrid generation-copying approach, like the pointer mixture network, provides an effective solution to the out-of-vocabulary problem in code, by intelligently choosing between generating common words and copying locally relevant unique identifiers.
- The attention scores learned for context attention can be effectively reused as the pointer distribution in the local pointer component, enabling the model to intelligently identify relevant terms to copy from the local context.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.