Introduction
In modern search systems, matching keywords is relatively straightforward, but capturing user intent remains a significant challenge. As search moves toward semantic matching—understanding concepts rather than just characters—traditional evaluation metrics are struggling to keep pace. Researchers from LinkedIn and Walmart recently proposed a new framework in their paper, "Semantic Search Evaluation," which leverages Large Language Models (LLMs) to automate search quality measurement through a new metric: the On-Topic Rate (OTR).
The Challenge of Search Evaluation
Evaluating search engines typically involves a trade-off. While online A/B testing provides the most accurate reflection of user satisfaction, it is slow, expensive, and risks exposing users to suboptimal results. Conversely, offline evaluation using historical data and metrics like nDCG (normalized Discounted Cumulative Gain) often fails to detect whether a result is semantically "on-topic." For example, a query for "promotion tips" might return a post about "personal branding" that happens to use the word "tips." Traditional metrics might count this as a match, but it doesn't satisfy the user's specific intent.
Methodology: The OTR Pipeline
The researchers developed an automated offline evaluation pipeline designed to mimic human judgment. The process consists of four distinct stages:
- Query Set Creation: A combination of a stable "Golden Set" (high-volume and complex queries) and a dynamic "Open Set" (trending topics).
- Retrieval: The system pulls the top $K=10$ results from the production environment for each query.
- LLM Prompting: GPT-3.5 is used to judge the relevance of the retrieved content. The team discovered that the specific phrasing of the prompt is critical; shifting from general relevance to asking if a post is "primarily about" the query significantly improved accuracy.
- Metric Calculation: The LLM outputs a binary decision, which is aggregated into the On-Topic Rate (OTR)—the percentage of retrieved documents deemed relevant.
Key Insights: The Power of Prompt Engineering
A major finding of the study was the impact of prompt nuance. General relevance prompts often led the LLM to fall back on keyword-matching tendencies, resulting in false positives. By refining the prompt to focus on whether the content was primarily about the topic, the researchers were able to better distinguish between incidental keyword mentions and true topical relevance.
Additionally, the pipeline requires the LLM to provide a "Decision Reason." While not part of the quantitative OTR score, these explanations serve as a powerful debugging tool, allowing engineers to understand why certain results were flagged as off-topic and iterate on the underlying search models.
Results and Impact
The LLM-based pipeline demonstrated remarkable alignment with human experts:
- Human Alignment: GAI decisions showed an 81.72% consistency with a panel of 10 expert human annotators.
- High Accuracy: On a manually labeled validation set, the pipeline achieved 94.5% accuracy.
- Operational Efficiency: LinkedIn has integrated this pipeline into its weekly monitoring workflows, enabling the team to benchmark new models offline and prevent relevance regressions before they reach production.
Conclusion
By treating LLMs as scalable "expert users," this approach bridges the gap between rigid information retrieval metrics and the nuanced reality of human language. While challenges remain regarding API costs and model dependency, the OTR metric provides a robust, scalable way to ensure that semantic search systems truly understand what users are looking for.
Summary updated