Small Agents with Semantic Search: Efficient Multilingual Code Localization
Locating relevant files from natural-language requests is a core subtask for agents operating over code repositories. This paper investigates whether that task can be delegated to compact, specialized models to enable on-device search while reducing the token usage, latency, and inference cost of larger agents. It reports that semantic search improves file localization across accuracy, cross-language transfer, and inference efficiency.
To study the setting, the authors introduce a training framework for file-localization agents built around ColGREP, a local semantic search tool based on late-interaction retrieval models. Their recipe combines weighted supervised fine-tuning on teacher trajectories — assigning turn-level credit based on retrieval outcomes — with reinforcement learning on localization quality. They train three model families with fewer than two billion parameters to formulate search queries, inspect retrieved content, and identify relevant files.
On localization tasks derived from SWE-bench Lite and Multi-SWE-bench Flash, ColGREP-equipped agents substantially improve over their base models and outperform corresponding GREP-based agents. ColGREP also reduces mean end-to-end trajectory latency by 44.1% on CPU while using 29.1% fewer tokens, and enables better generalization to programming languages unseen during fine-tuning.
These results suggest that compact, tool-specialized localization agents can provide an efficient interface between natural-language requests and large codebases.