Your assistant must say "I don't know" when the corpus lacks the answer. How do you decide when to abstain, and how do you set the threshold?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Treat it as selective prediction: combine signals from several stages into one confidence decision, then pick an operating point on a risk-coverage curve built from labelled answerable and unanswerable questions. The product owner decides how much coverage to trade for fewer wrong answers; engineering makes that trade measurable.
Full worked answer with diagram
Treat it as selective prediction: combine signals from several stages into one confidence decision, then pick an operating point on a risk-coverage curve built from labelled answerable and unanswerable questions. The product owner decides how much coverage to trade for fewer wrong answers; engineering makes that trade measurable.
Signals, cheapest first:
- Retrieval confidence: the top reranker score and its margin over the next candidates. Cross-encoder scores are far more usable here than raw cosine, which is uncalibrated and shifts with every model change.
- Evidence sufficiency: a small grader judges whether the passages actually contain the answer, before you pay for generation.
- Grounding after generation: claim-level entailment against the cited spans. Unsupported claims downgrade the reply to a partial answer or an abstain.
- Agreement across samples: answers that disagree signal low confidence. Expensive, so keep it for high-stakes queries.
Setting the threshold:
- Seed the eval set with near-miss unanswerables, where the corpus covers the topic but not this fact. Off-topic questions are rejected trivially and teach you nothing.
- Sweep thresholds and plot coverage (fraction answered) against risk (error rate among answered). A legal assistant may accept far lower coverage than an internal docs helper.
- Fit per slice: corpus, language, query type. One global cutoff over-abstains on some slices and under-abstains on others.
- Re-fit after any embedding, reranker or prompt change, because thresholds do not transfer across versions.
Make the abstain useful: name the closest documents, give the partial answer the corpus supports, or hand off to a human. A flat refusal teaches users to stop asking.
In production, watch the abstain rate per slice. A sudden jump usually means an ingestion or index fault, not harder questions.
Worth sketching. Three gates feeding one abstain path show this is a pipeline decision, not one magic cutoff.
flowchart LR
Q["Query"] --> R["Retrieve and rerank"]
R --> S{"Top score above<br/>the slice threshold?"}
S -->|"no"| A["Abstain, name the<br/>closest sources"]
S -->|"yes"| E{"Evidence holds<br/>the answer?"}
E -->|"no"| A
E -->|"yes"| G["Generate"]
G --> V{"Claims entailed by<br/>cited spans?"}
V -->|"no"| A
V -->|"yes"| O["Answer with citations"]
What a good answer covers
- Treat it as selective prediction
- The product owner decides how much coverage to trade for fewer wrong answers; engineering makes that…
- Evidence sufficiency: a small grader judges whether the passages actually contain the answer, before you…
- Grounding after generation: claim-level entailment against the cited spans
- Agreement across samples: answers that disagree signal low confidence
Key terms: Retrieval confidence · Evidence sufficiency · Grounding after generation · Agreement across samples
In the glossary: Cross-encoder · Judge (LLM-as-judge) · Grounding · Eval set
Interviewer follow-ups to expect
How would you build near-miss unanswerable questions without contaminating the corpus?
The abstain rate doubled overnight with no deploy: what are your first three checks?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep