MAGIS: LLM-Based Multi-Agent Framework for GitHub Issue Resolution

In software development, resolving the emergent issues within GitHub repositories is a complex challenge that involves not only the incorporation of new code but also the maintenance of existing code. Large Language Models (LLMs) have shown promise in code generation but face difficulties in resolving Github issues, particularly at the repository level. To overcome this challenge, we empirically study the reason why LLMs fail to resolve GitHub issues and analyze the major factors. Motivated by the empirical findings, we propose a novel LLM-based Multi-Agent framework for GitHub Issue reSolution, MAGIS, consisting of four agents customized for software evolution: Manager, Repository Custodian, Developer, and Quality Assurance Engineer agents. This framework leverages the collaboration of various agents in the planning and coding process to unlock the potential of LLMs to resolve GitHub issues. In experiments, we employ the SWE-bench benchmark to compare MAGIS with popular LLMs, including GPT-3.5, GPT-4, and Claude-2. MAGIS can resolve 13.94% GitHub issues, significantly outperforming the baselines. Specifically, MAGIS achieves an eight-fold increase in resolved ratio over the direct application of GPT-4, the advanced LLM.

Paper

References (62)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer 1wgB4/10 · confidence 5/52024-07-08

Summary

This paper designs a Multi-Agent framework, MAGIS. Following the form of team problem solving, it designs four agents: Manager, Repository Custodian, Developer, and QA Engineer, which are used to decompose tasks, locate problem codes, generate codes, and review codes, respectively. They help the LLM to better locate problems and generate correct codes in a cooperative way. This framework can solve 13.94% of problems on the SWE-bench benchmark.

Strengths

1. This paper draws on the cooperation method of human team, assigns different roles to agents, and utilizes the powerful understanding ability of the big model for natural language, as well as the professional ability in specific fields stimulated by being assigned specific roles. Compared with simply calling the big model, the effect is improved. 2. This paper draws on the software engineering idea very well. For example, the Kick-off Meeting method is adopted, which can help multiple developers clarify independent tasks, ensure that there is no conflict, and can determine the order of modification.

Weaknesses

1. The paper uses 11 prompts in total, and the specific prompt content cannot be found in the main text, which makes people worry whether the experimental results will strongly depend on the quality of the designed prompts. After replacing other models, the effect may be uncontrollable. 2. The framework is relatively complex and requires a large number of interactions with LLMs. In the end, compared with other baseline scores, whether these additional computing resources are necessary is not further analyzed in the paper. 3. **SWE-bench clearly states that the hints field should not be used in the submission list, but from this paper, it is found that hints seem to be the key to MAGIS improvement.** Is this unfair to other methods? 4. I noticed that there are a lot of new submissions on SWE-bench (Lite) recently. Do you need to do a new comparison? (Of course, I think it is reasonable not to compare, after all, they are working in the same period.) ### Reference - [1] Opendevin: Code less, make more. https://github.com/OpenDevin/OpenDevin/, 2024. - [2] Dong Chen, Shaoxin Lin, Muhan Zeng, Daoguang Zan, Jian-Gang Wang, Anton Cheshkov, Jun Sun, Hao Yu, Guoliang Dong, Artem Aliev, et al. Coder: Issue resolving with multi-agent and task graphs. arXiv preprint arXiv:2406.01304, 2024. - [3] Yingwei Ma, Qingping Yang, Rongyu Cao, Binhua Li, Fei Huang, and Yongbin Li. How to understand whole software repository? arXiv preprint arXiv:2406.01422, 2024. - [4] Yuntong Zhang, Haifeng Ruan, Zhiyu Fan, and Abhik Roychoudhury. Autocoderover: Autonomous program improvement, 2024.

Questions

See the questions in Weaknesses.

Rating

4

Confidence

5

Soundness

3

Presentation

3

Contribution

2

Limitations

The authors explain the limitations of their approach in the paper.

Authorsrebuttal2024-08-11

Dear Reviewer, Thank you very much for your follow-up feedback. We would like to address your concerns: - **Contemporaneous Work**: The two papers you mentioned are contemporaneous works with our submission, in line with the conference guidelines (details shown below). Both papers were published on arXiv (8 Apr and 6 May) within two months of the NeurIPS submission deadline (22 May). As such, they fall under the category of contemporaneous work, which is why we did not include them as baselines in the main body of our paper. Meanwhile, we have already cited (AutoCodeRover[61] and SWE-Agent[59]) and discussed the comparison with these works in Appendix D (Line 718-729). Given your concerns, we will further expand our discussion in the Appendix to provide a more detailed comparison (part of it is shown below). > For the purpose of the reviewing process, papers that appeared online within two months of a submission will generally be considered "contemporaneous" in the sense that the submission will not be rejected on the basis of the comparison to contemporaneous work. Authors are still expected to cite and discuss contemporaneous work and perform empirical comparisons to the degree feasible. Any paper that influenced the submission is considered prior work and must be cited and discussed as such. Submissions that are very similar to contemporaneous work will undergo additional scrutiny to prevent cases of plagiarism and missing credit to prior work. \ > Reference: https://neurips.cc/Conferences/2024/CallForPapers - **Performance and Cost Comparison**: As of the conference submission deadline, the latest score reported by AutoCoderRover was 16.11%, as noted on page 7, second-to-last paragraph of their paper (https://arxiv.org/pdf/2404.05427v2). This score is not higher than the 16.67% we reported. Regarding SWE-Agent, it indeed reported an 18.00% score, which is higher than our ablation version (w/o hints). Thanks for your great suggestions, we reviewed the cost data on SWE-bench Lite and calculated that the average cost per instance for our method is approximately `$0.41`, which is significantly lower than the `$1.67` reported by SWE-Agent. Considering the trade-off between effectiveness (a 1.33% difference in score) and cost (a fourfold reduction), we believe that our approach remains competitive. We acknowledge the contributions of SWE-Agent and AutoCoderRover, as they, along with our work, collectively advance the state of the art in this task. Thank you once again for your valuable time.

Reviewer L5116/10 · confidence 3/52024-07-12

Summary

The paper studies the reasons behind LLMs' failures in resolving GitHub issues, identifying key factors such as locating code files and lines, and the complexity of code changes. The authors propose a novel multi-agent framework, MAGIS, comprising four specialized agents: *Manager* and *Repository Custodian* for planning, *Developer* for coding, and *Quality Assurance Engineer* for code review. Experimental results show that MAGIS significantly outperforms GPT-4 and Claude-2, solving 13.94% on the 25% subset of the SWE-Bench dataset. Ablation studies confirm the effectiveness of each agent's role in the framework.

Strengths

- The paper tackles the challenging problem of using LLMs to resolve GitHub issues. The proposed method is intuitive and effective, achieving an eight-fold performance gain, compared to baseline GPT-4. - The paper conducts massive experiments on both the reason why LLMs fail in the process of resolving GitHub issues, and the role of each agent, providing insights for the research community.

Weaknesses

- The reproducibility of experiments for baseline models like GPT-4 and Claude is unclear. The code and data are temporarily unavailable, hindering follow-up and comparison by other researchers. - Typos: There are minor typos, such as "multi-agennt" instead of "multi-agent" on page 2, line 63, and some missing "%" signs in the resolved ratio on page 7.

Questions

1. In Section 2, I'm a bit confused about the calculation of coverage ratio. How is $[s_i, e_i]$ defined for pure 'deleting' and 'adding' operations? If many code adjustments occur in a single file, does it ensure that each adjustment contributes independently to the coverage? I mean, if model generated code is different from the reference code, the position behind is not aligned.) 2. In Section 4, can you kindly provide more key implementing details, especially for the model comparison experiment in Table 2? Some helpful information may be the core instruction/input for each model, the number of interaction rounds, and whether code interpreter is allowed. Those are all related to the performance of the model. 3. Do you submit (or plan to submit) the results to SWE-Bench official leaderboard? How do this method differ from other agent-based methods?

Rating

6

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

Yes, the authors adequately addressed the limitations.

Authorsrebuttal2024-08-12

Dear Reviewer,   Thank you for your follow-up feedback and for recognizing the value of our work. We appreciate your support and the "weak accept" recommendation. We would like to clarify that our proposed method does not rely on any external tools (such as code interpreters or web browsers) and the external tools are not used in the evaluation in our paper. To address your concerns about the ease of building upon our work, we will release all relevant code, and detailed implementation instructions after the paper is accepted. This will ensure that future researchers can easily reproduce and extend our empirical findings, fostering further developments in this area. Once again, thank you for your constructive feedback.   Best regards, The authors.

Reviewer gcvU6/10 · confidence 4/52024-07-12

Summary

This paper introduces MAGIS, a novel Large Language Model (LLM)-based multi-agent framework designed to address the challenge of resolving GitHub issues in software development. The authors conduct an empirical study to identify key factors affecting LLMs' performance in this task, including file and line localization accuracy and code change complexity. Based on these insights, they propose a collaborative framework consisting of four specialized agents: Manager, Repository Custodian, Developer, and Quality Assurance Engineer. These agents work together through planning and coding phases to generate appropriate code changes. The framework is evaluated on the SWE-bench dataset, demonstrating significant improvements over existing LLMs in resolving GitHub issues. Specifically, MAGIS achieves a resolved ratio of 13.94%, which is an eight-fold increase compared to the direct application of GPT-4. The paper also provides detailed analyses of the framework's components and discusses its effectiveness in different scenarios.

Strengths

Originality: 1. The paper presents a in-depth empirical analysis of LLMs' performance in resolving GitHub issues, providing unique insights into the challenges of applying AI to complex software engineering tasks. 2. The study leverage software engineering metrics, such as the line locating coverage ratio, to quantify LLM performance in code change generation. Quality: 1. The empirical study demonstrates rigorous methodology, examining multiple factors affecting LLM performance including file localization, line localization, and code change complexity. 2. The analysis employs statistical techniques to establish correlations between various complexity indices and issue resolution success, adding depth and reliability to the findings. Clarity: 1. The paper clearly articulates the gap between LLMs' performance on function-level tasks versus repository-level tasks, providing a strong motivation for the study. 2. The authors present their empirical findings with well-designed visualizations and tables, making complex data easily interpretable. Significance: 1. The empirical analysis provides crucial insights that bridge theoretical understanding of LLMs with practical software engineering challenges. 2. The findings directly inform the design of more effective AI-assisted software development tools, as demonstrated by the MAGIS framework. 3. The study lays a foundation for future research in applying AI to software engineering tasks, potentially influencing the direction of both AI and software engineering fields.

Weaknesses

1. Limited dataset diversity: The study relies solely on the SWE-bench dataset, which, while comprehensive, is limited to 12 Python repositories. This may not fully represent the diversity of real-world software projects. 2. Computational resources and efficiency: The paper doesn't discuss the computational requirements or efficiency of MAGIS compared to simpler approaches. 3. Potential overfitting to SWE-bench: The framework might be tailored too specifically to perform well on SWE-bench, potentially limiting its generalizability. 4. Lack of user study: The paper doesn't include feedback from actual software developers on the usefulness and quality of MAGIS's solutions. 5. Limited discussion on prompt engineering: While the paper mentions using prompts, it doesn't delve into the specifics of prompt design or its impact on performance.

Questions

1. Your study focuses on the SWE-bench dataset, which is limited to 12 Python repositories. Have you considered how MAGIS might perform on a more diverse set of programming languages and project types? What steps could be taken to validate the framework's generalizability beyond Python projects? 2. The paper doesn't discuss the computational requirements of MAGIS. Can you provide information on the runtime and resource requirements of MAGIS compared to simpler approaches? How does this impact its practical applicability in real-world software development environments? 3. How have you ensured that MAGIS is not overfitting to the specific characteristics of the SWE-bench dataset? Have you tested the framework on any GitHub issues outside of this dataset to validate its real-world applicability? 4. While you describe the roles of different agents, there's limited analysis of how their interactions contribute to overall performance. Have you conducted any ablation studies on different interaction patterns between agents? This could provide insights into which aspects of the multi-agent approach are most crucial for success. 5. While you mention using prompts, there's limited discussion on prompt design. Could you provide more details on your prompt engineering strategies and how they impact the framework's performance?

Rating

6

Confidence

4

Soundness

3

Presentation

4

Contribution

3

Limitations

1. The authors acknowledge in Appendix K that the SWE-bench dataset, while representative, may not fully reflect the diversity of all code repositories, particularly in specialized fields or different programming paradigms. However, SWE-bench is known as one of the most challenging benchmarks, this might be ok. 2. In Appendix K, the authors mention the potential impact of prompt design on LLM performance and the difficulty in eliminating prompt bias completely. 3. The authors note in Appendix K that applying their findings to other code repositories may require further validation due to the limited sample scope.

Reviewer 15zT7/10 · confidence 4/52024-07-13

Summary

This paper proposes MAGIS, a multi-agent coding framework for solving patch generation tasks. The roles consist of Manager, Repository Custodian, Developer and QA engineer, with the task of planning, file location, file editing, and review, respectively. Experiments on the SWE-bench benchmark show that performance is improved over baselines.

Strengths

- The proposed multiagent framework is simple and effective - The proposed model is effective with and without using the hints provided in SWE-bench - Ablations demonstrate the effectiveness of the QA engineer role

Weaknesses

My concerns are along the evaluation and comparisons: - The main experiments are limited, as only GPT-4 is measured - Baselines such as SWE-agent are missing

Questions

- SWE-bench Lite results (appendix D) should be in the body of the paper - Is ablation of the kickoff meeting possible? This is an interesting mechanism but it's hard to understand whether it is effective or not - Can you explain/show more about the prompts and exemplars (if exemplars are used) for each role?

Rating

7

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

yes

Reviewer 1wgB2024-08-09

I appreciate the authors' response and acknowledge that it clarifies many of my initial concerns. However, I remain apprehensive about the use of the "hints" field in the results, as this could potentially limit the method's applicability. Therefore, I will maintain my current score. In addition, I do not see the author's update in the revision.

Authorsrebuttal2024-08-10

Dear Reviewer, Thank you for your follow-up feedback and for acknowledging the clarifications we provided in our rebuttal. We regret that our response regarding using the "hints" field has not fully alleviated your concerns. To clarify, while the "hints" field was utilized in one specific setting to illustrate potential improvements, our method remains effective without it. As shown in Table 2 of the paper, our approach achieved a score of 10.28% without the use of hints, representing a significant (**~6x**) improvement over the base LLM (i.e., GPT-4) score of 1.74%. This demonstrates the effectiveness of our method, even without hints. Moreover, the experimental results presented in our rebuttal further validate the effectiveness of our method across different LLMs (DeepSeek and Llama 3.1) without relying on hints. Notably, even without QA, our method achieved a score of 11.00%, which is **33 and 8 times** higher than directly using the base models DeepSeek and Llama 3.1, respectively. This demonstrates the applicability of our method, even without hints. In summary, the primary contribution of our work to GitHub Issue resolution lies in the framework of our method, derived from our empirical studies. We will emphasize this point more clearly in our revised manuscript to avoid any potential misunderstandings. Regarding the revision, as per the NeurIPS guidelines, we are unable to upload the updated manuscript during the rebuttal/discussion period. However, we will upload the revision as soon as the system allows. You can refer to the NeurIPS FAQ for more details: https://neurips.cc/Conferences/2024/PaperInformation/NeurIPS-FAQ. We greatly appreciate the time and effort you have taken to review our work. Your feedback has been invaluable in improving our manuscript, and we hope that our clarifications will be taken into consideration. Thank you again for your valuable time to review.

Reviewer 1wgB2024-08-11

Thanks for the author's response. In SWE-bench Lite, I saw that auto-code-rover [1] and SWE-agent [2] achieved 19.00% and 18.00% respectively. These two methods did not use the API of web search, and still had a certain performance difference with MAGIS proposed by the author (16.67%, w/o hints). What is the possible reason for this difference? Or, is MAGIS cheaper (cost and time) than the baseline method? This indicator is evaluated in baselines, but MAGIS is missing this indicator. ``` [1] Zhang, et al. Autocoderover: Autonomous program improvement. 2024. [2] Yang, John, et al. Swe-agent: Agent-computer interfaces enable automated software engineering. arXiv preprint (2024). ```

Authorsrebuttal2024-08-12

Request for Feedback Before Discussion Deadline

Dear Reviewers and Area Chair,   As the discussion deadline approaches, we kindly request all reviewers to review our responses to your comments and share any remaining concerns or questions. We highly value your feedback and want to ensure that all issues are fully addressed before the final decision. We would also like to specifically thank reviewer 1wgB for the thorough discussion and valuable feedback provided so far. We have carefully responded to all of the concerns raised during the review and discussion phases by adding additional experiments and explanations. We hope that these clarifications might lead to a reconsideration of the current score. We sincerely appreciate your valuable time and effort in reviewing our submission.   Best regards, The authors

Reviewer L5112024-08-12

Thank you for your thorough responses. I appreciate the valuable insights and the relatively effective method the paper offers. However, I still have some concerns regarding what and how easily future researchers can build upon this work. Additionally, the varying levels of access to external tools (e.g., code interpreters, web resources) make it hard for fair comparisons or ablations that would help highlight the unique advantages of the proposed agent-based method. Further exploration of these issues may enhance the potential impact of this article. Given those considerations, I will maintain my original score.

Reviewer 15zT2024-08-13

Response to authors

Thank you to the authors for the detailed response. The response addressed my concerns.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC