LLMs for Code: Faithful and Minimal Code Editing
Every patch passes the tests, but edit fidelity varies widely.LLMs are increasingly asked to edit code that already exists, not just to write it from scratch. There, correctness alone is not enough: a good repair should also be minimal, reviewable, and faithful to the original implementation. This project looks beyond whether generated code passes the tests and asks how faithfully models edit what is already there.
In When Models Edit Too Much: On the Fidelity of Minimal Code Edits (EMNLP 2026), we study over-editing: repairs that pass the tests but change far more code than the bug requires. We build a benchmark from 400 BigCodeBench problems with injected AST-level corruptions, so that the minimal patch is known by construction, and score repairs on Pass@1, excess edit distance, and added cognitive complexity. Over-editing is widespread even among frontier models, a single preservation instruction helps substantially, and reinforcement learning teaches minimal editing that generalizes out of domain better than supervised fine-tuning. The over-editing repository provides the benchmark, evaluation, and training code.
