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

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Lu, Ruofan, Huo, Yintong, Zhang, Meng, Li, Yichen, Lyu, Michael R.
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866916948590198784
author Lu, Ruofan
Huo, Yintong
Zhang, Meng
Li, Yichen
Lyu, Michael R.
author_facet Lu, Ruofan
Huo, Yintong
Zhang, Meng
Li, Yichen
Lyu, Michael R.
contents 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. The code is available at https://github.com/lurf21/NextEditPrediction.
format Preprint
id arxiv_https___arxiv_org_abs_2508_10074
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction History
Lu, Ruofan
Huo, Yintong
Zhang, Meng
Li, Yichen
Lyu, Michael R.
Software Engineering
Machine Learning
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. The code is available at https://github.com/lurf21/NextEditPrediction.
title Next Edit Prediction: Learning to Predict Code Edits from Context and Interaction History
topic Software Engineering
Machine Learning
url https://arxiv.org/abs/2508.10074