Compare Hosted Models on a Deployed PipelineBeta
To see how a hosted reranker or embedder would behave on your own data, test it on the documents a deployed pipeline retrieves. You compare each model with the one your pipeline uses today, and nothing in the pipeline or its index changes.
Before you start
- Deploy a query pipeline, or serve it through a service, that has a ranker (to compare rerankers) or an embedding retriever with a text embedder (to compare embedders).
- Make sure you have permission to run pipelines in the workspace. The test runs your pipeline, including its retriever and any embedder that comes before the ranker.
Compare models on a pipeline
- On the Embedders or Rerankers tab, open the test drawer for a hosted model. The drawer has a Sample passages and Your pipeline switch. Choose Your pipeline.
- In Pipeline, pick a pipeline version that runs today. The list has each version once: a pipeline's deployed version, and the version each service serves, which can be a pipeline that isn't deployed itself. Drafts, undeployed versions, and services pushed from code aren't listed, and neither are pipelines without a ranker (for rerankers) or a text embedder that feeds an embedding retriever (for embedders). Each option shows where the version runs and what is compared, for example Deployed version ยท Service: Contracts API ยท version 2 ยท ranker, top 3.
- Type a query, and run the comparison. When every column has results, the comparison is done.
- Read the columns. The first column is your pipeline's current ranker or embedder. The other columns are the hosted models you picked. Each column shows:
- The top k documents, where k is the
top_kof the pipeline's ranker or retriever (10 if the ranker has none). - The latency of the model.
- The rank of each document (
#1,#2, and so on). The drawer shows ranks, not scores, because scores from different models can't be compared. - An Only this model mark on each document that is in this model's top k and in no other column's top k. The mark appears once every column is in.
- How many of its top k documents it shares with the current one, for example 4/5 shared with current.
- The top k documents, where k is the
To find out whether a model is worth switching to, look at which documents only it ranks in its top k and how much its top k overlaps with the current one.
How Rerankers Are Comparedโ
The comparison for rerankers is exact:
- The pipeline runs as deployed, up to its ranker, and stops there. The ranker and everything after it, such as an LLM, never run.
- The documents waiting at the ranker, at most 100, are the set the current ranker would get. The query is the one the pipeline passes to the ranker, after any query rewriting.
- The current ranker and each hosted reranker rank that same set.
Swapping a reranker only changes the order of the retrieved documents, so the result shows what switching would give. If the pipeline has more than one ranker, the first one is used.
How Embedders Are Comparedโ
The comparison for embedders is an estimate, labeled Estimate, because switching an embedder for real means re-embedding the whole index. Instead:
- The test builds a candidate pool of up to 100 documents: the top 50 from the pipeline's current embedder and retriever, plus the top 50 from a BM25 retriever on the same document store. BM25 is used only for OpenSearch and Elasticsearch stores. With other stores, the pool holds embedding results only.
- Each embedder embeds the query and the pool documents on the spot. Nothing is written back, and the index keeps its stored embeddings.
- Each embedder ranks the pool by cosine similarity to the query.
The current embedder is compared as the index embedded its documents, including the document embedder's settings, such as a prefix. If the test can't find that document embedder in the deployed index, the current embedder isn't shown, and the models you picked are compared with each other.
The estimate can miss documents that neither the current embedder nor BM25 finds, even if a new embedder would rank them first after a full re-index. The pool also comes partly from the current embedder, which favors it slightly.
Judge Relevance with an LLMโ
To see how relevant each model's top results are, ask an LLM to judge them. The judge is off by default, because each run makes one LLM call that the workspace's LLM integration pays for.
- In the drawer, select Judge relevance with an LLM. This requires an LLM connected to the workspace.
- In Judge model, pick one of the workspace's connected LLMs.
- Run the comparison.
After all columns are in, one call asks the LLM which of the documents shown in any column help answer the query. The LLM doesn't see which model ranked which document, and each document is judged once. Each column then shows Judged relevant: n% of top k, the share of its top k that the judge found relevant, and relevant documents get a mark.
For example, if the judge marks documents A, C, and F as relevant, a top 5 that holds A and C scores 40%, and a top 5 that holds A, C, and F scores 60%.
Keep these limits in mind:
- The score counts which documents are in the top k, not their order.
- The judge can be wrong. It sees only the first 1,500 characters of each document.
- If the judge's reply fails or can't be read, a warning appears and the columns stay as they are.
Troubleshootingโ
If the comparison fails, the drawer shows the reason:
- The pipeline has no ranker or no embedding retriever. Pick a pipeline that has the component you want to compare.
- The pipeline's YAML can't be read. Open the pipeline in Pipeline Builder and fix the YAML.
- The run fails or stops before the ranker. Run the pipeline in Pipeline Builder with the same query. Fix any error in the components that run before the ranker, such as the retriever or an embedder.
- No documents were retrieved. Try a different query.
Related Informationโ
Was this page helpful?