AI
Specialized Models Speed Up Code Search for AI Agents, Cutting Token Use by 60%
A new approach separates repository exploration from problem-solving, enabling coding agents to find relevant code faster while dramatically reducing computational overhead.
Finding the right code within a large repository has long been a critical challenge for large language model agents tackling software engineering tasks. The process consumes significant computational resources and clutters the agent's working memory with irrelevant information. A research team now proposes decoupling exploration from execution to address this bottleneck.
How Repository Exploration Works Today#
Typical LLM-based coding agents operate as monolithic systems: the same model both searches for relevant code snippets and solves the task at hand. This creates inefficiency because exploration activities—file searches, code scans, and contextual reads—remain embedded in the agent's decision-making history, forcing it to repeatedly revisit and reprocess the exploration phase while working toward a solution.
The FastContext Approach#
The proposed system, called FastContext, introduces a dedicated exploration subagent that operates independently from the main solver. When invoked, this component:
- Issues multiple tool calls in parallel to accelerate discovery
- Returns only essential metadata: specific file paths and line ranges
- Operates as a separate, specialized entity within the larger system
FastContext powers these specialized exploration models, ranging from 4 billion to 30 billion parameters, making them substantially more resource-efficient than the primary solving agent.
Training and Performance#
The exploration models are built through a two-stage process. Researchers first bootstrap them using trajectories from stronger reference models, then refine them with task-grounded reward signals that optimize for three capabilities:
- Broad initial search: Casting a wide net on first attempts
- Multi-turn evidence gathering: Following chains of clues across multiple queries
- Precise citation generation: Pinpointing exact locations in code
Testing across three benchmarks—SWE-bench Multilingual, SWE-bench Pro, and SWE-QA—shows that integrating FastContext into Mini-SWE-Agent improves overall task resolution rates by up to 5.5 percentage points while slashing token consumption by as much as 60%, with only minimal added overhead.

