This post is part 2 of Elastic's Search Labs article series on evaluating search relevance, and covers practical experience using the Phi-3 LLM family as an automated relevance judge.
> Source: Evaluating search relevance part 2 - Phi-3 as relevance judge
Background
Evaluating whether search results actually match user intent is a persistent challenge in information retrieval. Traditional approaches rely on:
- Human judgments — accurate but slow and expensive to scale
- Offline metrics such as nDCG@10 and MRR computed over labeled datasets
- Large proprietary LLMs as judges — effective but costly
- The post documents hands-on experience using Phi-3 as an LLM-as-a-judge for search relevance evaluation within Elasticsearch workflows.
- Small language models offer attractive trade-offs on cost, latency, and self-hosting, making large-scale automated relevance annotation more practical than relying solely on frontier commercial models.
- Prompt design for relevance grading is a central concern: the model must be instructed to judge whether a document answers the query, ideally producing structured judgments usable in ranking metrics.
- Automated LLM judgments are positioned as a complement to — not a replacement for — human evaluation; cross-validation against human labels remains important for trustworthiness.
- The series context (part 2) implies a broader methodology for search quality evaluation, where automated judging feeds into relevance metrics and regression testing for search deployments.
- Compact open-weight LLMs are now viable relevance judges for practical search evaluation pipelines.
- Treat LLM-as-judge output as one signal in a broader evaluation stack that still includes human judgments and classic IR metrics.
- The approach fits naturally into Elasticsearch-centric relevance workflows, supporting iterative improvement of retrieval quality.
This article investigates a middle path: using Phi-3, a compact open-weight model family from Microsoft, to automatically grade query–document relevance.
Key points
Why it matters for search engineers
1. Scalability: LLM judges can annotate orders of magnitude more query–document pairs than human raters, enabling broader evaluation coverage. 2. Cost control: Running a small open-weight model like Phi-3 locally or on modest hardware dramatically reduces per-judgment cost compared to API-based frontier models. 3. CI/CD for search: Automated relevance judgments enable regression testing whenever retrieval logic, analyzers, or ranking models change. 4. Caveats: LLM judges can exhibit biases (position bias, verbosity bias) and may disagree with humans on ambiguous or domain-specific queries; audit samples regularly.