ArXiv TLDR

SiblingRepair: Sibling-Based Multi-Hunk Repair with Large Language Models

🐦 Tweet
2605.06209

Xinyu Liu, Jiayu Ren, Yusen Wang, Qi Xin, Xiaoyuan Xie + 1 more

cs.SE

TLDR

SiblingRepair uses LLMs for multi-hunk program repair, outperforming SOTA by improving sibling detection and generating consistent patches across related code.

Key contributions

  • Addresses SOTA limitations (e.g., Hercules) in rigid sibling matching and template-based patch generation.
  • Discovers semantically related siblings using token/embedding matching, independent of commit history.
  • Utilizes LLMs to identify failure-relevant siblings and generate consistent patches via two strategies.
  • Substantially outperforms SOTA multi-hunk repair techniques, including Hercules, on benchmarks.

Why it matters

Automated repair for related code locations (siblings) is critical, yet current SOTA has rigid limitations. SiblingRepair leverages LLMs to flexibly identify siblings and generate consistent multi-hunk patches, significantly outperforming prior techniques. This advances program repair by enabling more effective and generalizable automated code fixes.

Original Abstract

Developers often make similar mistakes across code locations implementing related functionalities. These locations, called siblings, share similar issues and require similar fixes. Accurately identifying siblings and consistently repairing them are crucial for automated program repair. Hercules is a SOTA technique designed for sibling repair. However, it is limited by strong assumptions about sibling locations and commit-history availability, rigid AST-based sibling matching, and inflexible template-based patch generation. To address these limitations, we present SiblingRepair, a new LLM-based multi-hunk APR technique specialized for sibling repair. Starting from a suspicious location identified by spectrum-based fault localization, SiblingRepair searches for semantically related sibling candidates using token- and embedding-based code matching, without restricting discovery to failing-test coverage or commit history. It then uses an LLM to identify failure-relevant siblings and generate consistent patches through two complementary strategies: simultaneous repair, which jointly repairs siblings, and iterative repair, which progressively analyzes candidates for patch construction. SiblingRepair further preserves promising patches generated from earlier suspicious locations and combines them into generalized multi-hunk patches. We evaluate SiblingRepair on the Defects4J and GHRB benchmarks. The results show that SiblingRepair substantially outperforms SOTA multi-hunk repair techniques including Hercules. Our evaluation further demonstrates its repair efficiency, the effectiveness of its sibling detection and repair components, and limited impact of the LLM data leakage on the results. Overall, SiblingRepair advances automated sibling and general multi-hunk repair.

📬 Weekly AI Paper Digest

Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.