Skip to content

[RFC] Team Draft Interleaving for A/B Testing #18383

Open

Description

@david-fisher

Is your feature request related to a problem? Please describe

OpenSearch offers extremely limited capabilities when it comes to measuring search result quality and experimenting with different search configurations in an online environment. Given the development of both UBI, [RFC] OpenSearch Search Quality Evaluation Framework and the [RFC] Search Relevance Workbench, the time is right to incorporate A/B testing capabilities.

Describe the solution you'd like

Goal

Using the resources provided by User Behavior Insights (UBI) and Search Relevance Workbench (SRW), we would like to enable A/B testing that requires no external orchestration, front-end modification, nor third-party instrumentation. As a proof of concept, we want to provide an implementation of Team Draft Interleaving, an algorithm for A/B testing that presents a single result list to each user, with the competing search algorithms both represented in the list. This facilitates faster A/B testing, as the user pool is not divided into treatment groups. We would also like to build an A/B test visualization component, taking advantage of a UBI event simulator to generate test results.
Upon successful proof of concept, we would like to incorporate test configuration and visualization into the SRW suite. To do so, we would like to get input on the best architectural and implementation options. Options like a search pipeline, integrated experiment type in SRW, and a new API call are possibilities.

Related component

Search:Relevance

Describe alternatives you've considered

RFC Contributors

david-fisher
epugh

Development and Execution

The current development of the PoC is using the Chorus OpenSearch edition repository, at https://github.com/o19s/chorus-opensearch-edition/tree/add-tdi-for-ab-test. The architectural plan follows the following diagram.

Image

From SRW, we take the search configurations for the A and B arms of the test. Possible configurations are search templates or raw query body, parameterized to accept the input query text. These are currently supported by SRW's search configurations schema and can be created in SRW. SRW's search configuration schema will require the addition of the search endpoint to use. For the purposes of the PoC, this will be the single OpenSearch instance.
Given the two test arms, submit each search configuration and gather the result lists for each. Apply the TDI algorithm to produce a single merged result list. The result items will be annotated with the name of the search configuration that produced them. UBI events generated from the returned results list will need to include that value in the event. This will require a change to the UBI schema.
For the PoC, the interleaving algorithm will be implemented as middleware in Chorus. The UBI event simulator, https://github.com/opensearch-project/user-behavior-insights/tree/main/ubi-data-generator, will be used to generate a set of queries and associated user events to enable dynamic (as if it were running) and static visualizations.

Using TDI A/B Testing

We anticipate two personas using A/B testing

The Developer

Wants to use the per query results to drill down into search relevance performance issues. They will likely want to flag the problem children for closer examination in SRW.

The Business

Wants to evaluate the aggregate performance of competing search algorithms with respect to performance on specific KPIs. They will be the likely consumers of the visualizations.

Architectural choices

At first blush, we see three plausible approaches to architecting the component. These provide a jumping off point for the discussion, but should not be considered to limit the field of consideration to only these three options.

Search Pipeline

Using Search processors - OpenSearch Documentation a possible approach is a search request processor to accept the initial query, split into A and B arms, then use a response processor to interleave and annotate the results.

SRW Experiment Type

Using and SRW experiment, the splitting into A and B arms would happen in the workbench, as would the interleaving and annotation of the results.

API

Analgous to search and msearch, a separate API call could be used to orchestrate the results.

Additional context

Further Reading and Related Work

[RFC] OpenSearch Search Quality Evaluation Framework

User Behavior Insights - OpenSearch Documentation

[RFC] Search Relevance Workbench

Generalized Team Draft Interleaving | Proceedings of the 24th ACM International on Conference on Information and Knowledge Management

Evaluating aggregated search using interleaving | Proceedings of the 22nd ACM international conference on Information & Knowledge Management

Comparing the Sensitivity of Information Retrieval Metrics - Microsoft Research

Activity

  1. added and removed on Jun 3, 2025
  2. wrigleyDan commented on Aug 18, 2025

    @wrigleyDan

    I could imagine the search part of this being implementing as a search request processor.

    Request to define the search request processor:

    PUT /_search/pipeline/team_draft_interleaving 
    {
      "request_processors": [
        {
          "interleave_results" : {
            "description" : "This processor is going to run two queries based on two search configurations and interleave the results",
            "search_configurations" : ["c482ccea-9b8b-4c17-8790-b8ac1acdf452", "050fc355-6f01-4d18-a215-d0a085973615"]
          }
        }
      ]
    }
    

    What I'm uncertain of: the results of two queries are interleaved, so interleaving does not only have a query part but also a search result part. The search results need to be annotated with the search configuration that caused the result. Otherwise, the team draft interleaving online experiment cannot be evaluated.
    Can that be done in a search request processor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions