Build and own a File Ranking Specialist Model.
Which files belong in context?
Overview
Reduces context-window waste by surfacing only the files genuinely relevant to a coding task instead of dumping entire directories.
Who owns this decision
VP Engineering, Head of Developer Productivity
Why owned AI may fit
What counts as "relevant" is deeply specific to a codebase's own architecture, naming conventions, and dependency structure, which a generic model has no access to without expensive full-repo context every time.
What this Specialist Model actually does
Decision: Which files belong in context?
This is a larger system with 3 specialist model candidates and 2 supporting or external components.
Who uses this Specialist Model
- VP Engineering
- Head of Developer Productivity
- CTO
Where the specialist model sits
This is a larger system with 3 specialist model candidates and 2 supporting or external components.
Structured extraction of the import/dependency and symbol-usage graph as a preprocessing index
Specialist Model
Small classifier or cross-encoder re-ranker trained on historical task-to-file-selection outcomes
Specialist Model
Code-specialized LLM as a fallback
Specialist Model
Code-specialized LLM as a fallback for ambiguous tasks requiring semantic understanding of the request
More Specialist Models in Software →
Lightweight embedding/ranking model over file paths, symbols, and dependency graph
Supporting component
Lightweight embedding/ranking model over file paths, symbols, and dependency graph for fast candidate retrieval
Integration layer feeding ranked files into the primary coding assistant's context window
Supporting component
How to evaluate and improve it
Evaluation
- Precision of included files (selected files actually used in the resulting edit)
- Recall of included files against the ground-truth file set for a task
- Context-size reduction vs. naive full-repo or full-directory inclusion
Feedback signals
- Developer/agent added a file the ranker excluded (false negative)
- Developer/agent removed a file the ranker included (false positive)
- Task completed successfully with the selected file set vs. required a follow-up retrieval
- Edit failed or produced an error traceable to a missing file in context
- Manual file-selection override accepted or rejected
Model candidates to evaluate
- modernbert-large
- qwen3-coder
- neobert
These are candidates, not performance claims. Run them against your evaluation set.


