All jobs / AI engineer / RAG — Retrieval-Augmented Generation
AI engineer interview question · 5+ years
Since you added “answer only from the retrieved context, otherwise say you don’t know”, the assistant refuses about a third of the questions the docs do cover. Sales wants the rule removed before a customer demo.
What do you do?
The strongest answer
Keep the rule and split the refusals by cause: where retrieval missed, fix retrieval; where the context was good, fix the prompt — allow partial answers that say what is covered. Track false refusals and unsupported answers together
Why it works
Exactly — over-refusal and unsupported answers are two error rates on one dial, and you manage both. A false refusal has a cause you can find — a missed passage or an over-strict prompt — without touching the grounding rule.
What a good answer covers
- Two error rates: false refusals, unsupported answers.
- Split refusals by cause.
- Fix retrieval or prompt; keep grounding.
- Partial answers should say what is covered.
Answers that fall short
- Close, but not the strongest: Keep the rule, and raise top-k so that the model has more context to answer from
It may help where retrieval missed, but it is a guess: if the context was already good, more chunks add noise and the refusals stay. - Weak: Soften the wording so that the model answers whenever it feels fairly confident
The model’s confidence is not evidence. That wording switches grounding off for exactly the answers most likely to be invented. - Red flag: Remove the rule for the demo and put it back afterwards; the customer will not check the sources
Demoing behaviour the product will not ship misleads a customer, and “they will not check” is the sentence that ends the interview.
Who gets asked this
More RAG — Retrieval-Augmented Generation questions
- Walk me through a RAG system, from a document being uploaded to a user getting an answer.
- Why do we split documents into chunks before embedding them, instead of making one vector per document?
- What is chunk overlap for, and what does too much of it cost?
- Users paste the error code “E-4012” into the support assistant. It returns passages about errors in general…
- A policy document was updated yesterday and the assistant still quotes the old text, with a citation. Where…
- Why does that happen, and what do you do about it?
- The assistant gave a wrong answer to a question the documentation clearly covers. How do you find out which…
- The right chunk is nearly always in your top 50 results but rarely in the 5 you send to the model. What do…