원시데이터 수집 시스템
선정목록으로

SoRFT: Issue Resolving with Subtask-oriented Reinforced Fine-Tuning

관련 산업용 섬유 · (9) 타이어코드

기본 정보

저자
  1. Zexiong Ma
  2. Chao Peng
  3. Pengfei Gao
  4. Xiangxin Meng
  5. Yanzhen Zou
  6. Bing Xie
DOI
10.18653/v1/2025.acl-long.559
저널
–
발행년도
2025
발행기관
–
피인용수
4
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.18653/v1/2025.acl-long.559
토픽
Advancements in Photolithography Techniques
OpenAlex ID
W4412945419

평가 내용

관련도
관련
사업분야
산업용 섬유 · (9) 타이어코드
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '산업용 섬유 > 타이어코드' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Mainstream issue-resolving frameworks predominantly rely on commercial models, leading to high costs and privacy concerns.Existing training approaches for issue resolving struggle with poor generalization and fail to fully leverage open-source development resources.We propose Subtask-oriented Reinforced Fine-Tuning (SoRFT), a novel training approach to enhance the issue resolving capability of LLMs.We decomposes issue resolving into structured subtasks: file localization, function localization, line localization, and code edit generation.SoRFT consists of two training stages: (1) rejection-sampled supervised fine-tuning, Chain of Thought (CoT) data is filtered using ground-truth before fine-tuning the LLM, and (2) rule-based reinforcement learning, which leverages PPO with ground-truth based rewards.We evaluate the SoRFT-trained model on SWE-Bench Verified and SWE-Bench Lite, achieving state-of-the-art (SOTA) performance among open-source models (e.g., resolve 21.4% issues on SWE-Bench Verified with SoRFT-Qwen-7B).The experimental results demonstrate that SoRFT significantly enhances issue-resolving performance, improves model generalization, and provides a cost-efficient alternative to commercial models.

본문 54,267자

본문 펼치기
# SoRFT: Issue Resolving with Subtask-oriented Reinforced Fine-Tuning Zexiong Ma <sup>*</sup> <sup>_♢_</sup> , Chao Peng <sup>†</sup> <sup>_♣_</sup> , Pengfei Gao <sup>_♣_</sup> ,Xiangxin Meng <sup>_♣_</sup> , Yanzhen Zou <sup>_♢_</sup>, Bing Xie <sup>_†♢_</sup> _♢_ School of Computer Science, Peking University, _♣_ ByteDance, Beijing _♢_ mazexiong@stu.pku.edu.cn, {zouyz, xiebing}@pku.edu.cn, _♣_ {pengchao.x, gaopengfei.se, mengxiangxin.1219}@bytedance.com Abstract Mainstream issue-resolving frameworks predominantly rely on commercial models, leading to high costs and privacy concerns. Existing training approaches for issue resolving struggle with poor generalization and fail to fully leverage open-source development resources. We propose S ubtask- o riented R einforced F ineT uning ( SoRFT ), a novel training approach to enhance the issue resolving capability of LLMs. We decomposes issue resolving into structured subtasks: file localization, function localization, line localization, and code edit generation. SoRFT consists of two training stages: (1) rejection-sampled supervised fine-tuning, Chain of Thought (CoT) data is filtered using ground-truth before fine-tuning the LLM, and (2) rule-based reinforcement learning, which leverages PPO with ground-truth based rewards. We evaluate the SoRFT-trained model on SWEBench Verified and SWE-Bench Lite, achieving state-of-the-art (SOTA) performance among open-source models (e.g., resolve 21.4% issues on SWE-Bench Verified with SoRFT-Qwen7B). The experimental results demonstrate that SoRFT significantly enhances issue-resolving performance, improves model generalization, and provides a cost-efficient alternative to commercial models. 1 Introduction Large Language Models (LLMs)(OpenAI, 2023; Touvron et al., 2023) have demonstrated exceptional performance across a wide range of complex real-world tasks (Li et al., 2022, 2024; Wu et al., 2023), particularly excelling in software development (Jimenez et al., 2024; Zhao et al., 2024; Ma et al., 2024c). The current mainstream automated software development systems mainly use commercial models (OpenAI, 2023; Cla, 2024). However, the API call of commercial models are costly and - Work done during an internship at ByteDance. - Corresponding authors. Figure 1: Rule-based reward example for file localization subtask. LLM generates CoT data for a given issue, the reward for the sampled CoT is then calculated by the _Fβ_ score based on the extracted answer and the groundtruth answer. pose privacy leakage issues, limiting their application in development processes in the industry. Research communities have attempted to finetune open-source LLMs (Team, 2024a; Guo et al., 2024; Cod, 2024; Touvron et al., 2023; Hui et al., 2024; Lozhkov et al., 2024) to improve their performance in Issue Resolving task. Existing Approaches(Pan et al., 2024; Ma et al., 2024b; Xie et al., 2025a; Ma et al., 2024a) utilize LLMs to sample Chain-of-Thought (CoT)(Wei et al., 2022) data, then perform Negative Sample Filtering based on ground-truth data, and fine-tune the models. While these methods improve LLMs’ issue-resolving capabilities, relying solely on supervised fine-tuning (SFT) can lead to poor generalization, making models more susceptible to hallucinations and factual errors. Recent studies (Luong et al., 2024; Guo et al., 2025; Zeng et al., 2025; Xie et al., 2025b; Mu et al., 2024; Team et al., 2025) have explored rulebased reinforcement learning to enhance model performance on complex tasks such as mathematics. issue Version 2.1 breaks git environment variables. Traceback (most recent call last): File ”./site-packages/conda_build/render.py” … File ”./site-packages/conda_build/metadata.py" assert not res.startswith(\'.\'), AssertionError: Version can\'t start with leading period LLM Output Ground-truth Answer ``` conda_build/build.py conda_build/metadata.py conda_build/render.py ``` ### Thought: 1. The error is: "AssertionError: Version can\'t start with leading period" 2. This suggests an issue with how the version string is being processed in the metadata handling. 3. The error trace shows the following relevant files: - conda_build/metadata.py (where the version check happens) - conda_build/jinja_context.py (where environment variables are processed) - conda_build/environ.py (where metadata variables are set) ### Answer: ``` conda_build/metadata.py conda_build/environ.py conda_build/jinja_context.py ``` ?= ?? ?, ?= 0.3 11427 _Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1:_ _Long Papers)_ pages 11427 11441 Rule-based reinforcement learning requires groundtruth for evaluation, but constructing ground-truth for math problems is labor-intensive. In the opensource community, a vast number of resolved issues come with ground-truth patches. This raises a natural question: _Can we leverage these (issue, patch)_ _pairs for rule-based reinforcement learning to im-_ _prove the issue-resolving capabilities of language_ _models?_ In this paper, we propose S ubtask- o riented R einforced F ine- T uning ( SoRFT ), fully utilizes both positive and negative sample information to improve model performance in Issue Resolving. Given the complexity of the Issue Resolving task (Jimenez et al., 2024), constructing end-to-end training data is challenging. Inspired by Agentless (Xia et al., 2024), we break down issue resolving into multiple subtasks: file localization, function localization, line localization, and code edit generation—and derive ground-truth answers for each subtask from the pull requests associated with the issues. We then perform Reinforced FineTuning (Luong et al., 2024) for these subtasks. SoRFT consists of two training stages: rejectionsampled supervised fine-tuning (SFT) and rulebased reinforcement learning (RL). In the SFT stage, we employ a teacher LLM to generate CoT data for each subtask and filter negative samples based on ground-truth answers. We then perform supervised fine-tuning to help the model grasp the subtask structures, underlying reasoning mechanisms, and output formats essential for issue resolving. In the RL stage, since each subtask has a corresponding ground-truth, we employ rulebased proximal policy optimization (PPO) (Schulman et al., 2017) for training. Specifically, we define scoring rules based on ground-truth for each subtask, and update the LLM’s parameters using reward-based optimization. This process further improves the model’s issue-resolving performance. SoRFT-trained LLMs achieve state-of-the-art performance on SWE-Bench Verified and SWE-Bench Lite, demonstrating the effectiveness of SoRFT in enhancing issue-resolving capabilities. In this paper, we make the following contributions: - We introduce Subtask-oriented Reinforced FineTuning (SoRFT), designing rule-based rewards for each issue-resolving subtask and enhancing LLMs’ issue-resolving capabilities through reinforced fine-tuning. - We apply SoRFT to open-source models and validate its effectiveness within Agentless framework. - We investigate the impact of different reward rules on PPO training, providing insights for designing more robust reward rules. 2 Background In this section, we provide a brief introduction to SWE-Bench, issue resolving framework, and the reinforcement learning algorithm. 2.1 SWE-Bench SWE-Bench (Jimenez et al., 2024) is a benchmark to evaluate language models’ ability to resolve realworld software issues, such as bug reports and feature requests on GitHub. LLM-based programming assistants are given an issue description along with the entire repository and are expected to generate code edits that resolve the issue. SWE-Bench Lite (Team, 2024b) is a curated subset of SWEBench, specifically focus on evaluating functional bug fixes. While SWE-Bench Verified (OpenAI, 2024c) is a human-verified subset addressing quality issues in SWE-Bench, such as vague problem descriptions. All issue-resolving experiments in this paper are conducted on SWE-Bench Lite and SWE-Bench Verified. 2.2 Issue Resolving Framework Issue resolving frameworks can be broadly divided into two categories: agent-based and pipelinebased. Openhands(Wang et al., 2024b) is a purely react-style (Yao et al., 2022) agent-based framework for software development tasks. Xie et al. (2025a) propose SWE-Fixer, a two-stage pipeline-based system. Ma et al. (2024a) propose SWE-SynInfer, a hybrid framework that combines pipeline design with agent-based approaches. Additionally, Xia et al. (2024) propose Agentless, a multi-stage pipeline-based framework designed to fully leverage the reasoning capabilities of LLMs for issue resolving. Notably, Agentless is the stateof-the-art (SOTA) pipeline-based framework on the SWE-Bench leaderboard and has been adopted by OpenAI (OpenAI, 2024b) and DeepSeek (Guo et al., 2025) to assess their models’ performance in software engineering tasks. Constructing training data requires sampling CoT data for the framework and filtering out negative samples. Assessing the accuracy of intermediate steps in the Agent framework is challenging, whereas the pipeline-based 11428 # Q Q R (1) Subtask question answer (2) Rejection-sampled Supervised Fine-Tuning output 1 issue repo skeleton issue file issue function issue code context file localization file func localization function line localization line edit generation code edit question output 2 # output 3 R SFT ground-truth answer (3) Rule-based Reinforcement Learning Score 0.3 1.0 0.0 ground-truth answer question output 1 output 2 output 3 RL Figure 2: SoRFT consists three parts: (1) decompose issue resolving into four subtasks: file localization, function localization, line localization and code edit generation; (2) fine-tune LLMs with rejection-sampled CoT data to enable it follow the task format and reasoning methods for each subtask; (3) employ rule-based reinforcement learning to further enhance the issue resolving ability of LLMs. framework offers a clearer and more effective approach to evaluating reasoning accuracy at each stage. In this paper, we design training sub-tasks based on Agentless and employ Agentless <sup>1</sup> as the inference framework in our experiments. 2.3 Reinforcement Learning Reinforcement learning algorithms are widely used in the alignment phase of large language models (LLMs), including proximal policy optimization (PPO) (Schulman et al., 2017), group relative policy optimization (GRPO) (Shao et al., 2024), direct preference optimization (DPO) (Rafailov et al., 2023), and Kahneman-Tversky optimization (KTO) (Ethayarajh et al., 2023, 2024). The PPO algorithm calculates the reward using Equation (1) and subsequently updates the parameters of the Policy Model. _r_ = _rϕ_ ( _q, o_ ) _−_ _β ·_ KL[ _πθ_ ( _·|q_ ) _∥_ _πref_ ( _·|q_ )] (1) where _q_ represents the given question, _o_ refers to the predicted output, _rϕ_ is the reward model, _πθ_ is the policy model, _πref_ is the reference model (mostly refer to the original policy model _πθold_ ). As PPO is capable of maintaining stability and efficiency during policy updates, we employ PPO for RL training in this paper. In the standard PPO algorithm (Schulman et al., 2017), a pre-trained reward model is used to score 1We employ Agentless 1.0 in our paper. responses. However, recent studies (Guo et al., 2025; Team et al., 2025) have demonstrated that relying on a reward model can lead to reward hacking, and adopting a more objective scoring approach can effectively mitigate this issue. Since groundtruth can be easily collected for issue resolving tasks, we designed a set of scoring rules to evaluate responses specifically for the issue resolving task. We will present the reward rules in Section 3.3. 3 Approach As shown in Figure 2, SoRFT contains three parts: (1) issue resolving subtask construction, (2) rejection-sampled supervised fine-tuning, and (3) rule-based reinforcement learning. 3.1 Issue Resolving Subtasks To address the challenge of constructing end-toend training data for the Issue Resolving task, we create training data for phased subtasks. As shown in Figure 2(1), inspired by the design patterns of advanced issue-resolving frameworks (Xia et al., 2024; Ma et al., 2024a), we decompose issue resolving into four subtasks: file localization, function localization, line localization, and code edit generation. This structured decomposition enables a more targeted and effective training process for each phase of the task. File Localization. File localization training enhances the LLMs’ understanding of the high-level 11429 architecture of the repository, enabling them to perform an initial rough localization of relevant files based on the issue description. We utilize the issue and repository structure as inputs, with the full names of the modified files in the pull request (PR) as outputs. To improve the quality of the training data, we excluded non-Python files and test scripts from both input and output. The relationship can be formulated as follows: promptfile( _I, Rs_ ) _→Fg_ (2) where _Fg_ represents the golden file, _I_ represents the issue, _Rs_ represents the repository skeleton. Function Localization. Function localization training can improve the LLMs’ performance on fine-grained localization based on the functional characteristics of the code. In function localization, the issue and file skeleton composed of function names are employed as inputs, while the names of modified functions from the PRs are employed as outputs. This relationship is expressed as: promptfunction( _I, Fg,s_ ) _→FN g_ (3) where _FN g_ represents the golden function name, _I_ represents the issue, _Fg,s_ represents the skeleton of the golden file _Fg_ . Line Localization. Line localization training enhances the LLMs’ ability to precisely identify the exact lines of code that require modification to resolve the issue. Line localization takes the issue description and function content as inputs and outputs the modified lines from the PR. This can be formulated as: promptline( _I, FN g,c_ ) _→Lg_ (4) where _Lg_ represents the golden modified line, _I_ represents the issue, _FN g,c_ represents the content of the golden function _FN g_ . Code Edit Generation. Training code edit generation can enhance the LLMs’ ability to modify code snippets based on the issue. The input for code edit consists of the issue and the localized code snippet, while the output is the code edits of the corresponding PR. Following previous work (Xia et al., 2024; Yang et al., 2024), we employ the _Search/Replace_ edit format. The _Search/Replace_ format consists of two main parts: 1) Search: the target code snippet that need to modify, and 2) Replace: the new 14 else 15 _r_ = _Fβ_ ( _Oedit, A_ ) 16 <u>return</u> _<u>r</u>_ code snippet after editing. This relationship can be formulated as: promptedit( _I, Cg_ ) _→Eg_ (5) where _Eg_ represents the golden code edit, _I_ represents the issue, _Cg_ represents the golden code context. All subtasks are constructed based on resolved issues from open-source projects, and the groundtruth answers are extracted from the corresponding pull requests. The prompts for the subtasks are provided in Appendix D. 3.2 Rejection-sampled Supervised Fine-Tuning We fine-tune the LLM using Rejection-sampled CoT data to enhance its understanding of the task format and reasoning process for each subtask. As shown in Figure 2(2), we sample CoT data using the LLM and then filter the CoT data based on the ground-truth answer. Specifically, for the three localization subtasks, we filter out samples that have no overlap with the ground-truth file, function or line. For the code edit generation subtask, we filter out samples that have no overlap with the lines modified by the ground-truth edits. Finally, we integrate CoT data from all subtasks to fine-tune the LLM, enabling it to comprehend both the task format and its underlying reasoning mechanisms. <u>Algorithm 1:</u> <u>Rule-based reward</u> <u>Input:</u> Subtask type _s_, question prompt _q_, ground-truth answer _A_, LLM output _o_ Output: Reward score _r_ 1 if _<u>s</u>_ <u>==</u> _<u>localization</u>_ then 23 _Oloc_ _←_ _extract_ _ _locations_ ( _o_ ); 3 _Q ←_ _extract_ _ _locations_ ( _q_ ); 4 45 if _<u>|Orloc</u>_ = 0 _<u>|</u>_ <u>== 0</u> _._ 0 <u>or</u> _<u>|Oloc −</u>_ _<u>Q| ></u>_ <u>0</u> then 5 _r_ = 0 _._ 0 6 else 7 _r_ = _Fβ_ ( _Oloc, A_ ) 8 if _<u>s</u>_ <u>==</u> _<u>edit</u>_ then 109 _Osearch_ _←_ _extract_ _ _search_ _ _blocks_ ( _o_ ); 1011 _Oedit_ _←_ _extract_ _ _edits_ ( _o_ ); 11 _Q ←_ _extract_ _ _code_ ( _q_ ); 12 1213 if _<u>|Oredit</u>_ = 0 _<u>|</u>_ <u>== 0</u> _._ 0 <u>or</u> _<u>|Osearch −</u>_ _<u>Q| ></u>_ <u>0</u> then 13 _r_ = 0 _._ 0 11430 3.3 Ruled-based Reinforcement Learning We further enhance the reasoning ability and gen eralization of LLMs on issue-resolving through Rule-based Reinforcement Learning. As shown in Algorithm 1, we utilize the ground-truth answer to calculate the rule-based reward for each subtask. For the localization subtask (line 1-7), we first extract the localization result _Oloc_ from the response. If the localization result is empty or contains a target not present in the problem description, the reward is set to 0; otherwise, the reward is calculated as the _Fβ_ score between _Oloc_ and the ground-truth answer _A_ . For the code editing subtask (line 8-15), we first extract the modification target _Osearch_ and the modification code _Oedit_ from the response. If the modification code is empty or the modification target does not appear in the problem description, the reward is 0; otherwise, the reward is calculated as the _Fβ_ score between _Oedit_ and the ground-truth answer _A_ . During reinforcement learning period, we replace the reward model in PPO with above rule-based reward. This approach effectively mitigates the risk of reward hacking, ensuring that the model’s learning process is guided by precise and reliable feedback. <u>Precision</u> _<u>·</u>_ <u>Recall</u> (6) _Fβ_ = (1 + _β_ <sup>2</sup> ) _·_ ( _β_ <sup>2</sup> _·_ Precision) + Recall <sup>_,_</sup> <sup>_<u>∩</u>_</sup> <sup>_<u>A|</u>_</sup> _,_ Recall = <sup>_<u>|O ∩</u>_</sup> <sup>_<u>A|</u>_</sup> _|O|_ _|A|_ Precision = <sup>_<u>|O ∩</u>_</sup> <sup>_<u>A|</u>_</sup> _|O|_ (7) <sup>_<u>∩</u>_</sup> <sup>_<u>A|</u>_</sup> _|A|_ 2024) with 500 instances. Each instance is a issue associated with test cases that can be executed in a Docker <sup>2</sup> environment. Issue resolving frameworks (Xia et al., 2024; Xie et al., 2025a; Wang et al., 2024b; Ma et al., 2024a) are asked to understand the issue and the repository, generate patches and pass all test cases, providing a reliable evaluation of their issue resolving capabilities. SWE-Bench Lite (Team, 2024b) is the subset of SWE-Bench containing 300 instances and focuses on evaluating functional bug fixes. 4.2 Metrics To evaluate the performance of issue resolving frameworks with SoRFT-trained LLMs, we apply two metrics: %Resolved, %Applied . %Resolved is the proportion of samples in which applying the generated code edit successfully passed all test cases. %Applied is the proportion of samples that issue resolving frameworks successfully generate valid code edits that could be applied to the repositories. This metric evaluates the framework’s capability to produce practical and executable solutions. 4.3 Framework and Model We apply Agentless(Xia et al., 2024) as our is sue resolving framework and Qwen2.5-Coder (Hui et al., 2024) series as our base model. Agentless is an advanced open-source issue-resolving framework, used by OpenAI (OpenAI, 2024b) and DeepSeek (Guo et al., 2025) to evaluate model performance on software engineering tasks. For base model, we employ Qwen2.5-Coder-7B-Instruct and Qwen2.5-Coder-32B-Instruct(Hui et al., 2024), which is the SOTA open-source coder instruct models (Touvron et al., 2023; Guo et al., 2024). 4.4 Baselines Since issue resolving tasks necessitate the use of agent-based or pipeline-based frameworks, existing fine-tuning approaches are typically designed and optimized for specific frameworks. In this work, we evaluate our method against three baselines: (1) OpenHands with SWE-Gym-Qwen, (2) SWE-Fixer with SWE-Fixer-Qwen, and (3) SWESynInfer with Lingma-SWE-GPT. Openhands with SWE-Gym-Qwen(Pan et al., 2024). Openhands(Wang et al., 2024a) is a purely 2https://www.docker.com/ where _O_ represents the outputs generated by the LLMs, _A_ denotes the ground-truth answers for the subtask. _β_ is a hyperparameter that balances the impact of precision and recall on final score. Since recall has a greater influence on the final outcome across different subtasks, _β_ should be a value greater than 1. In our experiments, we set _β_ = 3 to prioritize recall while maintaining a reasonable trade-off with precision. 4 Experiments In this section, we will introduce our evaluation benchmark, metrics, models, baselines and implementation details. 4.1 Benchmark We conduct experiments on two issue resolv ing benchmarks: SWE-Bench Verified and SWEBench Lite. SWE-Bench Verified (OpenAI, 2024c) is a manually verified subset of SWE-bench (Jimenez et al., 11431 Table 1: The %Resolved performance of various models on SWE-Bench Verified and SWE-Bench Lite. Given that all fine-tuning approaches are inherently framework-specific, we compare SoRFT-Qwen with previous fine-tuned models within corresponding frameworks. <u>Model</u> <u>Framework</u> <u>Type</u> <u>Verified</u> <u>Lite</u> <u><mark>Proprietary Models</mark></u> Claude-3.5-Sonnet (Cla, 2024) Openhands Agent 53.0 41.7 Claude-3.5-Sonnet (Cla, 2024) Agentless Pipeline 50.8 40.7 o1-preview (OpenAI, 2024b) Agentless Pipeline 41.3 DeepSeek-R1-672B (Guo et al., 2025) Agentless Pipeline 49.2 GPT-4o (OpenAI, 2024a) SWE-SynInfer Pipeline + Agent 31.8 20.7 <u><mark>7 - 14B Open-source Models</mark></u> SWE-Gym-Qwen-7B (Pan et al., 2024) Openhands Agent 10.6 10.0 SWE-Gym-Qwen-14B (Pan et al., 2024) Openhands Agent 16.4 12.7 Lingma-SWE-GPT-7B (Ma et al., 2024a) SWE-SynInfer Pipeline + Agent 18.2 12.0 <u><mark>SoRFT-Qwen-7B (Ours)</mark></u> <mark>Agentless</mark> <mark>Pipeline</mark> <u><mark>21.4</mark></u> <u><mark>14.0</mark></u> <u><mark>32 - 72B Open-source Models</mark></u> Lingma-SWE-GPT-72B (Ma et al., 2024a) SWE-SynInfer Pipeline + Agent 30.2 22.0 SWE-Fixer-Qwen-72B (Xie et al., 2025a) SWE-Fixer Pipeline 30.2 23.3 SWE-Gym-Qwen-32B (Pan et al., 2024) Openhands Agent 20.6 15.3 <u><mark>SoRFT-Qwen-32B (Ours)</mark></u> <mark>Agentless</mark> <mark>Pipeline</mark> <u><mark>30.8</mark></u> <u><mark>24.0</mark></u> React-style(Yao et al., 2022) agent-based framework, equipped with tools such as file viewing and bash command execution. The framework enables the model to autonomously invoke these tools in a React-like manner, iteratively reasoning and acting to resolve issues. They collected trajectories of Openhands invoking GPT-4o(OpenAI, 2024a) and Claude-3.5-Sonnet(Cla, 2024) for issue resolving tasks, filtered out the failed trajectories, and then fine-tuned the Qwen2.5-Coder model to serve as the SWE-Gym-Qwen model. SWE-Fixer with SWE-Fixer-Qwen(Xie et al., 2025a). SWE-Fixer is a two-stage pipeline-based framework. First, it uses a retriever that combines BM-25 and LLMs to locate the files to be modified, and then uses LLMs to generate code edits to the files. They utilized GPT-4o(OpenAI, 2024a) to collect CoT training data, and fine-tuned the Qwen2.5-Coder model to serve as the SWE-FixerQwen model. SWE-SynInfer with Lingma-SWE-GPT(Ma et al., 2024a). SWE-SynInfer is a hybrid framework that combines pipeline design with agentbased capabilities. In the first stage, the model sequentially analyzes the repository structure, file skeletons, and code snippets to generate a detailed modification plan. Then, it provides tools such as file viewing, allowing the model to invoke these tools in a react manner and generate the final code edit. Similar to Openhands(Wang et al., 2024a), they collected trajectories of SWE-SynInfer invoking GPT-4o(OpenAI, 2024a) for issue resolving tasks, filtered out the failed trajectories, and then fine-tuned the Qwen2.5-Coder model to serve as the Lingma-SWE-GPT model. 4.5 Implementation Details In this subsection, we will introduce the data construction details, fine-tuning details, and reinforcement learning details. Data Construction. To construct our training dataset, we curate a collection of high-quality opensource Python projects from _seart-ghs_ <sup>3</sup> by applying a set of stringent criteria. Specifically, we select repositories that satisfy the following conditions: (1) at least 1,000 issues, (2) at least 1,000 pull requests (PRs), (3) a minimum of 100 stars, (4) inclusion of an appropriate license, (5) exclusion of forked repositories, and (6) absence from the SWE-Bench test dataset to prevent data contamination. Through this rigorous selection process, we identify a final set of 660 repositories. From this pool, we further select 100 repositories to generate the SFT CoT data. We extract 30,000 (issue, PR) pairs from these repositories and formulate corresponding subtasks. We sample CoT data using Claude-3.5-Sonnet (Cla, 2024) and filter out instances where the final answer does not align with the subtask’s ground truth, retaining 60k train 3https://seart-ghs.si.usi.ch/ 11432 ing samples. We also crawl the (issue, PR) data from the remaining repositories and construct the corresponding subtasks. During the reinforcement learning phase, we randomly select 30k samples for training. Fine-tuning. We employ FastChat (Zheng et al., 2023) framework with full sharding strategy and CPU offload strategy implemented by Pytorch FSDP <sup>4</sup> for our 7B model fine-tuning, and employ DeepSpeed (Rasley et al., 2020) for our 32B model fine-tuning. The training process is conducted on 4x8 96G H20 GPUs. We also utilize flash-attention2 (Dao, 2024) to reduce memory overhead and speed up the training process. We set the global batch size to 128 and train for 2 epochs. We apply cosine learning rate decay with a maximum learning rate of 1e-5 and 3% warm-up steps. Reinforcement Learning. We employ OpenRLHF (Hu et al., 2024) framework for our PPO (Schulman et al., 2017) implementation. The training process is conducted on 4x8 96G H20 GPUs. We also utilize ray (Moritz et al., 2018), DeepSpeed (Rasley et al., 2020), flash-attention2 (Dao, 2024) and vllm (Kwon et al., 2023) to reduce GPU memory overhead and speed up the training process. We set temperature to 1.0 to sample completions for each prompt. 5 Results and Analysis SoRFT achieves SOTA performance among open-source LLMs. Table 1 presents the performance of SoRFT and fine-tuned open-source LLMs on the issue-resolving task on SWE-bench Verified and SWE-bench Lite. We categorize the open-source models into two groups based on their parameter sizes: (1) 7-14B open-source LLMs, and (2) 32-72B open-source LLMs. The LLMs trained with SoRFT achieved state-of-theart (SOTA) performance among models of the same parameter size and even slightly outperforms some larger models. On SWE-bench Verified, SoRFT-Qwen-7B outperforms SWE-Gym-Qwen32B (21.4 vs. 20.6). SoRFT-Qwen-32B even outperforms Lingma-SWE-GPT-72B (30.8 vs. 30.2), despite the latter having significantly more parameters. While OpenHands achieves optimal performance with proprietary models, the SWE-Gym 4https://pytorch.org/docs/stable/fsdp.html Table 2: Performance comparison of model with different training strategy on SWE-bench Verified. <u>Model</u> <u>%Resolved</u> <u>%Applied</u> <u>Qwen2.5-Coder-7B-Instruct</u> <u>7.6</u> <u>55.6</u> + SFT 18.0 85.2 <u>+ SFT + RL (Our SoRFT-Qwen-7B)</u> <u>21.4</u> <u>95.6</u> <u>Qwen2.5-Coder-32B-Instruct</u> <u>25.6</u> <u>84.4</u> + SFT 28.8 90.6 <u>+ SFT + RL (Our SoRFT-Qwen-32B)</u> <u>30.8</u> <u>95.8</u> Figure 3: Performance of models trained with different training strategies. model, specifically fine-tuned for OpenHands, underperforms compared to others. This discrepancy may arise from the challenges of constructing supervision signals for intermediate steps in agent framework, whereas a pipeline framework can establish supervision signals for different stages. This allows for finer-grained filtering of CoT data and more precise reward calculation. SoRFT achieves higher accuracy than solely supervised fine-tuning. As demonstrated in Table 2, full SoRFT training consistently outperforms SFT alone for both 7B and 32B models. Both %Resolved and %Applied metrics indicate that SoRFT enhances the model’s ability to resolve issues. Since the SoRFT utilized more data than SFT in the experiments of Table 2, to more fairly evaluate the effectiveness of SoRFT, we conducted an ablation on the amount of training data. As illustrated in Figure 3, even when SFT was trained on the same amount of data as SoRFT (90k samples), its performance still fell short of SoRFT’s results. Increasing the training data for SFT from 60k to 90k samples slightly improved the %resolved but decreased the %Applied, indicating that excessive SFT might impair the model’s generalization ability. In contrast, SoRFT was able to more robustly enhance the model’s issue resolving capability. SoRFT effectively improve performance on issue resolving subtasks. We conducted a detailed evaluation of the impact of SoRFT on various subtasks of issue resolving using the SWE-Bench Veri 22 21 20 19 18 Resolved 21.4 18.8 96 94 92 90 88 86 84 82 Applied 95.6 85.2 84.2 18.0 17 16 15 <u>SFT (60k)</u> <u>SFT (90k)</u> <u>SoRFT</u> 80 <u>SFT (60k)</u> <u>SFT (90k)</u> <u>SoRFT</u> 11433 Table 3: Performance comparison on issue resolving subtasks. <u>Model</u> <u>%File Hit</u> <u>%Func Hit</u> <u>%Line Hit</u> <u>Qwen2.5-Coder-7B-Instruct</u> <u>59.8</u> <u>51.2</u> <u>17.2</u> <u>SoRFT-Qwen-7B</u> <u>77.8</u> <u>66.4</u> <u>23.6</u> Table 4: Ablation results on reward rules. <u>Reward Rule</u> <u>%Resolved</u> <u>%Applied</u> <u>Hit score</u> <u>18.4</u> <u>91.4</u> exact-match score 18.2 90.6 _F_ 1 score 20.8 94.2 _<u>Fβ</u>_ <u>score</u> <u>21.4</u> <u>95.6</u> fied dataset. Specifically, we measured the model’s hit rates on three subtasks: file localization, function localization, and line localization. The results presented in Table 3 demonstrate that SoRFT training enhances the model’s performance across these subtasks. The robustness of reward rules is crucial for reinforcement learning. We conducted ablation study on three reward rules: hit score, exact-match score, _F_ 1 score and _Fβ_ score. Hit score is a binary reward (1.0/0.0) based on whether the response contains ground-truth elements. Exact-match score is a binary reward (1.0/0.0) awarded only for responses that exactly match the ground truth. _F_ 1 provides a balanced measure of response precision and recall, while _Fβ_ places more emphasis on the recall value. As shown in Table 4, training with _Fβ_ score achieves the best performance. We analyzed the training process of the three reward scores and found that: Hit scores are prone to reward hacking, LLMs just generate longer answers to hit groundtruth; Exact-match scores’ sparse reward causes training plateaus around 0.2 reward, hindering further performance optimization; _Fβ_ score achieves better trade-off between precision and recall, stabilizing and accelerating convergence. SoRFT also enhances performance on general code tasks. We also conduct evaluations on two general code tasks: LiveCodeBench (Jain et al., 2024) and RepoQA (Liu et al., 2024). LiveCodeBench focuses on self-contained code generation scenarios, while RepoQA evaluates the ability of LLMs to extract information from long-context code content. The results in Table 5 indicate that SoRFT also has the potential to enhance coderelated tasks beyond issue resolving. There is a large amount of development process data in the Table 5: Performance comparison on LiveCodeBench and RepoQA. <u>Model</u> <u>LiveCodeBench</u> <u>RepoQA</u> <u>Qwen2.5-Coder-7B-Instruct</u> <u>34.18</u> <u>85.0</u> <u>SoRFT-Qwen-7B</u> <u>34.64</u> <u>90.0</u> open-source community, which remains untapped in current LLM training process. Approaches like SoRFT have the potential to utilize these data to further improving the capabilities of code LLMs. 6 Related Work LLM Training for Issue Resolving. To enhance the issue resolving capabilities of open-source LLMs, several research works (Ma et al., 2024a; Xie et al., 2025a; Ma et al., 2024b; Pan et al., 2024) have attempted to use software development resources from the open-source community to construct training data and fine-tune opensource LLMs. Pan et al. (2024) crawled opensource repositories and utilized closed-source models (e.g., GPT-4o (OpenAI, 2024a) and Claude-3.5Sonnet (Cla, 2024)) to generate Openhands (Wang et al., 2024a,b) Agent trajectories, and filtered them through unit tests. Then they used the trajectories to fine-tune the Qwen (Hui et al., 2024) model, enabling it to serve as the base model for Openhands. Ma et al. (2024a) used GPT-4o to generate Agent trajectories on open-source repository issues, and fine-tuned an open-source model with the filtered trajectories. Pan et al. (2024) generated CoT data for and edit generation tasks using GPT-4o, and fine-tuned an open-source model to apply it to SWE-Fixer RAG pipeline. All the above work used SFT to fine-tune models. To the best of our knowledge, we are the first work to leverage reinforced fine-tuning (Luong et al., 2024) to enhance the issue-resolving capabilities of LLMs. Reinforcement Learning with Rule-based Reward. Since OpenAI released o1 (OpenAI, 2024b) model, many efforts have attempted to enhance LLMs’ long-form reasoning capabilities through rule-based reinforcement learning. DeepSeek’s R1 (Guo et al., 2025) model with rulebased GRPO (Shao et al., 2024) further demonstrates the potential of rule-based rewards. Team et al. (2025) released Kimi-k1.5, also trained with rule-based reinforcement learning. The research community (Zeng et al., 2025; Xie et al., 2025b) has also been working on replicating rule-based 11434 reinforcement learning process. Pan et al. (2025) trained a 3B model with PPO (Schulman et al., 2017) on the Countdown task and observed " _Aha_ _moment_ " (Guo et al., 2025) phenomenon, aligns closely with the behavior of R1. Zeng et al. (2025) trained a 7B model using PPO on Math task and observed that response length initially decreased and then increased. Previous work mainly focused on mathematical tasks, where rewards can be straightforwardly computed based on ground truth. In this paper, we improve the performance of open-source models in issue-resolving framework through subtask-oriented rule-based reinforcement learning. 7 Conclusion In this paper, we propose SoRFT, a subtaskoriented reinforced fine-tuning approach that enhances LLMs’ issue-resolving capabilities. By leveraging rule-based reinforcement learning, SoRFT improves performance while ensuring better generalization. Our results demonstrate its effectiveness as a cost-efficient alternative to commercial models. Limitations The False Negatives of Rule-based Rewards. The correct resolution to an issue is often not unique. Relying solely on rule-based rewards by comparing the LLM’s response to a single ground truth may incorrectly classify valid solutions as failures. To address this limitation, future work could incorporate unit test execution results as a more objective and fair measure of code edit quality. Experiments were conducted only in the Python repositories. Due to the lack of a multilingual SWE-Bench test set, our experiments were limited to Python repositories. However, since SoRFT is a language-agnostic framework, we believe it has the potential to improve the issue-resolving capabilities of LLMs in other languages. Acknowledgments This work is supported by National Key Research and Development Program of China (Grant No. 2023YFB4503803). References 2024. Codeqwen1.5-7b-opendevin. [https://huggingface.co/OpenDevin/](https://huggingface.co/OpenDevin/CodeQwen1.5-7B-OpenDevin) [CodeQwen1.5-7B-OpenDevin.](https://huggingface.co/OpenDevin/CodeQwen1.5-7B-OpenDevin) 2024. Introducing the next generation of claude. [https://www.anthropic.com/news/](https://www.anthropic.com/news/claude-3-family) [claude-3-family.](https://www.anthropic.com/news/claude-3-family) Tri Dao. 2024. FlashAttention-2: Faster attention with better parallelism and work partitioning. In <u>International</u> <u>Conference</u> <u>on</u> <u>Learning</u> <u>Representations (ICLR).</u> Kawin Ethayarajh, Winnie Xu, Dan Jurafsky, and Douwe Kiela. 2023. [Human-centered loss func-](https://github.com/ContextualAI/HALOs) [tions (halos).](https://github.com/ContextualAI/HALOs) Technical report, Contextual AI. Kawin Ethayarajh, Winnie Xu, Niklas Muen nighoff, Dan Jurafsky, and Douwe Kiela. 2024. Kto: Model alignment as prospect theoretic optimization. <u>arXiv preprint arXiv:2402.01306.</u> Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, et al. 2025. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. <u>arXiv</u> <u>preprint arXiv:2501.12948.</u> Daya Guo, Qihao Zhu, Dejian Yang, Zhenda Xie, Kai Dong, Wentao Zhang, Guanting Chen, Xiao Bi, Yu Wu, YK Li, et al. 2024. Deepseekcoder: When the large language model meets programming–the rise of code intelligence. <u>arXiv preprint arXiv:2401.14196.</u> Jian Hu, Xibin Wu, Zilin Zhu, Xianyu, Weixun Wang, Dehao Zhang, and Yu Cao. 2024. Openrlhf: An easy-to-use, scalable and highperformance rlhf framework. <u>arXiv</u> <u>preprint</u> <u>arXiv:2405.11143.</u> Binyuan Hui, Jian Yang, Zeyu Cui, Jiaxi Yang, Dayiheng Liu, Lei Zhang, Tianyu Liu, Jiajun Zhang, Bowen Yu, Kai Dang, et al. 2024. Qwen2. 5-coder technical report. <u>arXiv preprint</u> <u>arXiv:2409.12186.</u> Naman Jain, King Han, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang, Armando Solar-Lezama, Koushik Sen, and Ion Stoica. 2024. Livecodebench: Holistic and contamination free evaluation of large language models for code. <u>arXiv preprint arXiv:2403.07974.</u> 11435 Carlos E Jimenez, John Yang, Alexander Wet tig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik R Narasimhan. 2024. [SWE-bench:](https://openreview.net/forum?id=VTF8yNQM66) Can language models [resolve](https://openreview.net/forum?id=VTF8yNQM66) real-world github is[sues?](https://openreview.net/forum?id=VTF8yNQM66) In The Twelfth International Conference <u>on Learning Representations.</u> Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient memory management for large language model serving with pagedattention. In Proceedings of the 29th Symposium on <u>Operating Systems Principles, pages 611–626.</u> Jinyang Li, Binyuan Hui, Ge Qu, Jiaxi Yang, Bin hua Li, Bowen Li, Bailin Wang, Bowen Qin, Ruiying Geng, Nan Huo, et al. 2024. Can llm already serve as a database interface? a big bench for large-scale database grounded text-to-sqls. <u>Advances</u> <u>in</u> <u>Neural</u> <u>Information</u> <u>Processing Systems, 36.</u> Yujia Li, David Choi, Junyoung Chung, Nate Kushman, Julian Schrittwieser, Rémi Leblond, Tom Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, et al. 2022. Competitionlevel code generation with alphacode. <u>Science,</u> 378(6624):1092–1097. Jiawei Liu, Jia Le Tian, Vijay Daita, Yuxiang Wei, Yifeng Ding, Yuhan Katherine Wang, Jun Yang, and Lingming Zhang. 2024. Repoqa: Evaluating long context code understanding. <u>arXiv preprint</u> <u>arXiv:2406.06025.</u> Anton Lozhkov, Raymond Li, Loubna Ben Al lal, Federico Cassano, Joel Lamy-Poirier, Nouamane Tazi, Ao Tang, Dmytro Pykhtar, Jiawei Liu, Yuxiang Wei, et al. 2024. Starcoder 2 and the stack v2: The next generation. arXiv preprint <u>arXiv:2402.19173.</u> Trung Quoc Luong, Xinbo Zhang, Zhanming Jie, Peng Sun, Xiaoran Jin, and Hang Li. 2024. Reft: Reasoning with reinforced fine-tuning. <u>arXiv</u> <u>preprint arXiv:2401.08967.</u> Yingwei Ma, Rongyu Cao, Yongchang Cao, Yue Zhang, Jue Chen, Yibo Liu, Yuchen Liu, Binhua Li, Fei Huang, and Yongbin Li. 2024a. Lingma swe-gpt: An open development-process-centric language model for automated software improvement. <u>arXiv preprint arXiv:2411.00622.</u> Zexiong Ma, Shengnan An, Zeqi Lin, Yanzhen Zou, and Bing Xie. 2024b. Repository structureaware training makes slms better issue resolver. <u>arXiv preprint arXiv:2412.19031.</u> Zexiong Ma, Shengnan An, Bing Xie, and Zeqi Lin. 2024c. Compositional api recommendation for library-oriented code generation. In <u>Proceedings</u> <u>of</u> <u>the</u> <u>32nd</u> <u>IEEE/ACM</u> <u>International</u> <u>Conference</u> <u>on</u> <u>Program Comprehension, pages 87–98.</u> Philipp Moritz, Robert Nishihara, Stephanie Wang, Alexey Tumanov, Richard Liaw, Eric Liang, Melih Elibol, Zongheng Yang, William Paul, Michael I Jordan, et al. 2018. Ray: A distributed framework for emerging _<u>{</u>_ AI _<u>}</u>_ applications. In <u>13th USENIX symposium on operating systems</u> <u>design</u> <u>and</u> <u>implementation</u> <u>(OSDI</u> <u>18),</u> pages 561–577. Tong Mu, Alec Helyar, Johannes Heidecke, Joshua Achiam, Andrea Vallone, Ian Kivlichan, Molly Lin, Alex Beutel, John Schulman, and Lilian Weng. 2024. Rule based rewards for language model safety. <u>arXiv preprint arXiv:2411.01111.</u> OpenAI. 2023. Gpt-4. [https://openai.com/](https://openai.com/index/gpt-4-research/) [index/gpt-4-research/.](https://openai.com/index/gpt-4-research/) OpenAI. 2024a. Gpt-4o. [https://openai.com/](https://openai.com/index/hello-gpt-4o/) [index/hello-gpt-4o/.](https://openai.com/index/hello-gpt-4o/) OpenAI. 2024b. o1-preview. [https://openai.com/index/](https://openai.com/index/introducing-openai-o1-preview/) [introducing-openai-o1-preview/.](https://openai.com/index/introducing-openai-o1-preview/) OpenAI. 2024c. [Swe-bench verified.](https://openai.com/index/introducing-swe-bench-verified/) Jiayi Pan, Xingyao Wang, Graham Neubig, Navdeep Jaitly, Heng Ji, Alane Suhr, and Yizhe Zhang. 2024. Training software engineering agents and verifiers with swe-gym. <u>arXiv</u> <u>preprint arXiv:2412.21139.</u> Jiayi Pan, Junjie Zhang, Xingyao Wang, Li fan Yuan, Hao Peng, and Alane Suhr. 2025. Tinyzero. https://github.com/Jiayi-Pan/TinyZero. Accessed: 2025-01-24. Rafael Rafailov, Archit Sharma, Eric Mitchell, Stefano Ermon, Christopher D Manning, and Chelsea Finn. 2023. [Direct preference optimiza-](https://arxiv.org/abs/2305.18290) tion: [Your language model is secretly a reward](https://arxiv.org/abs/2305.18290) [model.](https://arxiv.org/abs/2305.18290) In Proceedings of NeurIPS. 11436 Jeff Rasley, Samyam Rajbhandari, Olatunji Ruwase, and Yuxiong He. 2020. Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. In <u>Proceedings</u> <u>of</u> <u>the</u> <u>26th</u> <u>ACM</u> <u>SIGKDD</u> <u>International</u> <u>Conference</u> <u>on</u> <u>Knowledge</u> <u>Discovery</u> <u>&</u> <u>Data</u> <u>Mining,</u> pages 3505–3506. John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. [Proximal](https://arxiv.org/abs/1707.06347) [policy optimization algorithms.](https://arxiv.org/abs/1707.06347) <u>arXiv preprint</u> <u>arXiv:1707.06347.</u> Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Y Wu, et al. 2024. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. <u>arXiv</u> <u>preprint arXiv:2402.03300.</u> Kimi Team, Angang Du, Bofei Gao, Bowei Xing, Changjiu Jiang, Cheng Chen, Cheng Li, Chenjun Xiao, Chenzhuang Du, Chonghua Liao, et al. 2025. Kimi k1. 5: Scaling reinforcement learning with llms. <u>arXiv preprint arXiv:2501.12599.</u> Qwen Team. 2024a. [Code with codeqwen1.5.](https://qwenlm.github.io/blog/codeqwen1.5/) SWE-Bench Team. 2024b. [Swe-bench lite.](https://www.swebench.com/lite.html/) Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. <u>arXiv preprint arXiv:2302.13971.</u> Xingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang, Yunzhu Li, Hao Peng, and Heng Ji. 2024a. Executable code actions elicit better llm agents. <u>arXiv preprint arXiv:2402.01030.</u> Xingyao Wang, Boxuan Li, Yufan Song, Frank F Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, et al. 2024b. Openhands: An open platform for ai software developers as generalist agents. <u>arXiv</u> <u>preprint arXiv:2407.16741.</u> Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. 2022. Chain-ofthought prompting elicits reasoning in large language models. <u>Advances in neural information</u> <u>processing systems, 35:24824–24837.</u> Qingyun Wu, Gagan Bansal, Jieyu Zhang, Yiran Wu, Shaokun Zhang, Erkang Zhu, Beibin Li, Li Jiang, Xiaoyun Zhang, and Chi Wang. 2023. Autogen: Enabling next-gen llm applications via multi-agent conversation framework. <u>arXiv</u> <u>preprint arXiv:2308.08155.</u> Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. 2024. Agentless: Demystifying llm-based software engineering agents. <u>arXiv preprint arXiv:2407.01489.</u> Chengxing Xie, Bowen Li, Chang Gao, He Du, Wai Lam, Difan Zou, and Kai Chen. 2025a. Swe-fixer: Training open-source llms for effective and efficient github issue resolution. <u>arXiv</u> <u>preprint arXiv:2501.05040.</u> Tian Xie, Qingnan Ren, Yuqian Hong, and Zitian Gao. 2025b. Logic-rl. https://github.com/Unakar/Logic-RL. Accessed: 2025-02-03. John Yang, Carlos E Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. 2024. Swe-agent: Agentcomputer interfaces enable automated software engineering. <u>arXiv preprint arXiv:2405.15793.</u> Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. 2022. React: Synergizing reasoning and acting in language models. <u>arXiv</u> <u>preprint</u> <u>arXiv:2210.03629.</u> Weihao Zeng, Yuzhen Huang, Wei Liu, Keqing He, Qian Liu, Zejun Ma, and Junxian He. 2025. 7b model and 8k examples: Emerging reasoning with reinforcement learning is both effective and efficient. [https://hkust-nlp.notion.site/](https://hkust-nlp.notion.site/simplerl-reason) [simplerl-reason.](https://hkust-nlp.notion.site/simplerl-reason) Notion Blog. Wenting Zhao, Nan Jiang, Celine Lee, Justin T Chiu, Claire Cardie, Matthias Gallé, and Alexander M Rush. 2024. Commit0: Library generation from scratch. <u>arXiv preprint arXiv:2412.01769.</u> Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric. P Xing, Hao Zhang, Joseph E. Gonzalez, and Ion Stoica. 2023. Judging llm-as-a[judge with mt-bench and chatbot arena. Preprint,](https://arxiv.org/abs/2306.05685) arXiv:2306.05685. 11437 This is the Appendix of the paper: _SoRFT: Issue_ _Resolving with Subtask-oriented Reinforced Fine-_ _Tuning_ . A Evaluation Details All evaluation experiments are conducted on 4 96G H20 GPUs with vllm (Kwon et al., 2023) framework. We employ the official evaluation scripts <sup>5</sup> from SWE-Bench repository for SWEBench Verified and SWE-Bench Lite. On LiveCodeBench (Jain et al., 2024), we evaluate on the code_generation_lite _releave_v4_ version, which contains 713 problems released between May 2023 and Sep 2024. On RepoQA (Liu et al., 2024), we evaluate on Python repositories with _similar-_ _ity threshold=0.9_ . have been overlooked and successfully identifies the ground-truth function _sql_flush_ . D Subtask Prompt We designed data generation prompts for different subtasks based on the prompts used at corresponding stages of Agentless (Xia et al., 2024). Each subtask’s prompt consists of four parts: subtask description, issue, context, and output format instructions. LLMs are required to analyze the issue description, select content from the context that aligns with the subtask description, and provide the final answer according to the specified output format. Example 2-5 is the prompt utlized to generate CoT data for each subtask. 0.55 0.50 0.45 0.40 0.35 <u>Reward</u> 0 50 100 150 200 Step Figure 4: Reward over PPO training steps. B PPO Training Details To support rule-based PPO training, we implement a customized reward function to replace the original reward model scoring function in the OpenRLHF (Hu et al., 2024) framework. We set train batch size to 64, the Adam learning rate for the actor model to 5e-7, and the Adam learning rate for the critic model to 9e-6. As shown in Figure 4, using our designed reward rules, the reward steadily increases as the training steps progress. C Additional Reasoning Example We observed that the model tends to engage in more detailed reasoning after SoRFT training on 7B model, which bears some similarity to the "aha moment" observed by DeepSeek during the R1 training process (Guo et al., 2025). In Example 1, before concluding its reasoning, the SoRFT-Qwen7B actively explores whether any potential answers 5https://github.com/swe-bench/SWE-bench 11438 Example 1: Additional Reasoning Example Input: Identify all locations that need inspection or editing to fix the problem. _Issue:_ Simplify signature of DatabaseOperations.execute_sql_flush() ... Output: _### Thought:_ The issue is about simplifying the execute_sql_flush method’s signature from (self, using, sql_list) to just (self, sql_list). ... Additionally, there’s a sql_flush() method (line 401) that’s related to this functionality and might need to be updated as well. ... _### Answer:_ django/db/backends/base/operations.py class: BaseDatabaseOperations function: sql_flush ... Example 2: File Localization Prompt Please look through the following GitHub problem description and Repository structure and provide a list of files that one would need to edit to fix the problem. _### GitHub Problem Description:_ {issue} _### Repository Structure:_ {repository_structure} Please think step by step, provide the full path and return at most 5 files. The returned files should be separated by new lines ordered by most to least important. For example: ``` ``` ``` file1.py file2.py ``` ``` ``` Your reasoning should start with "### Thought:", and your answer should start with "### Answer:". 11439 Example 3: Function Localization Prompt Please look through the following GitHub Problem Description and the Skeleton of Relevant Files. Identify all locations that need inspection or editing to fix the problem, including directly related areas as well as any potentially related global variables, functions, and classes. For each location you provide, either give the name of the class, the name of a method in a class, the name of a function, or the name of a global variable. _### GitHub Problem Description:_ {issue} _### Skeleton of Relevant Files:_ {file_skeleton} Please provide the complete set of locations as either a class name, a function name, or a variable name. Note that if you include a class, you do not need to list its specific methods. You can include either the entire class or don’t include the class name and instead include specific methods in the class. For example: ``` ``` ``` full_path1/file1.py function: my_function_1 class: MyClass1 function: MyClass2.my_method ``` ``` ``` Please think step by step before returning the locations. Your reasoning should start with "### Thought:", and your answer should start with "### Answer:". Example 4: Line Localization Prompt Please review the following GitHub problem description and relevant files, and provide a set of locations that need to be edited to fix the issue. The locations can be specified as class names, function or method names, or exact line numbers that require modification. _### GitHub Problem Description:_ {issue} _### File Contents:_ {file_contents} Please provide the class name, function or method name, or the exact line numbers that need to be edited. For example: ``` ``` ``` full_path1/file1.py line: 10 class: MyClass1 line: 51 ``` ``` ``` Please think step by step before returning the location(s). Your reasoning should start with "### Thought:", and your answer should start with "### Answer:". 11440 Example 5: Code Edit Generation Prompt You will be provided with an issue statement explaining a problem to resolve and a partial code base. Please first localize the bug based on the issue statement, and then generate _*SEARCH/REPLACE*_ edits to fix the issue. _### GitHub Problem Description:_ {issue} _### Code Content:_ {code_content} Please first localize the bug based on the issue statement, and then generate _*SEARCH/REPLACE*_ edits to fix the issue. Every _*SEARCH/REPLACE*_ edit must use this format: 1. The file path 2. The start of search block: _< < < < < < < SEARCH_ 3. A contiguous chunk of lines to search for in the existing source code 4. The dividing line: ======= 5. The lines to replace into the source code 6. The end of the replace block: _> > > > > > > REPLACE_ For example: ````` python ### mathweb/flask/app.py _< < < < < < < SEARCH_ from flask import Flask ======= import math from flask import Flask _> > > > > > > REPLACE_ ``` ``` ``` Please note that the _*SEARCH/REPLACE*_ edit REQUIRES PROPER INDENTATION. If you would like to add the line ’ print(x)’, you must fully write that out, with all those spaces before the code! Wrap the _*SEARCH/REPLACE*_ edit in blocks ````` python... ````` . Your reasoning should start with "### Thought:", and your answer should start with "### Answer:". 11441

섹션 본문 81문단 · 30,771자

(제목 없음)

1Mainstream issue-resolving frameworks predominantly rely on commercial models, leading to high costs and privacy concerns.Existing training approaches for issue resolving struggle with poor generalization and fail to fully leverage open-source development resources.We propose Subtask-oriented Reinforced Fine-Tuning (SoRFT), a novel training approach to enhance the issue resolving capability of LLMs.We decomposes issue resolving into structured subtasks: file localization, function localization, line localization, and code edit generation.SoRFT consists of two training stages: (1) rejection-sampled supervised fine-tuning, Chain of Thought (CoT) data is filtered using ground-truth before fine-tuning the LLM, and (2) rule-based reinforcement learning, which leverages PPO with ground-truth based rewards.We evaluate the SoRFT-trained model on SWE-Bench Verified and SWE-Bench Lite, achieving state-of-the-art (SOTA) performance among open-source models (e.g., resolve 21.4% issues on SWE-Bench Verified with SoRFT-Qwen-7B).The experimental results demonstrate that SoRFT significantly enhances issue-resolving performance, improves model generalization, and provides a cost-efficient alternative to commercial models.

Introduction

2Large Language Models (LLMs) (OpenAI, 2023;Touvron et al., 2023) have demonstrated exceptional performance across a wide range of complex real-world tasks (Li et al., 2022(Li et al., , 2024;;Wu et al., 2023), particularly excelling in software development (Jimenez et al., 2024;Zhao et al., 2024;Ma et al., 2024c).The current mainstream automated software development systems mainly use commercial models (OpenAI, 2023;Cla, 2024).However, the API call of commercial models are costly and issue Version 2.1 breaks git environment variables.Traceback (most recent call last): File "./site-packages/conda_build/render.py"… File "./site-packages/conda_build/metadata.py"assert not res.startswith(\' .\'), AssertionError: Version can\'t start with leading period LLM Output ### Thought:

31.The error is: "AssertionError: Version can\'t start with leading period" 2. This suggests an issue with how the version string is being processed in the metadata handling.pose privacy leakage issues, limiting their application in development processes in the industry.

4Research communities have attempted to finetune open-source LLMs (Team, 2024a;Guo et al., 2024;Cod, 2024;Touvron et al., 2023;Hui et al., 2024;Lozhkov et al., 2024) to improve their performance in Issue Resolving task.Existing Approaches (Pan et al., 2024;Ma et al., 2024b;Xie et al., 2025a;Ma et al., 2024a) utilize LLMs to sample Chain-of-Thought (CoT) (Wei et al., 2022) data, then perform Negative Sample Filtering based on ground-truth data, and fine-tune the models.While these methods improve LLMs' issue-resolving capabilities, relying solely on supervised fine-tuning (SFT) can lead to poor generalization, making models more susceptible to hallucinations and factual errors.

5Recent studies (Luong et al., 2024;Guo et al., 2025;Zeng et al., 2025;Xie et al., 2025b;Mu et al., 2024;Team et al., 2025) have explored rulebased reinforcement learning to enhance model performance on complex tasks such as mathematics.

6Rule-based reinforcement learning requires groundtruth for evaluation, but constructing ground-truth for math problems is labor-intensive.In the opensource community, a vast number of resolved issues come with ground-truth patches.This raises a natural question: Can we leverage these (issue, patch) pairs for rule-based reinforcement learning to improve the issue-resolving capabilities of language models?

7In this paper, we propose Subtask-oriented Reinforced Fine-Tuning (SoRFT), fully utilizes both positive and negative sample information to improve model performance in Issue Resolving.Given the complexity of the Issue Resolving task (Jimenez et al., 2024), constructing end-to-end training data is challenging.Inspired by Agentless (Xia et al., 2024), we break down issue resolving into multiple subtasks: file localization, function localization, line localization, and code edit generation-and derive ground-truth answers for each subtask from the pull requests associated with the issues.We then perform Reinforced Fine-Tuning (Luong et al., 2024) for these subtasks.

8SoRFT consists of two training stages: rejectionsampled supervised fine-tuning (SFT) and rulebased reinforcement learning (RL).In the SFT stage, we employ a teacher LLM to generate CoT data for each subtask and filter negative samples based on ground-truth answers.We then perform supervised fine-tuning to help the model grasp the subtask structures, underlying reasoning mechanisms, and output formats essential for issue resolving.In the RL stage, since each subtask has a corresponding ground-truth, we employ rulebased proximal policy optimization (PPO) (Schulman et al., 2017) for training.Specifically, we define scoring rules based on ground-truth for each subtask, and update the LLM's parameters using reward-based optimization.This process further improves the model's issue-resolving performance.SoRFT-trained LLMs achieve state-of-the-art performance on SWE-Bench Verified and SWE-Bench Lite, demonstrating the effectiveness of SoRFT in enhancing issue-resolving capabilities.In this paper, we make the following contributions:

9• We introduce Subtask-oriented Reinforced Fine-Tuning (SoRFT), designing rule-based rewards for each issue-resolving subtask and enhancing LLMs' issue-resolving capabilities through reinforced fine-tuning.

10• We apply SoRFT to open-source models and validate its effectiveness within Agentless framework.

11• We investigate the impact of different reward rules on PPO training, providing insights for designing more robust reward rules.

Background

12In this section, we provide a brief introduction to SWE-Bench, issue resolving framework, and the reinforcement learning algorithm.

SWE-Bench

13SWE-Bench (Jimenez et al., 2024) is a benchmark to evaluate language models' ability to resolve realworld software issues, such as bug reports and feature requests on GitHub.LLM-based programming assistants are given an issue description along with the entire repository and are expected to generate code edits that resolve the issue.SWE-Bench Lite (Team, 2024b) ing, whereas the pipeline-based framework offers a clearer and more effective approach to evaluating reasoning accuracy at each stage.In this paper, we design training sub-tasks based on Agentless and employ Agentless1 as the inference framework in our experiments.

Reinforcement Learning

14Reinforcement learning algorithms are widely used in the alignment phase of large language models (LLMs), including proximal policy optimization (PPO) (Schulman et al., 2017), group relative policy optimization (GRPO) (Shao et al., 2024), direct preference optimization (DPO) (Rafailov et al., 2023), and Kahneman-Tversky optimization (KTO) (Ethayarajh et al., 2023(Ethayarajh et al., , 2024)).The PPO algorithm calculates the reward using Equation (1) and subsequently updates the parameters of the Policy Model.

15where q represents the given question, o refers to the predicted output, r ϕ is the reward model, π θ is the policy model, π ref is the reference model (mostly refer to the original policy model π θ old ).

16As PPO is capable of maintaining stability and efficiency during policy updates, we employ PPO for RL training in this paper.

17In the standard PPO algorithm (Schulman et al., 2017), a pre-trained reward model is used to score responses.However, recent studies (Guo et al., 2025;Team et al., 2025) have demonstrated that relying on a reward model can lead to reward hacking, and adopting a more objective scoring approach can effectively mitigate this issue.Since groundtruth can be easily collected for issue resolving tasks, we designed a set of scoring rules to evaluate responses specifically for the issue resolving task.We will present the reward rules in Section 3.3.

Approach

18As shown in Figure 2, SoRFT contains three parts: (1) issue resolving subtask construction, (2) rejection-sampled supervised fine-tuning, and (3) rule-based reinforcement learning.

Issue Resolving Subtasks

19To address the challenge of constructing end-toend training data for the Issue Resolving task, we create training data for phased subtasks.As shown in Figure 2(1), inspired by the design patterns of advanced issue-resolving frameworks (Xia et al., 2024;Ma et al., 2024a), we decompose issue resolving into four subtasks: file localization, function localization, line localization, and code edit generation.This structured decomposition enables a more targeted and effective training process for each phase of the task.

20File Localization.File localization training enhances the LLMs' understanding of the high-level architecture of the repository, enabling them to perform an initial rough localization of relevant files based on the issue description.We utilize the issue and repository structure as inputs, with the full names of the modified files in the pull request (PR) as outputs.To improve the quality of the training data, we excluded non-Python files and test scripts from both input and output.The relationship can be formulated as follows:

21where F g represents the golden file, I represents the issue, R s represents the repository skeleton.

22Function Localization.Function localization training can improve the LLMs' performance on fine-grained localization based on the functional characteristics of the code.In function localization, the issue and file skeleton composed of function names are employed as inputs, while the names of modified functions from the PRs are employed as outputs.This relationship is expressed as:

23where FN g represents the golden function name, I represents the issue, F g,s represents the skeleton of the golden file F g .

24Line Localization.Line localization training enhances the LLMs' ability to precisely identify the exact lines of code that require modification to resolve the issue.Line localization takes the issue description and function content as inputs and outputs the modified lines from the PR.This can be formulated as:

25where L g represents the golden modified line, I represents the issue, FN g,c represents the content of the golden function FN g .

Code Edit Generation.

26Training code edit generation can enhance the LLMs' ability to modify code snippets based on the issue.The input for code edit consists of the issue and the localized code snippet, while the output is the code edits of the corresponding PR.Following previous work (Xia et al., 2024;Yang et al., 2024), we employ the Search/Replace edit format.The Search/Replace format consists Algorithm 1: Rule-based reward

2716 return r of two main parts: 1) Search: the target code snippet that need to modify, and 2) Replace: the new code snippet after editing.This relationship can be formulated as:

28where E g represents the golden code edit, I represents the issue, C g represents the golden code context.

29All subtasks are constructed based on resolved issues from open-source projects, and the groundtruth answers are extracted from the corresponding pull requests.The prompts for the subtasks are provided in Appendix D.

Rejection-sampled Supervised

30Fine-Tuning

31We fine-tune the LLM using Rejection-sampled CoT data to enhance its understanding of the task format and reasoning process for each subtask.As shown in Figure 2(2), we sample CoT data using the LLM and then filter the CoT data based on the ground-truth answer.Specifically, for the three localization subtasks, we filter out samples that have no overlap with the ground-truth file, function or line.For the code edit generation subtask, we filter out samples that have no overlap with the lines modified by the ground-truth edits.Finally, we integrate CoT data from all subtasks to fine-tune the LLM, enabling it to comprehend both the task format and its underlying reasoning mechanisms.

Ruled-based Reinforcement Learning

32We further enhance the reasoning ability and gen-

33where O represents the outputs generated by the LLMs, A denotes the ground-truth answers for the subtask.β is a hyperparameter that balances the impact of precision and recall on final score.Since recall has a greater influence on the final outcome across different subtasks, β should be a value greater than 1.In our experiments, we set β = 3 to prioritize recall while maintaining a reasonable trade-off with precision.

Experiments

34In this section, we will introduce our evaluation benchmark, metrics, models, baselines and implementation details.

Benchmark

35We conduct experiments on two issue resolving benchmarks: SWE-Bench Verified and SWE-Bench Lite.SWE-Bench Verified (OpenAI, 2024c) is a manually verified subset of SWE-bench (Jimenez et al., 2024) with 500 instances.Each instance is a issue associated with test cases that can be executed in a Docker2 environment.Issue resolving frameworks (Xia et al., 2024;Xie et al., 2025a;Wang et al., 2024b;Ma et al., 2024a) are asked to understand the issue and the repository, generate patches and pass all test cases, providing a reliable evaluation of their issue resolving capabilities.

36SWE-Bench Lite (Team, 2024b) is the subset of SWE-Bench containing 300 instances and focuses on evaluating functional bug fixes.

Metrics

37To evaluate the performance of issue resolving frameworks with SoRFT-trained LLMs, we apply two metrics: %Resolved, %Applied.

38%Resolved is the proportion of samples in which applying the generated code edit successfully passed all test cases.

39%Applied is the proportion of samples that issue resolving frameworks successfully generate valid code edits that could be applied to the repositories.This metric evaluates the framework's capability to produce practical and executable solutions.

Framework and Model

40We apply Agentless (Xia et al., 2024) as our issue resolving framework and Qwen2.5-Coder(Hui et al., 2024) series as our base model.Agentless is an advanced open-source issue-resolving framework, used by OpenAI (OpenAI, 2024b) and DeepSeek (Guo et al., 2025) to evaluate model performance on software engineering tasks.For base model, we employ Qwen2.5-Coder-7B-Instruct and Qwen2.5-Coder-32B-Instruct(Hui et al., 2024), which is the SOTA open-source coder instruct models (Touvron et al., 2023;Guo et al., 2024).

Baselines

41Since issue resolving tasks necessitate the use of agent-based or pipeline-based frameworks, existing fine-tuning approaches are typically designed and optimized for specific frameworks.In this work, we evaluate our method against three baselines: (1) OpenHands with SWE-Gym-Qwen, (2) SWE-Fixer with SWE-Fixer-Qwen, and (3) SWE-SynInfer with Lingma-SWE-GPT.

42Openhands with SWE-Gym-Qwen (Pan et al., 2024).Openhands (Wang et al., 2024a) is a purely SWE-Fixer with SWE-Fixer-Qwen (Xie et al., 2025a).SWE-Fixer is a two-stage pipeline-based framework.First, it uses a retriever that combines BM-25 and LLMs to locate the files to be modified, and then uses LLMs to generate code edits to the files.They utilized GPT-4o(OpenAI, 2024a) to collect CoT training data, and fine-tuned the Qwen2.5-Codermodel to serve as the SWE-Fixer-Qwen model.

43SWE-SynInfer with Lingma-SWE-GPT (Ma et al., 2024a).SWE-SynInfer is a hybrid framework that combines pipeline design with agentbased capabilities.In the first stage, the model sequentially analyzes the repository structure, file skeletons, and code snippets to generate a detailed modification plan.Then, it provides tools such as file viewing, allowing the model to invoke these tools in a react manner and generate the final code edit.Similar to Openhands (Wang et al., 2024a), they collected trajectories of SWE-SynInfer invok-ing GPT-4o(OpenAI, 2024a) for issue resolving tasks, filtered out the failed trajectories, and then fine-tuned the Qwen2.5-Codermodel to serve as the Lingma-SWE-GPT model.

Implementation Details

44In this subsection, we will introduce the data construction details, fine-tuning details, and reinforcement learning details.

45Data Construction.To construct our training dataset, we curate a collection of high-quality opensource Python projects from seart-ghs3 by applying a set of stringent criteria.Specifically, we select repositories that satisfy the following conditions:

46(1) at least 1,000 issues, (2) at least 1,000 pull requests (PRs), (3) a minimum of 100 stars, (4) inclusion of an appropriate license, (5) exclusion of forked repositories, and (6) absence from the SWE-Bench test dataset to prevent data contamination.Through this rigorous selection process, we identify a final set of 660 repositories.From this pool, we further select 100 repositories to generate the SFT CoT data.We extract 30,000 (issue, PR) pairs from these repositories and formulate corresponding subtasks.We sample CoT data using Claude-3.5-Sonnet(Cla, 2024) and filter out instances where the final answer does not align with the subtask's ground truth, retaining 60k training samples.We also crawl the (issue, PR) data from the remaining repositories and construct the corresponding subtasks.During the reinforcement learning phase, we randomly select 30k samples for training.

47Fine-tuning.We employ FastChat (Zheng et al., 2023) framework with full sharding strategy and CPU offload strategy implemented by Pytorch FSDP 4 for our 7B model fine-tuning, and employ DeepSpeed (Rasley et al., 2020) for our 32B model fine-tuning.The training process is conducted on 4x8 96G H20 GPUs.We also utilize flash-attention-2 (Dao, 2024) to reduce memory overhead and speed up the training process.We set the global batch size to 128 and train for 2 epochs.We apply cosine learning rate decay with a maximum learning rate of 1e-5 and 3% warm-up steps.

48Reinforcement Learning.We employ Open-RLHF (Hu et al., 2024) framework for our PPO (Schulman et al., 2017) implementation.The training process is conducted on 4x8 96G H20 GPUs.We also utilize ray (Moritz et al., 2018), DeepSpeed (Rasley et al., 2020), flash-attention-2 (Dao, 2024) and vllm (Kwon et al., 2023) to reduce GPU memory overhead and speed up the training process.We set temperature to 1.0 to sample completions for each prompt.

Results and Analysis

49SoRFT achieves SOTA performance among open-source LLMs.The robustness of reward rules is crucial for reinforcement learning.We conduct an ablation study on the reward rule in our algorithm by replacing the F β score with a simpler hit score.Specifically, if the response contains at least one element from the ground-truth answer, the reward score is set to 1.0; otherwise, it is set to 0.0.As shown in Figure 3a, using the hit score leads to reward hacking, where the model tends to generate fewer thoughts and more answers to increase the likelihood of including a ground-truth element.In contrast, Figure 3b demonstrates that using the F β score reduces the generation of redundant answers and stabilizes the answer length.The performance gap in Figure 3c further indicates that a robust reward rule is crucial for SoRFT training.Notably, for the thought length in Figure 3b, we observe a trend consistent with recent studies (Zeng et al., 2025): it initially decreases and then increases during PPO training.In the early stages, the model eliminates unnecessary reasoning to streamline its output.As training stabilizes, it gradually increases the depth and complexity of thought process.

50SoRFT also enhances performance on general code tasks.We also conduct evaluations on two general code tasks: LiveCodeBench (Jain et al., 2024) and RepoQA (Liu et al., 2024).Live-CodeBench focuses on self-contained code generation scenarios, while RepoQA evaluates the ability (Ma et al., 2024a;Xie et al., 2025a;Ma et al., 2024b;Pan et al., 2024) To the best of our knowledge, we are the first work to leverage reinforced fine-tuning (Luong et al., 2024) to enhance the issue-resolving capabilities of LLMs.

51Reinforcement Learning with Rule-based Reward.Since OpenAI released o1 (OpenAI, 2024b) model, many efforts have attempted to enhance LLMs' long-form reasoning capabilities through rule-based reinforcement learning.DeepSeek's R1 (Guo et al., 2025) model with rulebased GRPO (Shao et al., 2024) further demonstrates the potential of rule-based rewards.Team et al. (2025) released Kimi-k1.5, also trained with rule-based reinforcement learning.The research community (Zeng et al., 2025;Xie et al., 2025b) has also been working on replicating rule-based reinforcement learning process.Pan et al. (2025) trained a 3B model with PPO (Schulman et al., 2017) on the Countdown task and observed "Aha moment" (Guo et al., 2025) phenomenon, aligns closely with the behavior of R1.Zeng et al. (2025) trained a 7B model using PPO on Math task and observed that response length initially decreased and then increased (similar as the tendency in Figure 3b).Previous work mainly focused on mathematical tasks, where rewards can be straightforwardly computed based on ground truth.In this paper, we improve the performance of open-source models in issue-resolving framework through subtask-oriented rule-based reinforcement learning.

Conclusion

52In this paper, we propose SoRFT, a subtaskoriented reinforced fine-tuning approach that enhances LLMs' issue-resolving capabilities.By leveraging rule-based reinforcement learning, SoRFT improves performance while ensuring better generalization.Our results demonstrate its effectiveness as a cost-efficient alternative to commercial models.

Limitations

53The False Negatives of Rule-based Rewards.

54The correct resolution to an issue is often not unique.Relying solely on rule-based rewards by comparing the LLM's response to a single ground truth may incorrectly classify valid solutions as failures.To address this limitation, future work could incorporate unit test execution results as a more objective and fair measure of code edit quality.

55Experiments were conducted only in the Python repositories.Due to the lack of a multilingual SWE-Bench test set, our experiments were limited to Python repositories.However, since SoRFT is a language-agnostic framework, we believe it has the potential to improve the issue-resolving capabilities of LLMs in other languages.This is the Appendix of the paper: SoRFT: Issue Resolving with Subtask-oriented Reinforced Fine-Tuning.

A Evaluation Details

56All evaluation experiments are conducted on 4 96G H20 GPUs with vllm (Kwon et al., 2023) framework.We employ the official evaluation scripts 5 from SWE-Bench repository for SWE-Bench Verified and SWE-Bench Lite.On Live-CodeBench (Jain et al., 2024), we evaluate on the code_generation_lite releave_v4 version, which contains 713 problems released between May 2023 and Sep 2024.On RepoQA (Liu et al., 2024), we evaluate on Python repositories with similarity threshold=0.9.

B PPO Training Details

57To support rule-based PPO training, we implement a customized reward function to replace the original reward model scoring function in the Open-RLHF (Hu et al., 2024) framework.We set train batch size to 64, the Adam learning rate for the actor model to 5e-7, and the Adam learning rate for the critic model to 9e-6.As shown in Figure 4, using our designed reward rules, the reward steadily increases as the training steps progress.

C Additional Reasoning Example

58We observed that the model tends to engage in additional reasoning after SoRFT training on 7B model, which bears some similarity to the "aha moment" observed by DeepSeek during the R1 training process (Guo et al., 2025).In Example 1, before concluding its reasoning, the SoRFT-Qwen-7B actively explores whether any potential answers 5 https://github.com/swe-bench/SWE-benchhave been overlooked and successfully identifies the ground-truth function sql_flush.

D Subtask Prompt

59We designed data generation prompts for different subtasks based on the prompts used at corresponding stages of Agentless (Xia et al., 2024)

F Training Data Ablation

60Since the SoRFT utilized more data than SFT in the experiments of Table 2, to more fairly evaluate the effectiveness of SoRFT, we conducted an ablation on the amount of training data.As illustrated in Figure 5, even when SFT was trained on the same amount of data as SoRFT (90k samples), its performance still fell short of SoRFT's results.Increasing the training data for SFT from 60k to 90k samples slightly improved the %resolved but decreased the %Applied, indicating that excessive SFT might impair the model's generalization ability.In contrast, SoRFT was able to more robustly enhance the model's issue resolving capability.

Example 1: Additional Reasoning Example

61Input: Identify all locations that need inspection or editing to fix the problem.Issue: Simplify signature of DatabaseOperations.execute_sql_flush()... Output: ### Thought:

62The issue is about simplifying the execute_sql_flush method's signature from (self, using, sql_list) to just (self, sql_list).... Additionally, there's a sql_flush() method (line 401) that's related to this functionality and might need to be updated as well.... ### Answer: django/db/backends/base/operations.py class: BaseDatabaseOperations function: sql_flush ...

Example 2: File Localization Prompt

63Please look through the following GitHub problem description and Repository structure and provide a list of files that one would need to edit to fix the problem.

64### GitHub Problem Description: {issue} ### Repository Structure: {repository_structure} Please think step by step, provide the full path and return at most 5 files.The returned files should be separated by new lines ordered by most to least important.For example: ``fi le1.py file2.py``Ỳ our reasoning should start with "### Thought:", and your answer should start with "### Answer:".

Example 3: Function Localization Prompt

65Please look through the following GitHub Problem Description and the Skeleton of Relevant Files.Identify all locations that need inspection or editing to fix the problem, including directly related areas as well as any potentially related global variables, functions, and classes.For each location you provide, either give the name of the class, the name of a method in a class, the name of a function, or the name of a global variable.

66### GitHub Problem Description: {issue} ### Skeleton of Relevant Files: {file_skeleton} Please provide the complete set of locations as either a class name, a function name, or a variable name.Note that if you include a class, you do not need to list its specific methods.You can include either the entire class or don't include the class name and instead include specific methods in the class.For example: ``f ull_path1/file1.pyfunction: my_function_1 class: MyClass1 function: MyClass2.my_method``P lease think step by step before returning the locations.Your reasoning should start with "### Thought:", and your answer should start with "### Answer:".

Example 4: Line Localization Prompt

67Please review the following GitHub problem description and relevant files, and provide a set of locations that need to be edited to fix the issue.The locations can be specified as class names, function or method names, or exact line numbers that require modification.### GitHub Problem Description: {issue} ### File Contents: {file_contents} Please provide the class name, function or method name, or the exact line numbers that need to be edited.For example: ``f ull_path1/file1.pyline: 10 class: MyClass1 line: 51 ``P lease think step by step before returning the location(s).Your reasoning should start with "### Thought:", and your answer should start with "### Answer:".

Figure 1 :

68Figure 1: Rule-based reward example for file localization subtask.LLM generates CoT data for a given issue, the reward for the sampled CoT is then calculated by the F β score based on the extracted answer and the groundtruth answer.

Figure 2 :

69Figure 2: SoRFT consists three parts: (1) decompose issue resolving into four subtasks: file localization, function localization, line localization and code edit generation; (2) fine-tune LLMs with rejection-sampled CoT data to enable it follow the task format and reasoning methods for each subtask; (3) employ rule-based reinforcement learning to further enhance the issue resolving ability of LLMs.

70The response length curve during RL training with hit score.

71Performance comparison of different rulebased reward on SWE-bench Verified.

Figure 3 :

72Figure 3: Comparison of rule-based reward strategy: hit score v.s.F β score.

73have attempted to use software development resources from the open-source community to construct training data and fine-tune opensource LLMs.Pan et al. (2024) crawled opensource repositories and utilized closed-source models (e.g.,GPT-4o (OpenAI, 2024a) and Claude-3.5-Sonnet(Cla, 2024)) to generate Openhands(Wang et al., 2024a,b) Agent trajectories, and filtered them through unit tests.Then they used the trajectories to fine-tune the Qwen(Hui et al., 2024) model, enabling it to serve as the base model for Openhands.Ma et al. (2024a) used GPT-4o to generate Agent trajectories on open-source repository issues, and fine-tuned an open-source model with the filtered trajectories.Pan et al. (2024) generated CoT data for and edit generation tasks using GPT-4o, and fine-tuned an open-source model to apply it to SWE-Fixer RAG pipeline.All the above work used SFT to fine-tune models.

Figure 4 :

74Figure 4: Reward over PPO training steps.

Figure 5 :

75Figure 5: Performance of models trained with different training strategies.

76eralization of LLMs on issue-resolving through Rule-based Reinforcement Learning.As shown in Algorithm 1, we utilize the ground-truth answer to calculate the rule-based reward for each subtask.For the localization subtask (line 1-7), we first extract the localization result O loc from the response.If the localization result is empty or contains a target not present in the problem description, the reward is set to 0; otherwise, the reward is calculated as the F β score between O loc and the ground-truth answer A. For the code editing subtask (line 8-15), we first extract the modification target O search and the modification code O edit from the response.If the modification code is empty or the modification target does not appear in the problem description, the reward is 0; otherwise, the reward is calculated as the F

77β score between O edit and the ground-truth answer A. During reinforcement learning period, we replace the reward model in PPO with above rule-based reward.This approach effectively mitigates the risk of reward hacking, ensuring that the model's learning process is guided by precise and reliable feedback.

Table 1 :

78The %Resolved performance of various models on SWE-Bench Verified and SWE-Bench Lite.Given that all fine-tuning approaches are inherently framework-specific, we compare SoRFT-Qwen with previous fine-tuned models within corresponding frameworks.

Table 2 :

79Performance comparison of model with different training strategy on SWE-bench Verified.

Table 3 :

80Performance comparison on LiveCodeBench and RepoQA.ofLLMs to extract information from long-context code content.The results in Table3indicate that SoRFT also has the potential to enhance coderelated tasks beyond issue resolving.There is a large amount of development process data in the open-source community, which remains untapped in current LLM training process.Approaches like SoRFT have the potential to utilize these data to further improving the capabilities of code LLMs.

Table 4 :

81Performance comparison on issue resolving subtasks.

참고문헌

참고문헌 정보가 없습니다.