EditLord: Learning Code Transformation Rules for Code Editing

Weichen Li, Albert Jan, Baishakhi Ray, Chengzhi Mao, Junfeng Yang +1 more
2/14/2026

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Code editing is a foundational task in software development, where its effectiveness depends on whether it introduces desired code property changes without changing the original code's intended functionality. Existing approaches often formulate code editing as an implicit end-to-end task, omitting the fact that code-editing procedures inherently consist of discrete and explicit steps. Thus, they suffer from suboptimal performance and lack of robustness and generalization. We introduce EditLord, a code editing framework that makes the code transformation steps explicit. Our key insight is to employ a language model (LM) as an inductive learner to extract code editing rules from the training code pairs as concise meta-rule sets. Such rule sets will be manifested for each training sample to augment them for finetuning or assist in prompting- and iterative-based code editing. EditLord outperforms the state-of-the-art by an average of 22.7% in editing performance and 58.1% in robustness while achieving 20.2% higher functional correctness across critical software engineering and security applications, LM models, and editing modes.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{li2026editlord,
  title  = {EditLord: Learning Code Transformation Rules for Code Editing},
  author = {Weichen Li and Albert Jan and Baishakhi Ray and Chengzhi Mao and Junfeng Yang and Kexin Pei},
  year   = {2026},
  eprint = {2504.15284},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2504.15284},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.15284.svg)](https://codeofpaper.com/paper/2504.15284)

Discussion