Co-PatcheR: Collaborative Software Patching with Component(s)-specific Small Reasoning Models
Yuheng Tang, Hongwei Li, Kaijie Zhu, Michael Yang, Yangruibo Ding, Wenbo Guo · 2025
Read Co-PatcheR: Collaborative Software Patching with Component(s)-specific Small Reasoning Models by Yuheng Tang, Hongwei Li, Kaijie Zhu, Michael Yang, Yangruibo Ding, Wenbo Guo (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-18955.txt.
Introduction
Yuheng Tang, Hongwei Li, Kaijie Zhu, Michael Yang, Yangruibo Ding, and Wenbo Guo split the job of fixing software bugs among a team of small, specialized reasoning models. Patching has three distinct stages, finding the faulty lines, writing the fix, and checking it, and one small model stretched across all three does poorly. Their system, Co-PatcheR, trains separate models for each stage instead.
Localization narrows to suspicious lines in two steps, generation pairs drafting with self-critique, and validation uses two models that write bug-reproducing tests and judge correctness, settled by majority vote. On the SWE-bench Verified benchmark the system resolved forty-six percent of issues using three fourteen-billion-parameter models, the best result among specialized patchers and with the least training cost. Ablations back the design choices on data size, model size, and test-time scaling.
Catalog record
| CREATOR | Yuheng Tang, Hongwei Li, Kaijie Zhu, Michael Yang, Yangruibo Ding, Wenbo Guo |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 79 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2505-18955
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Co-PatcheR: Collaborative Software Patching with Component(s)-specific Small Reasoning Models Yuheng Tang, Hongwei Li, Kaijie Zhu, Michael Yang, Yangruibo Ding, Wenbo Guo Abstract Motivated by the success of general - purpose large language models (LLMs) in software patching, recent works started to train specialized patching models. Most works trained one model to handle the end - to - end patching pipeline (including issue localization, patch generation, and patch validation). However, it is hard for a small model to handle all tasks, as different sub-tasks have different workflows and require different expertise. As such, by using a 70 70 billion model, SOTA methods can only reach up to 41 41 % resolved rate on SWE-bench-Verified. Motivated by the collaborative nature, we propose Co-PatcheR, the first collaborative patching system with small and specialized reasoning models for individual components. Our key technique novelties are the specific task designs and training recipes. First, we train a model for localization and patch generation. Our localization pinpoints the suspicious lines through a two-step procedure, and our generation combines patch generation and critique. We then propose a hybrid patch validation that includes two models for crafting issue-reproducing test cases with and without assertions and judging patch correctness, followed by a majority vote-based patch selection. Through extensive evaluation, we show that Co-PatcheR achieves 46% resolved rate on SWE-bench-Verified with only 3 × \times 14B models This makes Co-PatcheR the best patcher with specialized models, requiring the least training resources and the smallest models . We conduct a comprehensive ablation study to validate our recipes, as well as our choice of training data number, model size, and testing-phase scaling strategy. 1 Introduction Software patching is a time-intensive and cognitively demanding task, especially for large and complex codebases. In the real world, effective patching often requires a combination of complementary skills : locating the faulty component, generating plausible fixes, and validating the changes. Recent works leverage general-purpose LLMs [ 32 , 3 , 34 , 33 , 15 , 4 ] to construct patching agents with three components, responsible for localization, generation, and validation, respectively. They demonstrate remarkable performance on SOTA benchmarks (e.g., SWE-bench [ 22 ] ) and show significant potential to automate patching in the real world. Despite these promising results, concerns about cost efficiency and data privacy further motivate the development of customized patching models. Current approaches train one model for the end-to-end patching pipeline through supervised fine-tuning (SFT) or reinforcement learning. Specifically, early works [ 54 , 29 ] fine-tune 72 B and 32 B models through simple supervised data and achieve around 30 % resolved rates on SWE-bench-Verified. More recent methods implement rule-based rewards and train reasoning models with reinforcement learning, with SWE-RL [ 50 ] achieving the highest resolved rate of 41 % on SWE-bench-Verified using a 70 B model. However, these monolithic approaches fail to imitate the real-world patching paradigm, where specialized engineers collaborate by dividing responsibilities according to their expertise . Inspired by the collaborative workflow in the realistic software engineering practice [ 30 , 51 ] , we propose Co-PatcheR, the first patching agent with collaborative small reasoning models designed specifically for different components . Our key insight for having component(s)-specific models is that different components have different inputs, outputs, and capability requirements. Specifically, localization and generation require a similar capability of interpreting the issue description and understanding the current codebase. Validation, on the other hand, generates testing cases without knowledge of the patches or the codebase. Given the non-trivial differences, it is challenging for one small model to handle all these sub-tasks. Following this intuition, we craft a tailored task design and training recipe for different components, aiming to minimize the model size while preserving performance . Specifically, given the similarity between localization and generation, we train a single model (Loc-Gen model) to handle both functions. For localization, we design it as a two-step procedure, where the model first identifies the affected files and then pinpoints the specific lines responsible for the issue. This task decomposition reduces the task complexity and context length, making it more suitable for small models. For patch generation, we train the Loc-Gen model to not only generate patches but also review and refine its own solutions. With this additional self-critical capability, the Loc-Gen model can prevent common errors and generate higher-quality candidates. Finally, we train two models to generate multiple and diverse issue-reproducing test cases (PoC) and judge the patch correctness based on the PoC execution outcomes. The insight here is to provide diverse PoCs for a more sound correctness judgment. Here, Val-assert model and Val-no-assert model generate PoCs with and without assertions, respectively. We use these models together with available functionality tests and a majority vote mechanism to select the final patch. For all three models, we apply model distillation with a novel data construction method to enable their reasoning capabilities. Different from existing distillation models (e.g., S1 [ 31 ] ), we find that creating reasoning data with correct answers is critical for our fine-tuned model to achieve high performance . Through extensive experiments, we first show that when using only 3 \times 14B models, Co-PatcheR can achieve a 46% resolved rate on SWE-bench-Verified with 60 patch candidates. Compared to SWE-RL, Co-PatcheR achieves a high resolved rate with 40 % fewer parameters and 88 % fewer samples. Besides, Co-PatcheR only needs to run one 14 B model at a time, which is much more efficient than SOTA methods during the testing phase. Furthermore, with our specific reasoning data construction method, Co-PatcheR only requires 6 K data for training, which is much more efficient than SOTA methods that use at least 30 K samples. We then conduct a comprehensive ablation study for each model to validate its task design and training recipe. Finally, we validate the necessity of testing-phase reasoning, our choice of data number and model size, through more ablation studies. Contributions. We propose Co-PatcheR, the first collaborative patching system with component-specific reasoning models. Co-PatcheR is the most data- and parameter-efficient patcher that offers greater effectiveness, efficiency, and modularity than existing patchers with specialized models. Co-PatcheR ranks among the top-10 open-source systems on SWE-bench-Verified, outperforming all patchers with open-source models. We propose specific training recipes for each model and obtain the following new findings that are unique to patching: • Using one model for localization and generation performs similarly to using separate models. • Multiple models for PoC generation provide necessary diversity that a single model cannot achieve. • Critique is important for generation, and multi-source data is important for validation. • Simply increasing data or model size is not always helpful; data scale should match model size. • Rejection sampling-based data filtering helps all components; but rationalization does not. 2 Existing Works and Limitations LLM-based patching agent. There are several works on designing a patching agent using general-purpose LLMs [ 25 , 7 , 6 , 27 , 2 , 20 , 8 , 14 , 13 , 56 , 59 , 5 , 42 , 35 ] . Some agents achieve remarkable performance on the SWE-bench benchmark [ 22 ] , a benchmark for real-world GitHub issues written in Python. The top-ranked open-source agents are OpenHands [ 48 ] , Agentless [