A Retrieve-and-Edit Framework for Predicting Structured Outputs
Tatsunori B. Hashimoto, Kelvin Guu, Yonatan Oren, Percy Liang

TL;DR
This paper introduces a retrieve-and-edit framework that improves structured output generation, like code and game data, by retrieving similar examples and editing them, leading to better performance without complex retriever training.
Contribution
It presents a novel, efficient retrieval method that embeds inputs task-dependently, enhancing sequence-to-sequence models for structured output tasks without joint retriever-editor training.
Findings
Significant performance improvements on GitHub Python code autocomplete.
Enhanced results on Hearthstone cards benchmark.
Framework is adaptable to any base model.
Abstract
For the task of generating complex outputs such as source code, editing existing outputs can be easier than generating complex outputs from scratch. With this motivation, we propose an approach that first retrieves a training example based on the input (e.g., natural language description) and then edits it to the desired output (e.g., code). Our contribution is a computationally efficient method for learning a retrieval model that embeds the input in a task-dependent way without relying on a hand-crafted metric or incurring the expense of jointly training the retriever with the editor. Our retrieve-and-edit framework can be applied on top of any base model. We show that on a new autocomplete task for GitHub Python code and the Hearthstone cards benchmark, retrieve-and-edit significantly boosts the performance of a vanilla sequence-to-sequence model on both tasks.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Web Data Mining and Analysis · Advanced Malware Detection Techniques
