Paper Reveals LLMs Avoid Code Deletion, Increasing Maintenance Costs

centre-for-swe · hf · 2026-08-05

A study on the top five models on the SWE-bench leaderboard reveals a significant "deletion avoidance" tendency when LLMs repair code. Even when the correct file is identified, models often hesitate to remove obsolete code, instead wrapping it in guards or fallbacks (a pattern termed Guard-and-Go).

The researchers curated CanItDelete, a benchmark specifically for deletion tasks. Results show that if tests strictly require the targeted code to be removed, the pass rate of frontier models drops sharply from 63.2% to 41.9%. The study suggests that explicitly teaching models "how to delete" during post-training can mitigate this issue and improve overall code-editing performance.

Original post →

More from coding & agent

coding & agent channel →