EfficientEdit: Accelerating Code Editing via Edit-Oriented Speculative Decoding

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wang, Peiding, Zhang, Li, Liu, Fang, Zhu, Yinghao, Xu, Wang, Shi, Lin, Lian, Xiaoli, Li, Minxiao, Shen, Bo, Fu, An
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912616489680896
author Wang, Peiding
Zhang, Li
Liu, Fang
Zhu, Yinghao
Xu, Wang
Shi, Lin
Lian, Xiaoli
Li, Minxiao
Shen, Bo
Fu, An
author_facet Wang, Peiding
Zhang, Li
Liu, Fang
Zhu, Yinghao
Xu, Wang
Shi, Lin
Lian, Xiaoli
Li, Minxiao
Shen, Bo
Fu, An
contents Large Language Models (LLMs) have demonstrated remarkable capabilities in code editing, substantially enhancing software development productivity. However, the inherent complexity of code editing tasks forces existing approaches to rely on LLMs' autoregressive end-to-end generation, where decoding speed plays a critical role in efficiency. While inference acceleration techniques like speculative decoding are applied to improve the decoding efficiency, these methods fail to account for the unique characteristics of code editing tasks where changes are typically localized and existing code segments are reused. To address this limitation, we propose EfficientEdit, a novel method that improves LLM-based code editing efficiency through two key mechanisms based on speculative decoding: (1) effective reuse of original code segments while identifying potential edit locations, and (2) efficient generate edit content via high-quality drafts from edit-oriented draft models and a dynamic verification mechanism that balances quality and acceleration. Experimental results show that EfficientEdit can achieve up to 10.38$\times$ and 13.09$\times$ speedup compared to standard autoregressive decoding in CanItEdit and CodeIF-Bench, respectively, outperforming state-of-the-art inference acceleration approaches by up to 90.6%. The code and data are available at https://github.com/zhu-zhu-ding/EfficientEdit.
format Preprint
id arxiv_https___arxiv_org_abs_2506_02780
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle EfficientEdit: Accelerating Code Editing via Edit-Oriented Speculative Decoding
Wang, Peiding
Zhang, Li
Liu, Fang
Zhu, Yinghao
Xu, Wang
Shi, Lin
Lian, Xiaoli
Li, Minxiao
Shen, Bo
Fu, An
Software Engineering
Large Language Models (LLMs) have demonstrated remarkable capabilities in code editing, substantially enhancing software development productivity. However, the inherent complexity of code editing tasks forces existing approaches to rely on LLMs' autoregressive end-to-end generation, where decoding speed plays a critical role in efficiency. While inference acceleration techniques like speculative decoding are applied to improve the decoding efficiency, these methods fail to account for the unique characteristics of code editing tasks where changes are typically localized and existing code segments are reused. To address this limitation, we propose EfficientEdit, a novel method that improves LLM-based code editing efficiency through two key mechanisms based on speculative decoding: (1) effective reuse of original code segments while identifying potential edit locations, and (2) efficient generate edit content via high-quality drafts from edit-oriented draft models and a dynamic verification mechanism that balances quality and acceleration. Experimental results show that EfficientEdit can achieve up to 10.38$\times$ and 13.09$\times$ speedup compared to standard autoregressive decoding in CanItEdit and CodeIF-Bench, respectively, outperforming state-of-the-art inference acceleration approaches by up to 90.6%. The code and data are available at https://github.com/zhu-zhu-ding/EfficientEdit.
title EfficientEdit: Accelerating Code Editing via Edit-Oriented Speculative Decoding
topic Software Engineering
url https://arxiv.org/abs/2506.02780