SmartPaste: Learning to Adapt Source Code
Not on the map. Why?
Abstract (arXiv)
Deep Neural Networks have been shown to succeed at a range of natural language tasks such as machine translation and text summarization. While tasks on source code (ie, formal languages) have been considered recently, most work in this area does not attempt to capitalize on the unique opportunities offered by its known syntax and structure. In this work, we introduce SmartPaste, a first task that requires to use such information. The task is a variant of the program repair problem that requires to adapt a given (pasted) snippet of code to surrounding, existing source code. As first solutions, we design a set of deep neural models that learn to represent the context of each variable location and variable usage in a data flow-sensitive way. Our evaluation suggests that our models can learn to solve the SmartPaste task in many cases, achieving 58.6% accuracy, while learning meaningful representation of variable usages.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). First posted on arXiv 22 May 2017.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 1; 2022: 3; 2023: 1; 2024: 0; 2025: 2; 2026: 1.
8 papers.
- 2022What is it like to program with artificial intelligence?cited by 39
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2022AdaptivePaste: Code Adaptation through Learning Semantics-aware Variable Usage Representationscited by 3
- 2022A Survey on Natural Language Processing for Programmingcited by 3
- 2021Assessing the Effectiveness of Syntactic Structure to Learn Code Edit Representationscited by 1
- 2025Wired for Reuse: Automating Context-Aware Code Adaptation in IDEs via LLM-Based Agentcited by 0
- 2025Smart Paste: Automatically Fixing Copy/Paste for Google Developerscited by 0
- 2026Coding in a Bubble? Evaluating LLMs in Resolving Context Adaptation Bugs During Code Adaptationcited by 0
- 2026Coding in a Bubble? Evaluating LLMs in Resolving Context Adaptation Bugs During Code Adaptation10 Jan 2026
- 2025Smart Paste: Automatically Fixing Copy/Paste for Google Developers4 Oct 2025
- 2025Wired for Reuse: Automating Context-Aware Code Adaptation in IDEs via LLM-Based Agent2 Jul 2025
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2022A Survey on Natural Language Processing for Programming12 Dec 2022
- 2022What is it like to program with artificial intelligence?12 Aug 2022
- 2022AdaptivePaste: Code Adaptation through Learning Semantics-aware Variable Usage Representations23 May 2022
- 2021Assessing the Effectiveness of Syntactic Structure to Learn Code Edit Representations11 Jun 2021