Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scaling
Trae Agent employs modular agents for repository-level issue fixing, achieving Pass@1 of 75.20%, outperforming SOTA by 10.22%.
Key Findings
Methodology
Trae Agent formulates issue resolution as an optimal solution search, integrating three modules: generation, pruning, and selection. It uses multiple LLMs (Gemini 2.5 Pro, Claude 3.7, GPT-4.1) for diverse candidate generation, employs hierarchical pruning combining deduplication and regression testing to reduce candidate space, and simulates repository understanding via static analysis and dynamic verification for selection. Extensive experiments on SWE-bench with these models show a consistent Pass@1 improvement of 10.22%, with top scores of 75.20%. The approach leverages multi-model parallelism, multi-round pruning, and voting, addressing large search spaces and global understanding challenges.
Key Results
- Trae Agent achieves an average Pass@1 increase of 10.22%, with the highest score of 75.20% on SWE-bench, surpassing all baselines. Multi-model ensemble and hierarchical pruning effectively reduce redundancy, improving candidate quality. Larger ensemble sizes (up to 30) continue to enhance performance, demonstrating scalability. Ablation studies confirm each module's importance; removing any causes performance drops. The method shows robustness across different LLMs and hyperparameters.
- Across Gemini 2.5 Pro, Claude 3.7, and GPT-4.1, Pass@1 improvements range from 5.83% to 14.60%. Larger ensemble sizes yield better results, validating scalability. Hierarchical pruning significantly reduces candidate redundancy, boosting efficiency. Multi-round voting stabilizes decisions, mitigating model bias. The approach maintains high performance even with increased candidate numbers, outperforming existing prompt-based ensemble methods.
- Ablation experiments reveal that pruning and voting are crucial for success. Without pruning, performance drops notably; without voting, stability decreases. The combination of multi-model diversity, hierarchical pruning, and global understanding leads to superior results. Overall, Trae Agent demonstrates a robust, scalable framework for complex repository-level issue resolution, setting new state-of-the-art benchmarks.
Significance
This work addresses fundamental limitations of prompt-based ensemble reasoning in large-scale, repository-level software issue resolution. By integrating modular agents that mimic human understanding—static review, dynamic testing, dependency analysis—it bridges the gap between local patch generation and global codebase comprehension. The approach significantly advances automated software repair, reducing manual effort, and improving reliability. Its open-source release fosters community engagement, pushing the frontier of intelligent software engineering and enabling practical deployment in industrial settings, ultimately contributing to more reliable, maintainable software systems.
Technical Contribution
Trae Agent introduces a novel agent-based architecture that combines multi-model parallel generation, hierarchical pruning, and repository-level understanding via static and dynamic analysis. Unlike traditional prompting methods, it enables multi-turn, context-aware reasoning, with theoretical guarantees on candidate quality. The multi-round voting mechanism enhances decision stability, and the modular design allows easy extension to other tasks. The framework demonstrates superior scalability and robustness, providing a new paradigm for large-scale automated code repair and beyond.
Novelty
This is the first work to propose an agent-based ensemble reasoning framework specifically for repository-level issue resolution. Unlike prior prompt-based approaches limited to single-turn, stateless operations, Trae Agent employs multi-model, multi-round interactions, hierarchical pruning, and comprehensive understanding mechanisms. Its design effectively manages large candidate spaces and complex code dependencies, marking a significant departure from existing methods and establishing a new research direction in automated software engineering.
Limitations
- The approach relies heavily on high-quality candidate generation; poor initial patches limit overall success. Hierarchical pruning may inadvertently discard correct but complex patches, especially in highly intricate codebases. Multi-model and multi-round processes increase computational costs, potentially hindering real-time applications. Its effectiveness in extremely large or multi-language repositories remains to be validated, and further optimization is needed for industrial-scale deployment.
Future Work
Future research will focus on enhancing candidate generation via reinforcement learning, integrating more sophisticated static and dynamic analysis tools, and optimizing multi-model interaction efficiency. Expanding the framework to multi-language repositories and large-scale industrial systems is also planned. Additionally, incorporating human-in-the-loop feedback could further improve accuracy and usability. Exploring adaptive hyperparameters and real-time deployment scenarios will be key to broad industrial adoption, aiming to make automated software repair more reliable and scalable.
AI Executive Summary
Automated software issue resolution remains a significant challenge, especially at the repository level where bugs span multiple files and modules. Existing prompt-based methods struggle with large candidate spaces and lack comprehensive understanding of the entire codebase. Trae Agent introduces a modular, agent-based framework that addresses these issues by integrating generation, pruning, and selection modules. The generation component employs multiple LLMs to produce diverse candidate patches in parallel, increasing the likelihood of finding correct fixes. Hierarchical pruning combines patch deduplication and regression testing to eliminate redundant and faulty candidates, reducing the search space effectively. The selection module simulates repository understanding through static analysis and dynamic verification, employing multi-round voting to select the most plausible patch.
Extensive experiments on SWE-bench with Gemini 2.5 Pro, Claude 3.7, and GPT-4.1 demonstrate that Trae Agent outperforms four state-of-the-art ensemble techniques, achieving an average Pass@1 improvement of 10.22% and a top score of 75.20%. The approach scales well with larger ensemble sizes, continually improving performance, and ablation studies confirm the importance of each component. These results highlight the potential of agent-based ensemble reasoning to revolutionize automated software repair, making it more accurate, scalable, and applicable to real-world industrial environments.
By combining multi-model diversity, hierarchical pruning, and repository-level understanding, Trae Agent sets a new benchmark in automated issue resolution. Its open-source release encourages community collaboration, fostering further innovations. While current limitations include computational costs and dependency on candidate quality, future work aims to optimize efficiency, extend multi-language support, and integrate human feedback. Overall, Trae Agent marks a significant step toward intelligent, scalable, and reliable automated software engineering, promising substantial benefits for both academia and industry in reducing bugs, improving software quality, and lowering maintenance costs.
Deep Dive
Abstract
Software issue resolution is a critical challenge in software engineering and has garnered increasing attention in recent years. With the rapid advancement of large language models (LLMs), substantial progress has been made in addressing real-world software engineering tasks. Recent studies have introduced ensemble reasoning techniques to enhance the performance of LLM-based issue resolution. However, existing prompting-based methods still face limitations in effectively exploring large ensemble spaces and lack the capacity for repository-level understanding, both of which constrain their overall effectiveness. In this paper, we propose Trae Agent, the first agent-based ensemble reasoning approach for repository-level issue resolution. Trae Agent formulates our goal as an optimal solution search problem and addresses two key challenges, i.e., large ensemble spaces and repository-level understanding, through modular agents for generation, pruning, and selection. We conduct extensive experiments using three leading LLMs on the widely-adopted SWE-bench benchmark, comparing Trae Agent against four state-of-the-art ensemble reasoning techniques. Experimental results demonstrate that Trae Agent consistently achieves superior performance, with an average improvement of 10.22% over all baselines in terms of Pass@1. Trae Agent has achieved first place on the SWE-bench Verified leaderboard, with a notable Pass@1 score of 75.20%. We are pleased to release Trae Agent as an open-source project to support the research community, with all resources available at https://github.com/bytedance/trae-agent.