SWE-Protégé: Small Language Models for Software Engineering Through Learned Expert Collaboration
Abstract
Small language models (SLMs) offer compelling advantages in cost, latency, and adaptability, but have lagged behind larger models on long-horizon software engineering tasks such as SWE-bench, where they suffer from pervasive action looping and low resolution rates. We introduce SWE-Protégé, a post-training framework that reframes software repair as an expert–protégé collaboration problem. In SWE-Protégé, an SLM remains the primary decision-maker while learning to selectively seek guidance from a strong expert model, recognize stalled states, and follow through on expert feedback. Our approach combines supervised fine-tuning on expert-augmented trajectories with agentic reinforcement learning that explicitly discourages degenerative looping and unproductive expert collaboration. We lightly post-train Qwen2.5-Coder-7B-Instruct to achieve 42.4% Pass@1 on SWE-bench Verified with SWE-agent and Claude Opus 4.1 as the expert, a +25.4% improvement over the prior SLM state of the art, while using expert assistance sparsely (≈4 calls per task and 11% of total tokens). With Claude Sonnet 4.5 as the expert, it reaches 41.0% at a median expert API cost of USD 0.15 per task, 8.2× lower than running the expert alone.