Question presented to candidate: "Our support bot needs to answer from our own help-centre articles and policies, which change every week. One engineer wants to fine-tune a model on the articles; another wants RAG. Explain what retrieval-augmented generation is, how it works, and why you would or would not use it instead of fine-tuning for this."
What a strong answer should cover:
- The definition: RAG retrieves relevant passages from an external index at question time and puts them in the prompt, so the model answers from that evidence (non-parametric memory) instead of only from what is stored in its weights (parametric memory)
- The two halves: an offline indexing path (load, chunk, embed, store) and an online query path (embed or parse the query, retrieve top-k, build the prompt, generate with citations)
- Why RAG wins for knowledge: an update is a re-index of one document instead of a training run, deletions really delete, answers can cite sources, retrieval can be filtered per user or tenant, and the model can be told to say "I do not know" when nothing relevant is found
- Evidence beyond intuition: published comparisons (for example Ovadia et al., EMNLP 2024) found RAG beat unsupervised fine-tuning for injecting both existing and new facts
- What fine-tuning is still for: behaviour, format, tone and domain style, not facts that change; the two combine
- What RAG does not fix: answers are only as good as retrieval (chunking, hybrid search, reranking), and retrieved text is untrusted input (prompt injection)
Clarifying questions expected:
- How often does the content change, and must deletions take effect immediately?
- Does every user see every document, or does access depend on the user or customer?
- How big is the corpus: could it simply fit in the context window?
Code / implementation expected: Optional โ sketching the retrieve, build-prompt, generate loop (with a citation and an "I do not know" path) is a strong signal.