Practice English vocabulary for RAG retrieval strategies: dense retrieval, sparse retrieval, hybrid retrieval, top-k similarity, and reranking.
0 / 12 completed
1 / 12
What is 'dense retrieval' and how does it work?
Dense retrieval (e.g., using bi-encoders like sentence-transformers) encodes text into high-dimensional vectors. Documents semantically similar to the query score high even without sharing keywords — enabling retrieval like 'find documents about car engines' matching 'automobile motor specifications'.
2 / 12
What is 'sparse retrieval using BM25 keyword matching'?
BM25 (Best Match 25) is a strong baseline for keyword retrieval. It rewards documents that contain query terms (TF) while penalizing common terms that appear everywhere (IDF). It's fast, interpretable, and still competitive with neural methods for many queries.
3 / 12
What is 'hybrid retrieval that combines dense and sparse scores'?
Hybrid retrieval addresses the weaknesses of each approach individually. Dense retrieval misses exact keyword queries (product codes, names); sparse retrieval misses paraphrases. Combining both with score normalization and fusion (e.g., RRF — Reciprocal Rank Fusion) consistently outperforms either alone.
4 / 12
What does 'retrieval is top-k by cosine similarity' mean?
Cosine similarity measures the angle between two vectors (ignoring magnitude). Values range from -1 to 1; higher values mean more similar directions in embedding space, indicating semantic similarity. Top-k retrieval returns the k highest-scoring documents as context for the LLM.
5 / 12
What does 'the reranker reorders retrieval results' do?
Two-stage retrieval: a fast bi-encoder retrieves top-k candidates, then a slower but more accurate cross-encoder reranks them. Cross-encoders consider query-document interactions jointly, producing more accurate relevance scores but are too slow to use across the full document corpus.
6 / 12
Sarah from the search team sent this Slack message to the project team: 'Hey all, I'm running a dense retrieval query on user reviews for product X. The results are pretty noisy – lots of irrelevant matches. We should consider tweaking the vector embeddings to better capture the nuances of customer feedback.' What is Sarah most likely trying to improve?
Sarah is focusing on 'noisy results' from a dense retrieval system. Dense retrieval relies on vector embeddings which, if poorly trained or not representative of the data, can lead to irrelevant matches. Adjusting the embeddings directly addresses this issue by improving semantic understanding and reducing these false positives. Increasing the indexed documents would simply increase the volume of potentially relevant results, without necessarily improving their quality.
7 / 12
David is writing a PR description for a change that updates the API endpoint for retrieving customer order history. He includes this line: 'The retrieval strategy now utilizes a top-k selection based on cosine similarity to rank results.' What does David mean when he says 'top-k selection'?
'Top-k selection' in this context refers to a technique where the API returns only the 'k' most relevant items based on a scoring metric (cosine similarity here). This is a common optimization strategy to reduce response time and complexity. It's not simply selecting the single best result or stopping after finding 'k' results; it's returning *those* results.
8 / 12
John from the data science team mentioned during the standup: 'We're experimenting with a denser retrieval model for our knowledge base. Instead of just returning the most similar documents based on keywords, we're now using embeddings to capture semantic similarity. This should improve recall significantly.' What does John primarily mean by 'dense retrieval' in this context?
John is describing a shift from traditional keyword-based retrieval – which relies solely on exact matches – to a more sophisticated approach. Dense retrieval, using embeddings, captures the *meaning* of text and calculates similarity based on semantic relationships, offering greater recall (finding relevant documents) than simple keyword matching. Option A is incorrect because dense retrieval goes beyond just keywords.
9 / 12
You're reviewing a code change that modifies the API response for fetching user session data. The PR description includes: 'The retrieval strategy now employs a top-k selection based on cosine similarity to prioritize sessions likely to contain valuable information.' What is the primary purpose of this top-k approach?
The term 'top-k' signifies a truncation strategy within the retrieval process. It's not about returning *all* sessions; instead, it filters the initial results down to the 'k' most relevant ones according to the cosine similarity score – this reduces the load on subsequent processing and improves response times. Option A is wrong because top-k limits the number of results.
10 / 12
Maria, a senior engineer, comments on a Slack channel: 'I'm seeing inconsistent retrieval performance with this new model. The initial results are often irrelevant, but sometimes we get surprisingly accurate matches. This suggests the dense retrieval is struggling to differentiate between related concepts.' What does Maria likely mean by 'struggling to differentiate between related concepts'?
Maria's observation points to a core challenge with dense retrieval – particularly in scenarios where concepts are closely related. A model struggling to differentiate between these can produce irrelevant results because it's failing to fully grasp the subtle differences needed for accurate ranking and selection. This often indicates an issue with the model itself, not necessarily the data or API latency.
11 / 12
You're investigating a slow response time for a search query in our customer support system. The logs show that the retrieval process is using a hybrid approach – combining dense and sparse retrieval scores. What might be contributing to this slowdown if the sparse retrieval component is significantly impacting the overall score?
A hybrid approach relies on combining scores from different retrieval methods. If the 'sparse' component – typically based on keyword matching – is computationally expensive *and* significantly impacts the final score, it can dramatically slow down the entire process. The other options represent potential issues but aren't directly related to a disproportionate impact of sparse retrieval.
12 / 12
During a code review discussion, a developer explains their use of 'retrieval is top-k by cosine similarity' in the context of a new search feature. What is the most important technical implication of this statement for the reviewer?
'Top-k by cosine similarity' describes a specific retrieval strategy where the system doesn't return *all* results but instead selects the 'k' most similar documents as determined by the cosine similarity metric. This highlights that the algorithm is actively filtering based on relevance and not simply returning every document matching the query – a key distinction.
What will I practise in "Retrieval Strategy Vocabulary"?
Practice English vocabulary for RAG retrieval strategies: dense retrieval, sparse retrieval, hybrid retrieval, top-k similarity, and reranking.
How many exercises are in this module?
This module has 12 multiple-choice exercises, each with instant feedback and a full explanation of the correct answer.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
Do I need to create an account to do these exercises?
No account is required. Just click an option to answer — your score for this session is tracked automatically in the progress bar above.
What happens if I choose the wrong answer?
You'll immediately see which answer was correct, plus a full explanation covering the vocabulary and reasoning behind it — mistakes are where most of the learning happens.
Can I retry the exercises if I want a higher score?
Yes — use the "Try again" button on the results screen to reset and go through all the questions again.
Is my progress saved if I close the page?
No. Progress is tracked only for your current visit; reloading or leaving the page resets the counter. This keeps the exercise simple and account-free.
Where can I find more LLM App Development exercises?
Browse the full LLM App Development hub for related drills, or check the "Next up" link below to continue with a connected topic.
How is this different from reading an article on the same topic?
Articles explain vocabulary and concepts in prose; this exercise tests and reinforces that vocabulary through active recall with immediate feedback — the two work best together.
Who writes these exercises?
Every exercise is written by the CoderSlingo team, drawing on real workplace English used in IT roles, then reviewed for accuracy and clarity.