Refine: A General Context-Aware Agent for Evolving Program Repair Agents

Anvith Pabba, Simin Chen, Alex Mathai, Anindya Chakraborty, Baishakhi Ray


Abstract
When applying LLM agents to automatic program repair (APR), existing systems often produce Draft Patches—partially correct fixes that either fail to fully resolve bugs or overfit public test cases due to incomplete contextual reasoning and limited test coverage. To address this, we present , a general context-aware refinement agent that evolves existing APR agents by transforming Draft Patches into robust and correct fixes. Operating in a black-box, plug-and-play manner, augments diverse APR systems without model retraining or architectural changes. tackles three challenges: (1) resolving ambiguous issue context through structured contextualization, (2) improving patch quality via test-time scaling and diversified generation, and (3) consolidating partial fixes through LLM-driven refinement. We integrate into multiple APR systems to demonstrate its generality and system-agnostic design. On SWE-Bench Lite, achieves state-of-the-art performance, improving AutoCodeRover by 14.67% to 51.67% resolution. %cOn SWE-Bench Verified, it improves resolution rates by 12.2%, while yielding an average 14% gain across diverse APR systems. These results identify refinement as a missing yet essential layer in APR pipelines and highlight agent-level refinement as a practical path toward more correct and robust program repair systems. We also open source our code : https://github.com/AnvithPabba/Refine-Program-Repair.
Anthology ID:
2026.findings-emnlp.210
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
4391–4409
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.210/
DOI:
Bibkey:
Cite (ACL):
Anvith Pabba, Simin Chen, Alex Mathai, Anindya Chakraborty, and Baishakhi Ray. 2026. Refine: A General Context-Aware Agent for Evolving Program Repair Agents. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 4391–4409, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Refine: A General Context-Aware Agent for Evolving Program Repair Agents (Pabba et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.210.pdf