SECRLGMar 10, 2025

EditLord: Learning Code Transformation Rules for Code Editing

arXiv:2504.15284v47 citationsh-index: 21ICML
Originality Highly original
AI Analysis

This addresses the need for more robust and generalizable code editing tools in software development, representing a novel method rather than an incremental improvement.

The paper tackles the problem of code editing by introducing EditLord, a framework that learns explicit code transformation rules from training pairs, achieving an average 22.7% improvement in editing performance and 58.1% in robustness over state-of-the-art methods.

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.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes