5 exercises — what RAG solves, chunking strategy, semantic search vs. keyword search, reranking, and diagnosing grounded-but-wrong answers.
0 / 14 completed
1 / 14
A colleague asks: "Why do we need RAG if the LLM already knows so much?" What is the most accurate explanation of what RAG solves?
RAG solves two fundamental limitations of a plain LLM: its knowledge is frozen at training time (it doesn't know about events or documents created afterward), and it cannot know about private data (your company's internal wiki, a customer's specific account history) that was never part of its training corpus.
Rather than retraining or fine-tuning the model every time new information appears (expensive, slow), RAG retrieves relevant snippets from an external, easily-updatable knowledge source at the moment of the query, and inserts them directly into the prompt's context — the model then answers using both its general language ability and this freshly retrieved, specific information.
This is why RAG is described as "grounding" a model's answers: it anchors the response in retrieved facts rather than purely the model's internal (and sometimes outdated or hallucinated) knowledge.
2 / 14
A RAG pipeline design document describes "chunking the documents before embedding them." What does chunking mean, and why is it necessary?
Chunking is one of the most consequential design decisions in a RAG pipeline, because retrieval quality depends heavily on how documents are split.
Why it's necessary: a whole 50-page document embedded as a single vector would produce a very generic, "averaged out" representation that poorly matches specific queries about one small section of it. Splitting into smaller chunks lets each chunk's embedding closely represent a focused piece of content, so retrieval can find the specific, relevant passage rather than a whole document that's only partially relevant.
Chunking strategy tradeoffs: chunks too small lose surrounding context (a sentence pulled out of its paragraph may be ambiguous); chunks too large dilute relevance and waste context window space with irrelevant surrounding text. Common strategies include fixed-size chunking with overlap (so context isn't abruptly cut at chunk boundaries) and structure-aware chunking (splitting along natural document boundaries like headings or paragraphs).
3 / 14
A technical spec mentions storing document chunks in a "vector store" and performing "semantic search" to retrieve relevant chunks. How does this differ from a traditional keyword search?
The shift from keyword search to semantic search is the core innovation that makes RAG's retrieval step effective for natural-language questions.
Keyword search limitation example: a user asks "how do I cancel my subscription?" but the relevant help doc is titled "Ending your membership" — a keyword search for "cancel subscription" might completely miss it, since none of those exact words appear in the doc.
Semantic search instead converts both the query and every document chunk into embeddings — vectors of numbers positioned in a high-dimensional space such that semantically similar text ends up close together, regardless of exact wording. "Cancel my subscription" and "ending your membership" would produce nearby vectors because they express similar meaning, so semantic search retrieves the relevant chunk even without matching keywords.
Many production RAG systems use hybrid search — combining semantic and keyword search — since keyword matching still excels at exact terms like product codes, error messages, or proper nouns that embeddings can sometimes blur.
4 / 14
A team reviewing RAG output quality notices retrieval returns 20 candidate chunks, but only the top 3 are actually passed to the LLM after a "reranking" step. What does the reranker do, and why is it a separate step from the initial retrieval?
Reranking exists because there's a real tradeoff between retrieval speed and retrieval accuracy. The initial retrieval step (using vector similarity search) is fast enough to scan potentially millions of chunks, but the similarity metric it uses (often simple vector distance) is a rougher approximation of true relevance than a more sophisticated model could produce.
Two-stage retrieval pipeline: 1. Initial retrieval (recall-focused) — quickly narrow millions of chunks down to a manageable candidate set (e.g. top 20-50) using fast vector similarity search, prioritising not missing relevant results (recall) over perfect ordering 2. Reranking (precision-focused) — apply a more computationally expensive model (a "cross-encoder," which jointly considers the query and each candidate together, rather than comparing pre-computed vectors independently) to re-score just this smaller candidate set with much higher accuracy, then keep only the top few for the LLM's context
This pattern — cheap and broad, then expensive and precise — is a common design principle across information retrieval systems generally, not unique to RAG.
5 / 14
A postmortem for a RAG-powered support bot notes: "The bot confidently answered a question about our refund policy using an outdated document that should have been removed from the index months ago." How would you describe this failure using precise RAG vocabulary, and what's the fix?
Precisely distinguishing this failure mode matters enormously for choosing the right fix — conflating it with "hallucination" (the model inventing information not present in its context at all) would lead a team toward the wrong remedy (trying to fix the model's behaviour) instead of the right one (fixing the data pipeline).
Key distinction:hallucination — the model generates a plausible-sounding but fabricated answer with no supporting source. Grounded but wrong — the model faithfully summarised or used a real retrieved document, but that document itself was incorrect or outdated. The second case is a data/pipeline quality problem, not a model reasoning problem.
Vocabulary for describing the fix:index freshness / re-indexing pipeline — the process that keeps the vector store synchronised with the current state of source documents, typically triggered on document update/deletion, not just document creation. A robust RAG system needs this maintenance pipeline treated as seriously as the retrieval and generation logic itself — a perfectly designed retrieval and reranking pipeline is worthless if it's confidently retrieving stale, deleted, or superseded content.
6 / 14
Reviewer: 'The LLM's response is great, but it keeps referencing this old internal wiki page. Shouldn't we be filtering out outdated content from the knowledge base before feeding it to the model? It feels like a bit of a hack.'
As a senior engineer, how would you respond to this comment during a code review discussion about the RAG pipeline?
This comment highlights a key challenge in RAG systems: managing stale or irrelevant information. While the LLM's ability to access diverse sources is valuable, simply feeding it everything can lead to hallucinations—responses based on outdated data. The 'correct' answer emphasizes proactive filtering to maintain data quality and minimize these issues; this aligns with best practices for building robust RAG pipelines. Options A and B misrepresent the core problem of stale data, while options C and D suggest that simply providing all information is always optimal.
7 / 14
Reviewer: 'The LLM's response is great, but it keeps referencing this old internal wiki page. Shouldn't we be filtering out outdated content from the knowledge base before feeding it to the model? It feels like a bit of a hack.'
As a senior engineer, how would you respond to this comment during a code review discussion about the RAG pipeline?
This comment highlights a key challenge in RAG systems: managing stale or irrelevant information. While the LLM's ability to access diverse sources is valuable, simply feeding it everything can lead to hallucinations—responses based on outdated data. The 'correct' answer emphasizes proactive filtering to maintain data quality and minimize these issues; this aligns with best practices for building robust RAG pipelines. Options A and B misrepresent the core problem of stale data, while options C and D suggest that simply providing all information is always optimal.
8 / 14
Reviewer: 'The LLM's response is great, but it keeps referencing this old internal wiki page. Shouldn't we be filtering out outdated content from the knowledge base before feeding it to the model? It feels like a bit of a hack.'
As a senior engineer, how would you respond to this comment during a code review discussion about the RAG pipeline?
This comment highlights a key challenge in RAG systems: managing stale or irrelevant information. While the LLM's ability to access diverse sources is valuable, simply feeding it everything can lead to hallucinations—responses based on outdated data. The 'correct' answer emphasizes proactive filtering to maintain data quality and minimize these issues; this aligns with best practices for building robust RAG pipelines. Options A and B misrepresent the core problem of stale data, while options C and D suggest that simply providing all information is always optimal.
9 / 14
Reviewer: 'The LLM's response is great, but it keeps referencing this old internal wiki page. Shouldn't we be filtering out outdated content from the knowledge base before feeding it to the model? It feels like a bit of a hack.'
As a senior engineer, how would you respond to this comment during a code review discussion about the RAG pipeline?
This comment highlights a key challenge in RAG systems: managing stale or irrelevant information. While the LLM's ability to access diverse sources is valuable, simply feeding it everything can lead to hallucinations—responses based on outdated data. The 'correct' answer emphasizes proactive filtering to maintain data quality and minimize these issues; this aligns with best practices for building robust RAG pipelines. Options A and B misrepresent the core problem of stale data, while options C and D suggest that simply providing all information is always optimal.
10 / 14
Liam (Lead Engineer) comments on a PR: 'This response is great, but it's pulling in information from the legacy onboarding docs. Shouldn't we be prioritizing more recent documentation for new hires? It feels like we're relying too heavily on historical data.' What does Liam primarily mean by 'prioritizing more recent documentation'?
Liam is advocating for a strategy where the RAG system consistently favors up-to-date information. This aligns with the goal of providing accurate and relevant responses – outdated data can lead to misinformation. The core concept here is *dynamic knowledge retrieval*, prioritizing current sources over historical ones.
11 / 14
During a Slack conversation about optimizing a RAG prompt, Sarah (Data Scientist) writes: 'We need to 'tokenize' the documents before embedding them. It's crucial for reducing noise and improving retrieval accuracy.' What does Sarah mean by 'tokenizing' in this context?
Sarah's referring to a fundamental step in preparing text for embedding. Tokenization breaks down large documents into manageable units – often words or sub-words – which the embedding model can then represent numerically. This avoids issues caused by treating entire sentences as single tokens.
12 / 14
A team is reviewing a PR describing a new RAG pipeline for a customer service chatbot. The description states: 'We'll use a vector database to store the document embeddings and perform semantic search based on cosine similarity.' How does 'cosine similarity' relate to the retrieval process?
Cosine similarity is a key metric in vector search. It assesses how similar two vectors (representing the query and document) are based on their angles. A smaller angle means greater semantic closeness – meaning the documents are conceptually related to the query, even if they don't share many exact words.
13 / 14
David (DevOps Engineer) reports: 'The RAG pipeline is returning 50 candidate chunks for a search query, but only the top 3 are being passed to the LLM after reranking. What's the purpose of this reranking step?'. What problem is the reranker trying to solve?
Reranking is a crucial step in refining the initial retrieval results. The goal isn't simply to process everything; it's to prioritize the *most relevant* chunks for the LLM. This can involve weighting factors beyond just cosine similarity, such as document freshness or query context.
14 / 14
A RAG system is used to answer questions about product documentation. The system's logs indicate that it frequently provides incorrect answers related to recent pricing changes. Analyzing the logs, you identify that the knowledge base contains a document from six months ago detailing those price changes. What is the *most* likely reason for this issue?
While several factors could contribute, the most probable cause is a failure to proactively filter outdated information. This 'drift' occurs when the knowledge base contains superseded data that continues to influence the LLM's responses – leading to inaccurate answers based on obsolete details.
What will I practice in "RAG Vocabulary — AI Prompting English Exercise"?
This is an AI Prompting exercise set. It walks through 14 scenario-based multiple-choice questions built around real usage of AI Prompting terminology that IT professionals encounter on the job.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to complete with no account, sign-up, or paywall.
How many questions are in this exercise?
This set contains 14 questions. Each one shows immediate feedback and a detailed explanation after you answer, so you learn the correct usage right away rather than waiting for a final score.
Do I need prior experience to complete this exercise?
No prior experience is required. Each question includes a full explanation covering the reasoning behind the correct answer, so the exercise itself teaches the AI Prompting vocabulary as you go.
Can I retry the exercise if I get questions wrong?
Yes — use the "Try again" button on the results screen to reset your answers and go through all the questions again. There is no limit on attempts.
Is my progress saved?
Your answers and score for the current session are tracked in the browser as you go. No account or login is needed, and there is nothing to install.
What if I don't understand a term used in a question?
Read the explanation shown after you answer each question — it breaks down the correct term in plain English with a real-world example. You can also check the site Glossary for quick definitions.
How is this different from reading a blog article on the topic?
Exercises like this one are interactive drills that test and reinforce specific vocabulary through multiple-choice questions, while blog articles explain concepts in prose. Practising here after reading builds active recall, not just passive recognition.
Where can I find more AI Prompting exercises?
See the AI Prompting exercises hub for the full set of related pages, or browse all exercise categories from the main Exercises index.
Can I use this exercise to prepare for a technical interview?
Yes — AI Prompting vocabulary comes up often in technical discussions and interviews. Pair this exercise with our dedicated Interview Preparation section for role-specific practice.