GenAI Basics · Question 13 · Hard

Which order of steps is correct for answering a user question with a typical RAG pipeline?

  1. Generate the answer → embed the query → chunk the documents → retrieve chunks
  2. Embed the query → generate the answer → retrieve chunks → chunk the documents
  3. Retrieve chunks → chunk the documents → embed the chunks → generate the answer
  4. Chunk and embed the documents into a vector store → embed the user's query → retrieve the most similar chunks → add them to the prompt and generate the answer
Answer and explanation

Answer: D. Chunk and embed the documents into a vector store → embed the user's query → retrieve the most similar chunks → add them to the prompt and generate the answer

Explanation: The documents are indexed ahead of time by chunking, embedding and storing them. At query time, the query is embedded, the nearest chunks are retrieved and the LLM generates an answer grounded in them.

Previous: In a transformer model, what does the self-attention mechanism do? · Next: A model has a context window of 8,000 tokens, shared by the input and the…

Practise genai basics

Try a fresh set of genai basics questions with an explanation after every answer, free and without signing up: GenAI Basics practice. Or sit a full placement mock test.

More genai basics questions

More technical & programming practice

Pseudo-code · C Programming · Java · Python · Data Structures · Algorithms · Object-Oriented Programming · DBMS

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge