All jobs / AI engineer / AI Evals
AI engineer interview question · 3–5 years
Answers got worse after you changed the chunking in a RAG assistant. How do you evaluate the retriever on its own?
The strongest answer
A labelled set of queries with the source passages that answer them; measure recall at k and the rank of the first relevant hit for old and new chunking on the same queries, before any generation
Why it works
Exactly — relevance labels tied to the source text survive a re-chunk, and recall at k tells you whether the answer was even available to the generator.
What a good answer covers
- Measure retrieval before generation.
- Label queries with their relevant sources.
- Compare recall at k and first-hit rank.
- Same queries, old versus new.
Answers that fall short
- Close, but not the strongest: Run the end-to-end answer eval on both versions and compare the two final scores
That confirms something got worse but not where. Retrieval metrics tell you whether the right passage ever reached the prompt. - Weak: Look at the similarity scores the vector store returns; higher scores mean better retrieval
A similarity score is the retriever’s own opinion, and it is not comparable across different chunkings. You need labels of what is actually relevant. - Red flag: Raise k until the answers look fine again; more retrieved context can only help the model
More chunks add cost, latency and distraction, and you still would not know whether the right passage is among them.
Who gets asked this
More AI Evals questions
- What is wrong with how you are measuring, and what do you change?
- Your offline eval score rose for three releases in a row. Over the same period, escalations from the…
- How do you evaluate a multi-step agent, where two correct runs can take completely different paths?
- An executive asks for “our hallucination rate” as one number for a board deck about your document-grounded…
- Why can’t you test an LLM feature with ordinary exact-match unit tests, and what do you do instead?
- What is a golden dataset for an LLM feature, and where do its cases come from?
- Your feature extracts supplier, date and total from invoices into JSON. A teammate proposes grading every…
- You compare an old and a new prompt with a pairwise LLM judge. The new prompt wins almost every pair. Its…