Introduction
Modern search engines operate using a multi-stage retrieval architecture designed to balance speed and accuracy. An initial "fast" stage identifies a set of candidate documents (the top-$k$), which are then processed by increasingly sophisticated and computationally expensive machine-learning models in subsequent reranking stages. However, this pipeline faces a significant hurdle: tail latency. While most queries are processed in milliseconds, a small fraction of "heavy" queries can take orders of magnitude longer, degrading the user experience and complicating system resource management.
The Challenge of Tail Latency
The efficiency of the entire retrieval pipeline is dictated by the first stage. If the value of $k$ is too high, the reranking stages become a bottleneck; if $k$ is too low, relevant documents may be missed entirely. Standard systems often rely on fixed parameters—for instance, always retrieving the top 1,000 documents. This "one-size-fits-all" approach fails to account for the varying complexity of queries.
Tail latency typically arises from the way index traversal algorithms handle specific term combinations. To address this, the authors propose a unified machine-learning framework that dynamically adjusts retrieval parameters for every query, ensuring strict time budgets are met without sacrificing search quality.
The Stage-0 Prediction Framework
The core of the proposed solution is a "Stage-0" predictor that runs before the search process begins. This framework utilizes two innovative components:
- Reference List Framework: To train models without the prohibitive cost of manual relevance judgments, the researchers used "reference lists" generated by an "ideal" (but slow) retrieval run. By calculating the minimum $k$ required for a fast run to match the quality of this ideal baseline, they created a robust training signal.
- Quantile Regression: Search latency and document counts are "heavy-tailed" distributions. Standard regression, which predicts the mean, often underestimates the resources needed for difficult queries. By using Gradient Boosted Regression Trees (GBRT) for quantile regression, the system can predict specific percentiles (e.g., the 95th percentile), allowing for a more conservative and reliable resource allocation for outlier queries.
A Hybrid Retrieval Strategy
The research highlights a fundamental trade-off between different retrieval algorithms. Document-at-a-Time (DaaT) algorithms, such as BMW, are generally faster for typical queries but are prone to extreme tail latencies. In contrast, Score-at-a-Time (SaaT) algorithms, like JASS, are better suited for enforcing strict time caps through early termination.
The authors developed a hybrid system that predicts a query's difficulty and dynamically switches between these algorithms. BMW acts as the "sprinter" for simple queries, while JASS serves as a "safety net" for complex queries that might otherwise exceed the latency budget.
Experimental Results
The framework was evaluated using the ClueWeb09B dataset and over 31,000 queries from the TREC Million Query track. Key findings include:
- Strict Latency Guarantees: The hybrid system achieved a 99.99% response time guarantee of under 200ms, a significant improvement over standard systems where 99th percentile latencies often reach several seconds.
- Improved Efficiency: The model reduced the average number of candidate documents passed to reranking stages by 368 per query compared to fixed-parameter baselines.
- Maintained Effectiveness: Validation against human-judged TREC queries confirmed that these efficiency gains did not lead to a statistically significant loss in retrieval quality (measured by NDCG@10 and ERR@10).
Conclusion and Future Work
This work demonstrates that machine learning can effectively manage the inherent unpredictability of search query processing. By moving from fixed to dynamic, query-specific parameters, retrieval systems can provide consistent performance even at the "tail" of the distribution. Future research may explore incorporating "dynamic" features gathered during the initial milliseconds of a search to further refine predictions mid-flight and reducing the small overhead (<0.75ms) of the prediction stage itself.
Summary updated