TL;DR
SWE-QA-Pro introduces a rigorous repository-level QA benchmark that filters out questions solvable via LLM memorization or single-pass reasoning, isolating tasks that truly require interactive codebase exploration. Alongside the benchmark, the authors present a scalable two-stage training recipe (SFT + RLAIF) that enables a small open-source model (Qwen3-8B) to outperform GPT-4o on complex software engineering queries.
What Problem Does This Paper Address?
Large Language Models (LLMs) are increasingly used as software engineering agents, but evaluating their true repository-level code understanding is notoriously difficult. Existing benchmarks suffer from two major flaws:
- Memorization Bias: They rely on highly popular repositories. Because these codebases were heavily featured in the models' pretraining data, LLMs can often "cheat" by recalling answers from memory rather than actually understanding the code structure.
- Low Tool Necessity: Many benchmark questions can be answered in a single pass without any codebase interaction or tool usage (e.g., reading source files or navigating directories).
This makes it hard to distinguish whether a model genuinely understands a specific repository or is simply regurgitating generic knowledge. SWE-QA-Pro addresses this gap by creating a benchmark of long-tail, less-studied repositories and introducing a strict difficulty calibration process to eliminate questions that don't require active exploration.
Methods
The authors developed a comprehensive framework spanning both benchmark construction and model training:
1. Benchmark Construction & Difficulty Calibration
- Taxonomy & Clustering: The authors applied hierarchical K-Means clustering on over 1.6 million GitHub issues from long-tail repositories to establish a balanced taxonomy of 48 distinct software engineering task subclasses.
- Data Synthesis: Using Claude Code, they generated self-contained problem-solution pairs grounded in executable sandbox environments.
- Difficulty Calibration: To ensure questions required tool usage, they evaluated direct-answer baselines (no repository access) across three frontier models (GPT-4o, Claude Sonnet 4.5, Gemini 2.5 Pro). Questions that these models could easily answer without looking at the repository were discarded.
2. SWE-QA-Pro Agent & Training Recipe
- ReAct Agent Workflow: Instead of relying on passive Retrieval-Augmented Generation (RAG) indices, the authors designed a lightweight ReAct-style agent that actively interacts with codebases using length-controlled
Search,View, and read-onlyCommandLineactions. - Two-Stage Training:
- Stage 1 (SFT): Supervised Fine-Tuning on 1,000 high-quality multi-turn conversation trajectories to teach the model tool syntax and basic repository navigation.
- Stage 2 (RLAIF): Reinforcement Learning from AI Feedback using the Group Relative Policy Optimization (GRPO) algorithm. An LLM-as-a-Judge reward model scores the final answers across five dimensions (correctness, completeness, relevance, clarity, and reasoning quality), heavily weighting correctness to prevent reward hacking.
Datasets
- SWE-QA-Pro Bench: The final evaluation set consists of 260 questions spanning 26 long-tail repositories, ensuring an approximately balanced distribution of question intentions (What, Why, Where, How).
- Training Set: A separate synthetic dataset consisting of 1,000 trajectories for the SFT stage and 464 QA pairs for the RL stage, covering 1,484 distinct repositories.
- Baseline Comparison: The dataset leverages sandbox environments from SWE-Rebench to ensure executability.
Key Insights and Ideas
- The "Direct Answering" Illusion: Traditional benchmarks underestimate the gap between agentic workflows and direct answering. By filtering out the "easy" questions, SWE-QA-Pro reveals a massive performance drop when models are denied repository access (e.g., a 13-point gap for Claude Sonnet 4.5), proving the benchmark successfully isolates genuine codebase exploration.
- RL vs. Data Scaling: Simply adding more SFT data yields diminishing returns. However, introducing an RL phase provides a qualitatively different optimization signal. RL trains the model to be more precise and comprehensive, unlocking the latent capabilities of smaller models.
- Causal Queries are the Frontier: Models perform well on localization tasks ("Where is this feature implemented?") but struggle significantly with causal or explanatory queries ("Why was this design decision made?"), highlighting a key area for future LLM cognitive improvement.
Key Results
- Small Models, Big Impact: A Qwen3-8B model fine-tuned with the SFT+RL recipe achieved an overall score of 35.39, outperforming GPT-4o + Agent (33.08) by 2.31 points and significantly narrowing the gap to much larger proprietary models like DeepSeek-V3.2 (38.69) and GPT-4.1 + Agent (38.47).
- Top Performer: Claude Sonnet 4.5 + Agent achieved the highest overall score on the benchmark at 40.67, driven by its proficient and frequent tool usage.
Limitations and Future Work
- Scale Constraints: Due to the high cost of expert human verification, the test set is limited to 260 questions, which may not fully capture the extreme long-tail diversity of the broader software ecosystem.
- Language Ecosystem: The benchmark is currently restricted to the Python ecosystem because it relies on executable sandboxes to verify agent actions.
- Reward Hacking Risks: Since both the RLAIF training phase and the evaluation framework rely on LLM-as-a-Judge prompts, there is a latent risk of models optimizing for judge preferences rather than objective correctness. The authors suggest exploring process-supervised reward models (PRMs) in future iterations to mitigate this.
Summary updated