Quiz: Retrieval Strategies
Test your knowledge about retrieval strategies, hybrid search, and reranking.
30 questions - Click on each question to reveal the correct answer.
Question 1
What is the main purpose of similarity search in RAG?
a) To generate text
b) To find documents with similar vector representations
c) To train models
d) To compress data
Show Answer
Correct Answer: b
Similarity search finds documents whose vector representations are closest to the query vector.
Question 2
What is the range of cosine similarity?
a) 0 to 1
b) -1 to 1
c) 0 to infinity
d) -infinity to infinity
Show Answer
Correct Answer: b
Cosine similarity ranges from -1 (opposite) to 1 (identical).
Question 3
What does "top-k retrieval" mean?
a) Retrieving all documents
b) Retrieving the k most similar documents
c) Retrieving random k documents
d) Retrieving the k oldest documents
Show Answer
Correct Answer: b
Top-k retrieval returns the k documents with the highest similarity scores to the query.
Question 4
What does MMR stand for?
a) Maximum Match Ratio
b) Maximum Marginal Relevance
c) Minimum Match Retrieval
d) Multiple Match Results
Show Answer
Correct Answer: b
MMR stands for Maximum Marginal Relevance, which balances relevance with diversity.
Question 5
What is the main advantage of hybrid search?
a) Faster than either method alone
b) Combines keyword precision with semantic understanding
c) Uses less memory
d) Requires no configuration
Show Answer
Correct Answer: b
Hybrid search combines BM25 keyword matching with semantic vector search for better overall results.
Question 6
What is BM25?
a) A neural network
b) A keyword-based ranking algorithm
c) A vector database
d) An embedding model
Show Answer
Correct Answer: b
BM25 (Best Match 25) is a classical keyword-based ranking algorithm used in search engines.
Question 7
What is Reciprocal Rank Fusion (RRF)?
a) A type of embedding
b) A method to combine multiple rankings
c) A database
d) An LLM technique
Show Answer
Correct Answer: b
RRF is a technique to combine rankings from multiple retrieval methods into a single ranking.
Question 8
What is reranking in retrieval?
a) Initial document retrieval
b) Re-scoring retrieved documents with a more powerful model
c) Deleting duplicate results
d) Sorting alphabetically
Show Answer
Correct Answer: b
Reranking uses a more powerful model to re-score initial retrieval results for better quality.
Question 9
What is a cross-encoder?
a) A model that encodes documents separately
b) A model that scores query-document pairs together
c) An encryption method
d) A database type
Show Answer
Correct Answer: b
Cross-encoders process the query and document together to produce a relevance score.
Question 10
Why is reranking typically done on a subset of results?
a) Because it's more accurate
b) Because cross-encoders are slower than bi-encoders
c) Because it improves diversity
d) Because databases require it
Show Answer
Correct Answer: b
Cross-encoders are computationally expensive, so reranking is applied to top candidates only.
Question 11
What is the lambda_mult parameter in MMR?
a) Learning rate
b) Trade-off between relevance and diversity
c) Number of results
d) Similarity threshold
Show Answer
Correct Answer: b
lambda_mult (0-1) controls the balance: 1 = pure relevance, 0 = maximum diversity.
Question 12
When is keyword search better than semantic search?
a) Always
b) For exact term matching and rare words
c) Never
d) For conceptual queries
Show Answer
Correct Answer: b
Keyword search excels at finding exact terms, proper nouns, and rare specialized vocabulary.
Question 13
What does score_threshold do in retrieval?
a) Sets maximum results
b) Filters results below a minimum similarity score
c) Sorts results
d) Compresses vectors
Show Answer
Correct Answer: b
score_threshold filters out results with similarity scores below the specified threshold.
Question 14
What is pre-retrieval filtering?
a) Filtering after getting all results
b) Filtering documents before similarity search
c) Filtering the query
d) No filtering
Show Answer
Correct Answer: b
Pre-retrieval filtering applies metadata filters before the similarity search, making it more efficient.
Question 15
Which company provides the Rerank API?
a) OpenAI
b) Cohere
c) Google
d) Microsoft
Show Answer
Correct Answer: b
Cohere provides a production-ready Rerank API for document reranking.
Question 16
What is fetch_k in MMR?
a) Final number of results
b) Number of candidates to consider before diversity filtering
c) Batch size
d) Timeout
Show Answer
Correct Answer: b
fetch_k is the number of initial candidates retrieved before MMR applies diversity selection.
Question 17
What is the typical reranking workflow?
a) Rerank → Retrieve → Return
b) Retrieve many → Rerank → Return top k
c) Return → Rerank → Retrieve
d) Direct reranking without retrieval
Show Answer
Correct Answer: b
First retrieve many candidates (50+), then rerank, then return the top k reranked results.
Question 18
What metric does Euclidean distance measure?
a) Angle between vectors
b) Straight-line distance between vectors
c) Dot product
d) Cosine of angle
Show Answer
Correct Answer: b
Euclidean distance measures the straight-line distance between two points in vector space.
Question 19
What is the EnsembleRetriever in LangChain?
a) A single retriever
b) A retriever that combines multiple retrievers with weights
c) A reranker
d) An embedding model
Show Answer
Correct Answer: b
EnsembleRetriever combines multiple retrievers (e.g., BM25 + vector) with configurable weights.
Question 20
Why might semantic search miss relevant documents?
a) It's too slow
b) It may miss exact terms or rare vocabulary
c) It returns too many results
d) It requires more memory
Show Answer
Correct Answer: b
Semantic search focuses on meaning and may miss exact keyword matches or rare specialized terms.
Question 21
What is the k parameter in RRF formula?
a) Number of results
b) Constant to prevent high ranks from dominating
c) Similarity threshold
d) Batch size
Show Answer
Correct Answer: b
The k constant (typically 60) prevents documents ranked highly in one list from dominating the fusion.
Question 22
What is post-retrieval filtering?
a) Filtering before search
b) Filtering results after retrieval based on criteria
c) No filtering
d) Query filtering
Show Answer
Correct Answer: b
Post-retrieval filtering applies filters to results after they've been retrieved.
Question 23
Which is more efficient: pre or post-retrieval filtering?
a) Post-retrieval
b) Pre-retrieval
c) Both are equal
d) Depends on filter complexity
Show Answer
Correct Answer: b
Pre-retrieval filtering is more efficient as it reduces the search space before similarity computation.
Question 24
What type of model is ms-marco-MiniLM-L-6-v2?
a) Embedding model
b) Cross-encoder reranker
c) LLM
d) Vector database
Show Answer
Correct Answer: b
ms-marco-MiniLM-L-6-v2 is a cross-encoder model trained on MS MARCO for reranking.
Question 25
What is the output of a cross-encoder?
a) A vector embedding
b) A relevance score
c) Generated text
d) A classification label
Show Answer
Correct Answer: b
Cross-encoders output a relevance score indicating how relevant a document is to a query.
Question 26
Why use weights in EnsembleRetriever?
a) To make it faster
b) To control the importance of each retriever
c) To reduce results
d) To encrypt data
Show Answer
Correct Answer: b
Weights control how much each retriever contributes to the final ranking.
Question 27
What is inner product equivalent to for normalized vectors?
a) Euclidean distance
b) Cosine similarity
c) Manhattan distance
d) Hamming distance
Show Answer
Correct Answer: b
For normalized vectors (length = 1), inner product equals cosine similarity.
Question 28
What is the main disadvantage of reranking?
a) Lower quality results
b) Added latency and cost
c) Fewer results
d) Requires GPU
Show Answer
Correct Answer: b
Reranking adds latency (cross-encoder inference) and potentially cost (API calls).
Question 29
When should you NOT use hybrid search?
a) Domain with technical terms
b) Purely conceptual/semantic queries
c) Product search
d) Named entity queries
Show Answer
Correct Answer: b
For purely conceptual queries without specific terms, semantic search alone may be sufficient.
Question 30
What is a typical number of candidates to rerank?
a) 5
b) 20-50
c) 1000
d) All documents
Show Answer
Correct Answer: b
Typically 20-50 candidates are retrieved and reranked to balance quality with latency.
Results
| Score | Level |
|---|---|
| 27-30 | Excellent - Strong understanding of retrieval strategies |
| 21-26 | Good - Some review recommended |
| 15-20 | Average - Review the chapters again |
| Below 15 | Needs comprehensive review |