Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction History

๐Ÿ“… 2025-08-13
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
Existing AI coding assistants exhibit a functional dichotomy: code completion models support only low-latency, cursor-local predictions, while chat-based editing requires manual intent specification and induces disruptive context switching. Neither paradigm actively models developersโ€™ sequential editing behavior. Method: We introduce the novel task of โ€œnext-edit prediction,โ€ which jointly forecasts both the location and content of the upcoming code modification. We propose the first interaction-history-aware editing sequence modeling framework, release a high-quality fine-tuning dataset and a dedicated evaluation benchmark, and employ large language models fine-tuned under supervision that jointly encodes code context and user interaction history. Contribution/Results: Experiments demonstrate substantial improvements in predicting continuous editing actions. Our approach advances programming assistants from passive response toward proactive collaboration, establishing a new paradigm for intelligent, behavior-aware programming assistance.

Technology Category

Humans and AI: Human-Aware Planning and Behavior PredictionNatural Language Processing: Code Generation / Program Synthesis from Natural LanguageCognitive Modeling & Cognitive Systems: Social Cognition And Interaction

Application Category

Search and Retrieval-Augmented AI: Assisted, interactive, and conversational searchSemantics and Knowledge: Data modeling to support human-machine intelligence, including LLMs agents, intelligent system behavior, explanations, and user-friendly interactionsUser Modeling, Personalization and Recommendation: Large Language Models (LLM) for user modeling and recommendation
๐Ÿ“ Abstract
The rapid advancement of large language models (LLMs) has led to the widespread adoption of AI-powered coding assistants integrated into a development environment. On one hand, low-latency code completion offers completion suggestions but is fundamentally constrained to the cursor's current position. On the other hand, chat-based editing can perform complex modifications, yet forces developers to stop their work, describe the intent in natural language, which causes a context-switch away from the code. This creates a suboptimal user experience, as neither paradigm proactively predicts the developer's next edit in a sequence of related edits. To bridge this gap and provide the seamless code edit suggestion, we introduce the task of Next Edit Prediction, a novel task designed to infer developer intent from recent interaction history to predict both the location and content of the subsequent edit. Specifically, we curate a high-quality supervised fine-tuning dataset and an evaluation benchmark for the Next Edit Prediction task. Then, we conduct supervised fine-tuning on a series of models and performed a comprehensive evaluation of both the fine-tuned models and other baseline models, yielding several novel findings. This work lays the foundation for a new interaction paradigm that proactively collaborate with developers by anticipating their following action, rather than merely reacting to explicit instructions.
Problem

Research questions and friction points this paper is trying to address.

Predicts next code edit from context and history
Bridges gap between low-latency and chat-based editing
Infers developer intent for seamless edit suggestions
Innovation

Methods, ideas, or system contributions that make the work stand out.

Predicts next code edit using interaction history
Uses supervised fine-tuning for model training
Proactively anticipates developer edits location and content
๐Ÿ”Ž Similar Papers
No similar papers found.