Skip to main content

Exam Theory: RAG and Optimization

This exam theory focuses on assessing the concepts of Retrieval-Augmented Generation (RAG) and its optimization techniques, from basic foundations to more advanced topics.

No.Training UnitLectureTraining contentQuestionLevelMarkAnswerAnswer Option AAnswer Option BAnswer Option CAnswer Option DExplanation
1Unit 1: RAG and OptimizationLec 1RAG ArchitectureWhat are the two main components of a Retrieval-Augmented Generation (RAG) system?Easy1AThe retriever and the generatorThe encoder and the decoderThe indexer and the parserThe database and the promptA RAG (retrieval-augmented generation) system has two main components: the retriever and the generator.
2Unit 1: RAG and OptimizationLec 1RAG ArchitectureWhat is the primary function of the retriever in a RAG system?Easy1CTo format the output text based on formatting rulesTo generate responses using internal knowledgeTo search for and collect relevant information from external sourcesTo filter out sensitive information from the user promptThe retriever searches for and collects relevant information from external sources, like databases, documents, or websites.
3Unit 1: RAG and OptimizationLec 1RAG ArchitectureWhat is the primary function of the generator in a RAG system?Easy1BTo index the knowledge baseTo use retrieved information to create clear and accurate textTo collect user feedbackTo convert text into dense embeddingsThe generator, usually an advanced language model, uses the retrieved information to create clear and accurate text.
4Unit 1: RAG and OptimizationLec 1Benefits of RAGWhy is relying only on an LLM’s internal knowledge a limitation?Easy1AThe system is limited to what it was trained on, which could be outdated or lacking detail.It relies too heavily on internet connections.Internal knowledge is always biased and cannot be trusted.It causes the LLM to process queries much slower.If you rely only on an LLM’s built-in knowledge, the system is limited to what it was trained on, which could be outdated or lacking detail.
5Unit 1: RAG and OptimizationLec 1Benefits of RAGHow does a RAG system help reduce "hallucinations"?Easy1BBy shutting down the model when it detects an errorBy grounding answers based on real, retrieved data from external sourcesBy using a secondary LLM strictly for fact-checkingBy forcing the user to provide correct context in the promptRAG reduces hallucinations because the answers are based on real, fetched data rather than the model making up facts.
6Unit 1: RAG and OptimizationLec 1RAG ApplicationsHow does RAG improve customer support chatbots?Easy1CBy automatically refunding angry customersBy generating code to fix customer issues directlyBy retrieving up-to-date documentation or FAQs to generate accurate answersBy translating customer queries into multiple languagesRAG powers customer support by pulling current policy info or product details to ensure customer queries are resolved with the latest information.
7Unit 1: RAG and OptimizationLec 1RAG ApplicationsIn conversational agents (e.g., healthcare or finance chatbots), what role does RAG play?Easy1DIt completely replaces human agents.It manages the backend server infrastructure.It encrypts all user conversations.It provides factual, context-aware responses by fetching relevant facts on the fly.By fetching relevant facts on the fly, a conversational agent can give informed answers grounded in credible sources.
8Unit 1: RAG and OptimizationLec 1RAG ApplicationsHow can RAG assist in content generation and summarization?Medium1BIt replaces the need for original writers entirely.It retrieves parts of articles/papers and produces verified summaries against source data.It auto-publishes content to social media platforms.It generates clickbait titles for articles.RAG retrieves parts of news articles or research papers and then produces summaries or reports that are coherent and fact-checked against source data.
9Unit 1: RAG and OptimizationLec 1RAG ApplicationsWhy is RAG useful for domain-specific research like law or medicine?Easy1AIt pulls from domain-specific databases (e.g., case law, medical journals) to ground output in reliable knowledge.It generates artificial legal cases or medical data for practice.It is cheaper than hiring domain experts.It can diagnose diseases directly from images.RAG systems assist by pulling from domain-specific databases to answer complex queries, ensuring the model's output is reliable domain knowledge.
10Unit 1: RAG and OptimizationLec 1Knowledge SourcesWhich of the following is an example of a structured knowledge source used by RAG?Easy1CA collection of PDF documentsWebsite archivesA database or knowledge graphAudio transcriptsStructured sources include databases, APIs, or knowledge graphs, where data is organized and easy to search.
11Unit 1: RAG and OptimizationLec 1Knowledge SourcesWhich of the following best describes an unstructured knowledge source?Easy1ALarge collections of text, such as documents or websites, requiring NLUA SQL database with strictly typed tablesA REST API returning JSON formatted dataA spreadsheet containing categorized numerical dataUnstructured sources consist of large collections of text, such as documents, websites, or archives, where the information needs to be processed using NLU.
12Unit 1: RAG and OptimizationLec 1Prompt EngineeringWhy does prompt engineering matter in a RAG system?Medium1BIt dictates what database the retriever uses explicitly.It guides the language model to provide high-quality, relevant responses using the retrieved info.It controls the speed of the dense embeddings generation.It allows users to bypass security measures.Prompt engineering helps language models provide high-quality responses using the retrieved info. Designing a prompt affects output relevance and clarity.
13Unit 1: RAG and OptimizationLec 1Prompt EngineeringWhat is the purpose of a specific system prompt like "Answer the question based only on the context provided"?Medium1AIt gives explicitly instructions to reduce the probability of hallucinations.It ensures the model provides the longest possible answer.It tells the system to bypass the vector database.It allows the model to mix internal knowledge creatively.It gives the model explicit instructions to only use the provided context, which reduces the probability of hallucinations.
14Unit 1: RAG and OptimizationLec 1Prompt EngineeringWhat does few-shot prompting involve in the context of RAG?Medium1CPrompting the model multiple times until it gets the answer right.Breaking the database into a few specific shots.Giving the model a few example responses before it generates its own.Using only a few words in the user prompt to save tokens.Few-shot prompting involves giving the model a few example responses before asking it to generate its own to guide the type of response you want.
15Unit 1: RAG and OptimizationLec 1Prompt EngineeringHow does chain-of-thought prompting benefit RAG handling complex questions?Medium1DIt chains multiple databases together.It quickly skips the reasoning phase to provide faster answers.It prevents the user from asking complex questions.It encourages the model to explain its reasoning step-by-step before answering.Chain-of-thought prompting breaks down complex questions by encouraging the model to explain its reasoning step-by-step before answering.
16Unit 1: RAG and OptimizationLec 1Retrieval MethodsWhat is sparse retrieval in a RAG system?Easy1AMatching keywords using methods like TF-IDF or BM25.Representing documents as numerical vectors in a shared space.Retrieving files only from limited sparse datasets.Searching only the metadata of documents.Sparse retrieval matches keywords (e.g., TF-IDF or BM25). It is simple but may not capture the deeper meaning behind the words.
17Unit 1: RAG and OptimizationLec 1Retrieval MethodsWhat is a common limitation of sparse retrieval?Medium1BIt requires massive computational power compared to dense retrieval.It may not capture the deeper meaning behind the words.It cannot be used with structured data.It generates unpredictable hallucinated documents.While simple, sparse keyword matching may not capture the deeper contextual meaning behind the words in the query.
18Unit 1: RAG and OptimizationLec 1Retrieval MethodsWhat is dense retrieval?Medium1CRetrieving the most dense, text-heavy documents first.Matching highly frequent exact keywords.Using neural embeddings to understand the meaning of documents and queries.Searching through heavily compressed ZIP files.Dense retrieval uses neural embeddings to understand the meaning of documents and queries across a shared vector space.
19Unit 1: RAG and OptimizationLec 1Retrieval MethodsWhich of the following methods are typically used for dense retrieval?Medium1DBM25 and TF-IDFInverted Indices and HashingSQL and GraphQLBERT or Dense Passage Retrieval (DPR)Methods like BERT or Dense Passage Retrieval (DPR) represent documents as vectors in a shared space, making dense retrieval more accurate.
20Unit 1: RAG and OptimizationLec 1Integration ChallengesWhat challenge arises if irrelevant data is retrieved and passed to the generator?Medium1AIrrelevant data can confuse the model and reduce the quality of the response.The model will automatically delete the irrelevant data.The vector database will crash.It will significantly speed up the response generation.The retrieved data must be highly relevant because irrelevant data can confuse the model and reduce the quality of the response.
21Unit 1: RAG and OptimizationLec 1Integration ChallengesWhat can happen if retrieved information conflicts directly with an LLM's internal knowledge?Medium1CThe LLM will always overwrite the retrieved database.The retriever will automatically trigger a self-correction mechanism.It can create confusing or inaccurate answers.The query will be entirely rejected by the generator.If retrieved information conflicts with the model’s internal knowledge, it can create confusing or inaccurate answers. Resolving these conflicts is crucial.
22Unit 1: RAG and OptimizationLec 1Integration ChallengesWhy might the formatting of retrieved data pose a challenge in RAG?Hard1BBecause all retrieved data must be strictly formatted in JSON.The style and format of retrieved data might not match the model's usual writing, making integration difficult.Formatting heavily impacts semantic chunking.Generators cannot process tabular formatting.The style and format of retrieved data might not always match the model's usual writing or formatting, making it hard to integrate smoothly.
23Unit 1: RAG and OptimizationLec 1Vector DatabaseWhat are dense embeddings stored in a vector database?Medium1DStructured SQL commandsHTML representations of textPlain text matched to keywordsNumerical representations that capture the meaning of words and phrasesEmbeddings are numerical representations that capture the meaning of words and phrases, created by models like BERT or OpenAI.
24Unit 1: RAG and OptimizationLec 1Vector DatabaseHow does a vector database find similar documents when a query is made?Medium1AIts query embedding is compared to the stored embeddings in the DB.It parses the query for keywords and matches them to a string index.It runs a fast SQL SELECT command.It prompts the language model to write a similar document.When a query is made, its embedding is compared to the stored ones in the vector database to find semantically similar documents.
25Unit 1: RAG and OptimizationLec 1System EvaluationWhen evaluating a retriever, what does precision measure?Medium1CHow many answers the generator made up.How many user queries were successfully parsed.How many of the retrieved documents are actually relevant.How fast the retriever returned the results.For the retriever, precision measures how many of the retrieved documents are relevant to the query.
26Unit 1: RAG and OptimizationLec 1System EvaluationWhen evaluating a retriever, what does recall measure?Medium1DHow well the generator remembered past conversations.How many generated tokens matched the source.How fast the retriever fetched data.How many of the total relevant documents were actually found.Recall is used to assess how many of the total relevant documents existing in the knowledge base were successfully found by the retriever.
27Unit 1: RAG and OptimizationLec 1System EvaluationWhich metrics are commonly used to evaluate the generator component in a RAG system?Hard1CThroughput and LatencyPrecision and RecallBLEU and ROUGETF-IDF and BM25For the generator, metrics like BLEU and ROUGE are used to compare the generated text to human-written examples to gauge textual quality.
28Unit 1: RAG and OptimizationLec 1System EvaluationFor downstream tasks like question-answering, what metrics can evaluate the overall RAG system?Medium1BUptime and ping timesF1 score, precision, and recallEpoch lossesMemory utilizationFor downstream tasks like question-answering, evaluating the overall system can be done with metrics like F1 score, precision, and recall.
29Unit 1: RAG and OptimizationLec 1Handling AmbiguityIn a RAG system, what is query refinement?Medium1AAutomatically suggesting clarifications or reformulating an ambiguous query.Deleting queries that are not perfectly structured.Limiting the query to a maximum character count.Using SQL to join multiple tables based on the query.Query refinement automatically suggests clarifications or reformulates ambiguous queries into more precise ones based on patterns or history.
30Unit 1: RAG and OptimizationLec 1Handling AmbiguityWhy might retrieving a diverse set of documents help handle incomplete queries?Medium1CIt trains the vector database on a diverse topic set.It saves computational costs over time.It ensures that even if the query is vague, some relevant information is likely included.It guarantees the generator will output a short response.Retrieving a diverse set of documents ensures that even for vague queries covering multiple interpretations, relevant info is likely included.
31Unit 1: RAG and OptimizationLec 1Handling AmbiguityHow can Natural Language Understanding (NLU) assist with incomplete queries?Hard1BIt automatically terminates failed queries.It infers user intent from incomplete queries and refines the retrieval process.It translates queries directly into Python code.It generates database records based on the user's IP.NLU models can infer the user intent from incomplete queries in order to refine the retrieval process and fetch accurate results.
32Unit 1: RAG and OptimizationLec 2Choosing RetrieversWhich type of retrieval is best for complex queries that need deep understanding of word meaning?Easy1ADense retrievalSparse retrievalKeyword mappingInverted IndicesDense retrieval methods (e.g., BERT, DPR) capture context and deeper meanings, making them ideal for complex queries.
33Unit 1: RAG and OptimizationLec 2Choosing RetrieversWhen might a sparse retrieval method (like BM25) be more suitable than dense retrieval?Medium1BWhen queries rely heavily on unstated contextWhen tasks revolve around simple keyword matching and computational resources are limitedWhen documents are highly abstract research papersWhen processing unstructured video filesSparse retrieval is quicker, easier to set up, and better when tasks revolve around keyword matching or computational power is limited.
34Unit 1: RAG and OptimizationLec 2Choosing RetrieversWhat is the main trade-off between dense and sparse retrieval methods?Medium1CSecurity versus PrivacyFormat compatibility versus SpeedAccuracy versus Computational costText limit versus Context limitThe main trade-off when choosing between dense and sparse methods is the accuracy of understanding meaning versus the computational cost required.
35Unit 1: RAG and OptimizationLec 2Hybrid SearchWhat exactly does a hybrid search combine?Easy1DExternal databases and local text filesSQL operations and NoSQL operationsText generators and Image generatorsThe strengths of both dense and sparse retrieval methodsHybrid search combines sparse retrieval (for speed) and dense retrieval (for accuracy) to balance performance and efficiency.
36Unit 1: RAG and OptimizationLec 2Hybrid SearchIn a typical hybrid search pipeline, what is a common sequence of operations?Hard1AUse sparse method (like BM25) to quickly find documents, then use dense method (like BERT) to re-rank them.Use dense method to summarize documents, then use sparse method to find keywords.Use dense method exclusively, and use sparse method only as a failover.Merge the vector embeddings with the sparse inverted indices directly.A typical hybrid flow uses sparse methods to quickly fetch broad keywords, and dense methods to re-rank and understand context of those fetched results.
37Unit 1: RAG and OptimizationLec 2Vector DB AlternativesIs a vector database always necessary to implement a RAG system?Easy1CYes, RAG cannot function without one.Yes, but only for cloud-based setups.No, alternatives exist like traditional relational/NoSQL DBs or file systems.No, RAG models always have vector databases integrated natively.While great for embeddings, vector DBs are not strictly necessary. Relational/NoSQL databases or inverted indices can work for structured/sparse tasks.
38Unit 1: RAG and OptimizationLec 2Vector DB AlternativesWhen are traditional databases like MongoDB or Elasticsearch appropriate in RAG?Medium1BFor cutting-edge dense semantic searches.For handling unstructured data and full-text keyword searches without deep semantic search.For hosting the generative language model itself.For creating neural network embeddings.They are good for handling unstructured data and full-text searches, though they typically lack deep semantic search capabilities out of the box.
39Unit 1: RAG and OptimizationLec 2Vector DB AlternativesWhat is a limitation of using inverted indices instead of vector databases?Medium1AThey map keywords fast but don't capture the semantic meaning behind the words.They are significantly slower than vector databases.They require advanced neural networks to map text.They consume far more memory than vector embeddings.Inverted indices map keywords to documents for fast searches, but they do not capture the underlying meaning or context behind the keywords.
40Unit 1: RAG and OptimizationLec 2Optimizing RetrievalHow does curating high-quality knowledge bases impact retrieved information?Easy1DIt increases the latency of retrieval.It allows the LLM to access the public internet.It removes the need for checking metrics like F1 score.It ensures the information is reliable and fits the exact needs of the application.Having a curated knowledge base directly controls what the retriever can find, ensuring results are reliable and suited to the app's needs.
41Unit 1: RAG and OptimizationLec 2Optimizing RetrievalWhat does it mean to re-rank results in a RAG system?Medium1BRandomizing results to ensure high diversity.Sorting initial retrieved results based on detailed relevance checking to get the most accurate info.Removing duplicate keywords from the prompt.Changing the priority queue of the inference engine.Re-ranking involves taking a retrieved set of results and sorting them based on a deeper check of how well they actually match the query context.
42Unit 1: RAG and OptimizationLec 2Handling Long DocsWhat does the chunking technique refer to in RAG?Easy1CRemoving chunks of the LLM's memory to save space.Processing multiple user queries at once in large chunks.Breaking long documents into smaller, more manageable sections for easier search and retrieval.Compressing final outputs into bite-sized summaries.Chunking means breaking massive documents into smaller segments to help the system retrieve relevant parts without processing the entire source text.
43Unit 1: RAG and OptimizationLec 2Handling Long DocsHow does the hierarchical retrieval approach help manage large knowledge bases?Hard1AUsing a two-step approach: first searching broad categories, then narrowing down to specific details.Storing data in a strict tree structure based on file creation dates.Replacing long documents with single-sentence summaries.Elevating administrator queries above standard user queries.Hierarchical retrieval uses a multi-step search, starting broad and then narrowing down, helping systems handle large amounts of data efficiently.
44Unit 1: RAG and OptimizationLec 2Optimizing EfficiencyHow can caching optimize the performance of a RAG system?Medium1CIt automatically retrains the LLM overnight.It converts all sparse queries into dense ones.It stores frequently accessed data so it doesn’t have to be retrieved repeatedly, speeding up responses.It deletes old conversational history to save memory.By caching frequently accessed info, a RAG system skips the retrieval process for common queries, greatly improving response efficiency.
45Unit 1: RAG and OptimizationLec 2Maintaining ContextHow can conversation history be used to maintain context in multi-turn interactions?Medium1BBy manually saving transcripts locally for users.By passing previous dialogue turns as part of the LLM's input context or using it to refine new queries.By preventing users from asking follow-up questions.By completely re-indexing the database after every query.RAG systems add prior turns to refine fetching info, and pass the conversation history into the generator's context so it remembers prior details.
46Unit 1: RAG and OptimizationLec 2Advanced ChunkingWhat is a disadvantage of fixed-length chunking?Medium1DIt is the slowest parsing method available.It relies heavily on natural language understanding APIs.It requires documents to be pre-formatted perfectly.Chunks may not align with logical breaks, potentially splitting important info or including irrelevant content.While easy to implement, fixed chunks just slice data arbitrarily, potentially cutting sentences or ideas in half and losing crucial context.
47Unit 1: RAG and OptimizationLec 2Advanced ChunkingWhat is an advantage of sentence-based chunking?Medium1AIt keeps complete sentences intact, which is great for detailed analysis.It uses the lowest amount of metadata.It perfectly summarizes entire paragraphs.It guarantees chunks are perfectly equal data sizes.By splitting by sentences, it preserves the basic grammatical and logical unit, which aids in highly granular detail-oriented retrieval.
48Unit 1: RAG and OptimizationLec 2Advanced ChunkingWhy is semantic chunking harder to implement?Hard1BBecause there are no libraries available for it yet.It requires advanced text analysis to chunk based on meaning (sections/topics) rather than simple text markers.It works exclusively with codebases and not natural text.It requires manual human review of every document chunk.Grouping text by logical meaning instead of fixed characters or periods requires deeper ML tools and NLP analysis, making it harder to code.
49Unit 1: RAG and OptimizationLec 2Advanced ChunkingHow does a sliding window chunking method operate?Medium1CIt only indexes the first and last chunk of a document.It dynamically resizes chunks based on user latency limits.Chunks overlap by sliding over the text, ensuring important info isn't missed at boundaries.It slides inactive chunks into cold storage databases.Sliding window chunking means sequential chunks overlap somewhat. This avoids losing context right at the boundary between chunks.
50Unit 1: RAG and OptimizationLec 2Advanced ChunkingWhat is a potential issue with large chunks vs small chunks?Medium1ALarge chunks dilute specific information, while small chunks lose long-range context across the text.Smaller chunks increase hallucination by 100%.Large chunks require completely different vector databases.Smaller chunks are impossible to index effectively.Small chunks risk losing broader dependencies, while large chunks can obscure specific details when encoded into a single dense vector.
51Unit 1: RAG and OptimizationLec 2Late ChunkingWhat fundamental difference separates late chunking from traditional methods?Hard1BLate chunking forces the language model to write chunks.It applies the embedding model's transformer layer to the full text before pooling the chunks.It waits 24 hours before indexing fetched chunks.It completely ignores sentence boundaries across all chunks.Traditional chunking cuts text, then embeds. Late chunking embeds the entire document first to absorb context, then pools tokens into chunks.
52Unit 1: RAG and OptimizationLec 2Late ChunkingHow does late chunking solve the "loss of long-distance dependencies" problem?Hard1CBy merging all queries into one giant prompt.By running queries twice for good measure.Chunk embeddings are generated conditionally based on the full document context analyzed by the transformer.By sending the text to an API for grammar checking.Because the entire text is run through the transformer first, each token embedding inherently "knows" about the rest of the document's context.
53Unit 1: RAG and OptimizationLec 2ContextualizationWhat role does contextualization play in RAG?Medium1AMaking sure retrieved info is strictly aligned and highly relevant to the query to produce better answers.Expanding the user's prompt organically.Encrypting API keys for database security.Identifying the geography of the user asking the question.Contextualization means validating and aligning retrieved data tightly with the query so answers fit the user's explicit needs.
54Unit 1: RAG and OptimizationLec 2Addressing BiasesHow can potential biases in retrieved information be addressed?Hard1DBy shutting off the retriever and using only the LLM's core weights.By making sure chunks are exactly 500 words long.By increasing the temperature setting on the LLM to maximum.By filtering knowledge bases for objective content or employing a specific agent to check for biases in text.You must actively curate/filter the database for objectivity, and potentially utilize a dedicated LLM agent task to check output neutrality.
55Unit 1: RAG and OptimizationLec 2Dynamic Knowledge BasesWhat is a major challenge in handling a dynamic/evolving knowledge base?Medium1BVectors eventually degrade and lose data.Keeping indexed data constantly up-to-date and using version control to manage changing info.The generator model forgets how to process text over time.It is impossible to cache evolving knowledge.If knowledge changes often, the indexes must be updated rapidly (without constant heavy retraining), requiring robust ingestion/versioning workflows.
56Unit 1: RAG and OptimizationLec 2CAG vs RAGWhat does CAG stand for?Easy1ACache-Augmented GenerationComputed Array GraphContextually Altered GrammarConsolidated Active GeneratorCAG stands for Cache-Augmented Generation, an evolution where documents are summarized/compressed before generating text.
57Unit 1: RAG and OptimizationLec 2CAG vs RAGWhen is CAG preferred over traditional RAG?Hard1CWhen handling live, real-time Twitter feeds.When working entirely without internet access on untrusted devices.For static datasets where data can be pre-compressed, and when token efficiency is critical.When accuracy doesn't matter, but speed is paramount.CAG is ideal for stable text (papers, catalogs) that can be summarized/cached beforehand, which saves costly context window tokens during live queries.
58Unit 1: RAG and OptimizationLec 2Advanced SystemsWhat makes Adaptive RAG unique?Hard1DIt exclusively uses SQL instead of vector stores.It generates its own training data while idling.It deletes unused documents automatically to save space.It adjusts its approach in real-time, deciding between no retrieval, single-shot, or iterative RAG based on the query.Adaptive RAG is dynamic; it analyzes the query complexity and selectively applies the right level of retrieval (or skips it if not needed).
59Unit 1: RAG and OptimizationLec 2Advanced SystemsHow does Agentic RAG operate?Hard1BIt hires human experts via crowd-sourcing APIs.It uses retrieval agents that let the LM decide autonomously if and when it needs to pull external info.It generates multiple answers and makes them argue.It parses the codebase to fix system bugs automatically.Agentic RAG gives the language model tools to autonomously act as a 'decision-maker' on whether to consult the database or search the web.
60Unit 1: RAG and OptimizationLec 2Data PrivacyWhat is a "zero-trust" approach to data ingestion in a RAG system?Hard1ARedacting/anonymizing personally identifiable info (PII) before it even enters the database.Never storing any embeddings.Using biometric scans to log users in.Disconnecting the server from all networks.A zero-trust approach involves sanitizing and removing sensitive PII immediately during ingestion, so no confidential data even exists in the retrieved context.