liveBook · Manning

Multi-stage retrieval

As explained in Building Reliable AI Systems

A retrieval technique that finds and ranks results through a sequence of specialized filtering and ranking stages.

Multi-stage retrieval improves search precision by splitting retrieval and ranking into specialized steps. Hybrid dense and sparse retrieval can help find relevant documents, but relevant results may still be buried below less-relevant ones. section 4.3 section 4.3.3

A typical pipeline progressively narrows and ranks candidate documents:

  • Broad retrieval casts a wide net to find potentially relevant documents. section 4.3.3
  • Progressive filtering applies increasingly selective filters to narrow the candidates. section 4.3.3
  • Precision reranking uses more sophisticated models to sort the remaining results. section 4.3.3

Bi-encoders encode queries and documents separately, allowing document vectors to be precomputed and compared with query vectors. Cross-encoders instead process a query and document together as an input pair. section 4.3.3

1. "Company holiday and leave policies for 2023" [marginally relevant]
2. "Benefits enrollment deadlines" [not relevant]
3. "Employees may request remote work accommodations under ADA" [highly
    relevant!]
4. "General remote work guidelines" [somewhat relevant]
5. "New office opening announcement" [not relevant]

The ranked results for a remote-work accommodation query show the precision problem: a highly relevant policy appears below marginal or irrelevant documents. section 4.3.3

How Building Reliable AI Systems covers it

How deep it goes
Explains three pipeline stages and contrasts precomputed bi-encoder similarity with cross-encoder query-document processing.
Examples
Uses a disability-related remote-work query and ranked policy documents to show relevant results buried below noise.
What you can do after
Build it from scratch by combining broad retrieval, progressive filtering, and precision reranking.
How it connects
Ties the technique to hybrid, dense, and sparse retrieval, as well as bi-encoders and cross-encoders.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Reliable AI Systems. The section links point to the parts of the book it draws on.