One of the harder parts of working on search ranking is figuring out whether a new model is actually an improvement. Does it put more relevant providers near the top? Does it help searchers find providers they’re more likely to contact? Ultimately, does it help more people find the pet care they’re looking for?
We can evaluate a model offline by looking at relevant metrics and comparing it against the current model, but those evaluations don’t always tell us how it will perform with real users. Eventually, we need to put it in front of searchers. Usually that means an A/B test. One group gets the existing ranking, another gets the new one, and we wait for enough data to see whether the change improves the product.
A/B testing is still the right way to answer that question, but it’s an expensive way to compare ranking models. Each experiment splits traffic between models, and we need enough users and time to distinguish a real improvement from normal variation in user behavior. If we have several models that all look promising offline, running a separate A/B test for each one takes a lot of traffic and slows down how quickly we can iterate. We wanted another step in between, which led us to interleaving.
What is interleaving?
Interleaving compares two ranking models by having both contribute to the same set of search results. Instead of sending one group of users to Model A and another to Model B, both models rank the same search and their results are combined into a single list.
To illustrate, imagine a search returns five providers: P1 through P5. Both models receive those same five providers, but rank them differently. We use an interleaving algorithm called Team Draft, which builds a combined list by having the models take turns picking their top-ranked providers. Each model picks its highest-ranked provider that hasn’t already been added to the list. They keep taking turns until the list is complete.
Because both models rank the exact same candidate pool, they’re competing only over the order of the results.
We track which model contributed each result, so when a user interacts with a result we can associate that interaction with the model that put it there.
The algorithm itself is relatively straightforward. The more challenging part was getting it to work correctly inside our production search system, where results have to stay consistent across requests and pages and every interaction has to be traced back to the right model.
Why interleave instead of just A/B test?
Interleaving and A/B testing answer different questions.
In an A/B test, users are split into groups. One group sees results ranked by Model A, while the other sees results ranked by Model B. We then compare outcomes like contacts and bookings to determine whether one model performs better overall.
Interleaving takes a different approach. Both models rank the same set of providers, and their results are combined into one list. As users interact with those results, we track which model contributed each provider. This gives us a relative signal about which ranking is more effective at surfacing results that searchers engage with.
The advantage is that interleaving needs less traffic to reach a result. In an A/B test, each user only sees one model, so we’re comparing two different groups of users and need enough data to rule out differences between those groups. With interleaving, both models appear in the same search for the same user, giving us a more direct comparison of how their results perform. That means we can usually tell which ranking searchers prefer much sooner, which makes it easier to narrow down several promising models before investing in a full experiment. We still A/B test before launching a model. Interleaving lets us save those full tests for the models most likely to improve the product.
There are tradeoffs, though. Users see a blended list rather than the complete ranking from either model, so interleaving doesn’t tell us exactly how either model would perform on its own. The blended list can also mask differences in the overall composition of each model’s results, such as diversity or page-level quality. Interleaving is best suited to comparing how effectively models surface individual results, not measuring every aspect of the search experience. That’s why we still need A/B tests to validate the strongest candidates.
Interleaving isn’t a new concept. Academic researchers have studied its effectiveness for comparing search rankings and predicting the outcomes of online experiments [1]. Airbnb’s search engineering team has also written about using interleaving to speed up ranking experimentation in production [2].
Adding interleaving to Rover Search
We didn’t want to build a separate system for interleaving, so we added it to the existing ranking pipeline, after search identifies the providers that could appear in the results and before they’re returned to the user.
Search first retrieves a pool of potential providers. Each model ranks that same pool, and the interleaver merges those rankings into a single ordering. Nothing else in the search pipeline changes. As far as the rest of the system is concerned, interleaving is just another ranking step.
Making it work in production
Keeping results consistent
If Model A always picked first, it would get an edge just from going first, so the starting model has to be random.
We use a deterministic seed for each searcher to decide which model picks first. A seed is an input to a randomized process that makes its outcome repeatable. This means the starting model varies across searchers but stays consistent for the same searcher across requests.
That consistency matters for things like refreshing a search or moving between pages. We don’t want the ordering to change just because the request was handled by a different server. This gives us a randomized starting model across searchers without making an individual search unpredictable.
Pagination
A search returns results one page at a time. Interleaving each page separately would make every page a new ranking decision, so we build the merged ordering once for the whole interleaving window and store it for subsequent pages. If the window contains 100 providers and a page contains 20, the first five pages all use the same merged ordering. We limit the window to 100 providers to keep the additional ranking and storage overhead manageable.
When the user requests another page, we pull that page’s providers from the stored ordering along with their model attribution. Past the end of the window, the search falls back to the normal production ordering.
Model attribution
Once results are mixed together, we need to remember which model contributed each one. For each result we record its position in the interleaved list and its position in the ranking that selected it, and we log both with our search events.
At a minimum, we need to know:
- Which provider was shown
- Which model ranked it
- Where that model ranked it
- Where it ended up in the interleaved list
- What the user did with it
Testing the interleaving system
Before using interleaving to compare new ranking models, we needed to trust the system itself.
We started with an A/A test. We uploaded the same model under two different identifiers and ran them against each other. With identical rankings, neither side should win consistently, so a consistent winner would mean a bug in the interleaving, attribution, or measurement. The two sides came out even, which gave us confidence that the system was splitting credit fairly.
After establishing confidence in the system through the A/A test, we moved on to interleaving two models we’d already compared in an A/B test. We knew how they performed against each other, so this checked that interleaving behaved sensibly before we used it on models where we didn’t know the answer.
What we learned
Team Draft turned out to be a small part of what we built. Most of the engineering work was making sure the comparison produced reliable results in a production search system. That meant keeping rankings consistent across requests and pagination, tracking model attribution, and validating the system before trusting its results.
We now have another step in our ranking evaluation process:
- Offline evaluation: Identify promising models using historical data and offline metrics.
- Interleaving: Compare promising models using real search traffic and user interactions.
- A/B testing: Validate the strongest candidates against the existing model using product-level metrics.
This gives us a faster feedback loop for evaluating ranking changes. Instead of running separate A/B tests for every promising model, we can use interleaving to narrow down the candidates first, learn from how searchers interact with their results, and reserve full experiments for the models most likely to improve the product.
References
[1] Chapelle et al., Large-Scale Validation and Analysis of Interleaved Search Evaluation, ACM Transactions on Information Systems, 2012.
[2] Airbnb Engineering, Beyond A/B Test: Speeding up Airbnb Search Ranking Experimentation through Interleaving.



