추가하는 것은 기계, 삭제하는 것은 인간: LLM 코드 편집에서의 삭제 회피 측정 및 완화
To Add Is Machine, To Delete Is Human: Measuring and Mitigating Deletion Avoidance in LLM Code Editing
July 30, 2026
저자: Amir M. Ebrahimi, Mohammed Mehedi Hasan, Aaditya Bhatia, Gopi Krishnan Rajbahadur, Ahmed E. Hassan
cs.AI
초록
대규모 언어 모델은 점점 더 프로덕션 코드를 작성하고 수리하지만, 테스트를 통과하는 패치가 코드베이스의 유지보수를 더 어렵게 만든다는 증거가 늘어나고 있다. 우리는 그 구체적인 원인 하나를 특정한다: 삭제 회피, 즉 의도된 수정이 제거를 요구하는 코드를 보존하려는 체계적 경향이다. 공식 SWE-bench Verified 리더보드의 상위 5개 모델을 대상으로 한 결과, 다섯 모델이 모두 해결하는 작업에서도 개발자 패치 대비 삭제 재현율은 최대 71.7%에 그친다. 모델들은 필요한 삭제 중 92% 이상에서 올바른 파일에 도달하지만, 정확한 줄을 잘라내는 경우는 52% 미만이다. 대신 통과한 패치 중 29.0%는 대상 코드를 가드나 폴백으로 감싸는데, 우리는 이를 Guard-and-Go 패턴이라고 부른다. 이러한 패치가 통과하는 이유는 원래 테스트가 삭제 여부를 거의 검사하지 않기 때문이다. 대상 코드가 남아 있으면 실패하는 테스트를 34개의 Verified 작업에 추가했을 때, 클로즈드 및 오픈 가중치를 아우르는 4개의 최첨단 모델은 63.2%에서 41.9%로 떨어진다. 실제 수정은 삭제와 추가가 섞여 있기 때문에, 우리는 전체 필수 수정이 삭제인 실제 커밋에서 추출한 200개 작업으로 구성된 벤치마크 CanItDelete를 구축했다. 추가 작업이 사라졌음에도 최고 모델은 여전히 다섯 작업 중 하나를 실패하며, 더 작은 오픈 모델은 성공률이 18.0%로 떨어진다. 그런 다음 GPT-5.6 Sol에 네 가지 누적 프롬프트를 적용하여 절제 실험을 수행한 결과, 정확한 줄을 제공하기 전까지 성공률은 거의 변하지 않는다. 정확한 줄 제공은 불완전한 삭제를 거의 제거하지만 성공률을 80.5%로만 높이는데, 모델이 범위를 넘어 삭제하거나 대신 코드를 추가하기 때문이다. 마지막으로 파일럿 연구를 통해 한 가지 잠재적 해결책을 제시한다: 후속 학습 중 삭제를 가르치면 삭제 회피가 줄어들고 더 넓은 코드 편집 성능이 향상된다. 이는 이러한 행동이 도달 불가능한 문제라기보다 충분히 학습되지 않은 문제임을 시사한다.
English
Large language models increasingly write and repair production code, yet evidence is mounting that their test-passing patches leave codebases harder to maintain. We identify one concrete source: deletion avoidance, the systematic tendency to retain code that an intended edit requires removing. Across the five leading models on the official SWE-bench Verified leaderboard, deletion recall against the developer patch reaches at most 71.7% even on tasks all five solve, and models reach the right file for over 92% of required deletions but cut the exact line in under 52% of cases. Instead, 29.0% of passing patches wrap the targeted code in a guard or fallback, a pattern we call Guard-and-Go. Such patches pass because the original tests rarely check removal: when we retrofit 34 Verified tasks with tests that fail if the targeted code remains, four frontier models spanning closed and open weights fall from 63.2% to 41.9%. Because real repairs mix removal with addition, we curate CanItDelete, a benchmark of 200 tasks mined from real commits whose entire required edit is deletion. Even with the addition work gone, the best model still fails one task in five, and smaller open models fall to 18.0%. We then ablate GPT-5.6 Sol under four cumulative prompts; success moves little until we supply the exact lines, which nearly eliminate incomplete deletion yet raise success only to 80.5% because the model then deletes beyond the spans or adds code instead. Finally, through a pilot study we show one potential fix: teaching deletion during post-training reduces deletion avoidance and improves broader code-editing performance, suggesting the behavior is undertrained rather than beyond reach.