Search papers, labs, and topics across Lattice.
This paper investigates the verbosity of patches generated by large language models (LLMs) in automatic program repair (APR), revealing that even successful patches are significantly larger and more complex than those created by developers. By analyzing 28 state-of-the-art approaches, the authors find that the median generated patch exhibits 121.78% more total changes and 43.99% higher cyclomatic complexity compared to developer patches, highlighting a critical gap in current APR methodologies. To address this issue, they introduce RECAP, a post-generation patch refinement tool that effectively reduces patch size while maintaining or improving resolution, achieving a remarkable size-correctness tradeoff across multiple systems.
LLM-generated patches are not only larger but also more complex than human-written ones, and RECAP offers a solution that significantly reduces this verbosity without sacrificing effectiveness.
Large language models (LLMs) have advanced automatic program repair (APR) to the point where agentic systems routinely resolve real-world, repository-level issues. Yet the generated patch has received little scrutiny beyond whether it passes tests. In this paper, we identify patch verbosity as a major yet overlooked concern in LLM-based APR. Characterizing 28 state-of-the-art approaches on SWE-bench Verified, we find that even successful patches are consistently larger and more complex than developer patches, with the median approach producing 121.78% more total changes, 80.91% more net changes, and 43.99% higher cyclomatic complexity. We further show that this verbosity is rooted in capability-oriented design choices such as iterative refinement and broad context, and can hardly be reduced by surface-level controls such as output format or minimality prompts. Motivated by these findings, we formulate post-generation patch refinement and propose RECAP, a lightweight, plug-and-play adapter that attaches to existing repair frameworks after generation. RECAP's refiner is trained via supervised fine-tuning and direct preference optimization with distilled reasoning traces, on a dataset of patch pairs we construct from multiple sources. Across four host systems, prompting, commit-untangling, and minimality-aware baselines reduce patch size only by sacrificing 49 to 217 resolved instances. In contrast, RECAP achieves a substantially better size-correctness tradeoff, cutting average total changes from +242.14% to +4.24% and net changes from +348.24% to -39.75% relative to developer patches while preserving or improving resolution by up to 42 instances. Our results indicate that minimality cannot be simply reduced to syntactic compression, and that decoupling minimization from generation offers a practical path to more reviewable repairs.