Asked in a senior AI engineer interview.
What they are really testing: whether you treat retrieval as a ranking problem with failure modes, or as a prompt-tuning problem. Retrieval returns what is similar, not what is true or what the user intended.
A strong answer:
- Diagnose the failure first. The document may be relevant but stale or wrong, or the query may be ambiguous and the retriever matched the wrong sense of it. Each needs a different fix.
- Clarify intent before retrieving. Use query rewriting, or ask a clarifying question when the ambiguity is real, and retrieve against the clarified query.
- Improve ranking upstream of generation: hybrid lexical plus dense retrieval, a cross-encoder reranker over a larger candidate set (for example, top 50 cut to top 5), and metadata filters on date, source and version.
- Make conflicts visible to the model. Pass source and timestamp metadata, instruct it to surface disagreements, and apply explicit precedence rules (newest or most authoritative source wins) where the domain has them.
- Evaluate the failure directly. Build a labeled set of queries whose top-k contains a misleading document, and track retrieval precision at k and answer faithfulness separately. A prompt change that fixes five examples is not a fix.
- Abstain when sources conflict and no rule resolves it. Cite both and say so, rather than silently picking one.
Common mistakes:
- Treating the prompt as the only lever. Instructions can limit the damage, but they cannot recover evidence that was never retrieved.
- Raising top-k for safety. More context adds more contradictory material and makes it likelier the model blends sources.
- Assuming embeddings capture intent. Similarity measures closeness, so an outdated policy that is worded almost identically to the current one can outrank it.
How would you break down this failure before touching the prompt? I'm curious how others structure the diagnosis.
Originally shared on LinkedIn.
An AI interview question every day, leadership for tech people and hands-on AI learning:
Top comments (0)