Designing a Useful “No Answer” in RAG
Engineering

Designing a Useful “No Answer” in RAG

Declining to answer helps only when the system also says what it searched, what is missing and where the user should go next.

Short answer

A useful "no answer" in RAG declines to state what the retrieved documents do not support, then says what was searched, what is missing and what the user can do next. Build it with a relevance threshold after retrieval and a claim-by-claim grounding check after generation, separate missing, restricted, conflicting and ambiguous cases, and test it on questions your documents cannot answer.

What is a useful "no answer" in RAG?

A useful "no answer" is a response in which the system declines to state what its documents do not support, and then says what it searched, what is missing and what the user can do next. It is a designed outcome, not an error message. The useless versions are a bare "I couldn't find that", which leaves the user stuck, and the harmful one: a fluent answer built from the model's general knowledge when the product promises answers from company documents.

Research uses the word abstention for this behaviour. A 2024 survey, "Know Your Limits", defines it as a language model's refusal to provide an answer and describes it as valuable for reducing hallucinations and improving safety. In an enterprise RAG system the stakes are concrete: an invented leave rule, contract clause or tolerance value is worse than an honest gap, because people act on it.

Why do RAG systems answer when they should not?

Because retrieval always returns something. A vector search finds the nearest passages even when none of them is relevant, and a passage that shares the question's words may still not contain the rule being asked about. The model then sees text that looks related and fills the gap. Unanswerable questions that resemble answerable ones are hard by design: the SQuAD 2.0 paper added over 50,000 unanswerable questions written by crowdworkers to look similar to answerable ones, and a strong system that scored 86 percent F1 on the original dataset scored only 66 percent once it also had to recognise questions without an answer.

The fix is not a sterner instruction in the prompt. It is two explicit checks, one after retrieval and one after generation, and a test set that contains the questions your documents cannot answer.

Which "no answer" cases need different responses?

"No answer" covers several different situations, and each needs its own internal reason code and its own message. Mixing them up produces either misleading answers or misleading refusals.

SituationInternal reason codeWhat the user should see
No relevant document in the collectionno_sourceThe question is not covered by the documents searched, with who to ask
A relevant document exists but the user may not read itnot_permittedNo answer in the documents available to them; never a claim that the policy does not exist
Passages are related but do not support the specific claiminsufficient_supportThe supported part with citations, and the missing part named
Two versions disagreeversion_conflictBoth versions and their dates, with a request to confirm which applies
The question can be read several waysambiguousA short clarifying question
The question is outside the assistant's scopeout_of_scopeWhat the assistant covers and where else to go

The permission case deserves care. Telling a user "there is no policy on this" when a restricted policy exists is false, and telling them "there is a restricted document about this" leaks information. The neutral wording, "I found no answer in the documents available to you", is accurate in both directions.

How do you decide when to abstain?

Use two gates. The retrieval gate asks whether anything relevant was found. A reranker that scores on a fixed, documented scale makes this practical. Azure AI Search's semantic ranker, for example, scores results from 4 (highly relevant, answers the question completely) down to 0 (irrelevant), with 2 meaning the document answers only partially. The same page warns that score distributions can vary slightly between queries and after model updates, so thresholds should not be too granular. Below the threshold, the system does not generate; it goes to the "no answer" path.

The grounding gate runs after generation and checks the answer claim by claim. Ragas defines its faithfulness metric this way: identify the claims in the response, check whether each can be inferred from the retrieved context, and divide supported claims by total claims. In production, use the same idea as a filter: unsupported sentences are removed or flagged, and if the core of the answer is unsupported, the system abstains. A citation next to a sentence is not proof; the cited passage has to state the claim.

Retrieval method affects both gates. Microsoft's hybrid search overview notes that keyword search handles product codes, dates and people's names better because it finds exact matches, while vector search finds conceptually similar text. A question about "form 4-B" may fail the retrieval gate under vector search alone and pass under hybrid search, so set thresholds on the retrieval configuration you will actually run.

How do you build a no-answer test set?

Write questions for every situation in the table above, not only questions your documents answer. Label each with the expected behaviour: full answer, partial answer, clarifying question or no answer. A test set for an HR assistant might include:

Case typeExample questionExpected behaviour
AnswerableHow many days of annual leave do new employees get?Full answer with citation
Partially answerableAre dependants covered by health insurance after age 26?What the policy says about dependants; the age rule named as missing
Absent from the documentsIs there a bicycle purchase allowance?No answer, with the HR contact
Near missDoes the travel policy cover a spouse's flight? (it covers only the employee)Answer that states only the employee is covered; no inference about spouses
RestrictedWhat is the bonus band for directors? (asked by a test user without access)Neutral "no answer in the documents available to you"
Conflicting versionsWhat is the remote-work allowance? (2025 and 2026 policies differ)Both versions with dates, request to confirm
AmbiguousHow long is the notice period?Clarifying question: resignation or dismissal, which contract type?

Use real user questions where you can, write near misses deliberately, and keep the set fixed so that every change to chunking, retrieval, prompts or models is measured against the same cases.

How do you measure abstention and set the threshold?

Track two error rates together: unsupported answers (the system answered a question it should have declined, or added unsupported claims) and unnecessary abstentions (it declined a question the documents do answer). A system that never answers has no unsupported answers and is useless; a system that always answers looks helpful and is dangerous.

The numbers in this example are hypothetical, to show how the choice is made. An HR assistant's test set has 300 questions: 180 answerable and 120 partially answerable or unanswerable. Three retrieval thresholds give:

Minimum reranker scoreUnsupported answers (of 120)Unnecessary abstentions (of 180)
1.022 (18%)4 (2%)
2.07 (6%)13 (7%)
3.02 (2%)41 (23%)

The team picks 2.0 and adds the claim-level grounding gate for pay, leave and dismissal topics, where an unsupported answer is costly. The 13 unnecessary abstentions go into the review queue: most turn out to be questions phrased with different words from the policy, which is a retrieval problem to fix rather than a reason to lower the threshold.

How should the "no answer" message read?

Short, specific and actionable. It should say which sources were searched (only those the user may access), which date or version was used, what exactly is missing, and the next step. For the dependant question above, a useful response reads: "The benefits policy (section 4.2, version of March 2026) lists spouses and children as dependants but does not set an age limit. I can't confirm cover after 26 from the documents available to me. The benefits team can confirm it." It answers the supported part, names the gap and hands over.

For ambiguous questions, ask one clarifying question that offers the options the documents actually distinguish, such as resignation or dismissal, rather than an open "can you be more specific?". Answer straight away once the user picks one.

How should conflicting versions be handled?

Most version conflicts can be prevented at indexing time rather than resolved in the answer. Store each document's status (draft, approved, superseded) and its effective dates as metadata, and filter out drafts and superseded versions at query time unless the user asks about history. If two approved versions still come back, for example a 2025 policy and a 2026 amendment that changes one clause, prefer the version in force on the date the question is about, but only if the effective dates are reliable. If they are missing or overlap, do not let similarity scores pick a winner: show both versions with their dates and ask the user or the document owner to confirm which applies. Record each conflict; repeated conflicts on the same topic usually mean that an old file was never withdrawn from the source system.

What should you do with no-answer cases afterwards?

Log the reason code, the query, the retrieved passage IDs and, where a person reviews it, the outcome. Review the log regularly and sort cases by cause: a document that was never ingested, a retrieval failure on a document that exists, an outdated version, or a real gap in the organisation's documentation. The last group is worth sending to the document owners; the no-answer log is often the clearest list of questions people ask that nobody has written down.

Common mistakes

  • Letting the model fill gaps from general knowledge in a product that promises document-based answers.
  • Telling users a policy does not exist when they simply cannot access it.
  • Treating a citation as proof without checking that the passage states the claim.
  • Testing only answerable questions, so unsupported answers are never measured.
  • Lowering the threshold to reduce refusals instead of fixing the retrieval behind them.

Answers that cite their source, and a system that says it found nothing instead of inventing an answer, are part of what our enterprise RAG and semantic search service covers. For the wider set of quality measures, see our guide to evaluating a RAG system.

Key takeaways

  • Separate missing, restricted, partly supported, conflicting, ambiguous and out-of-scope cases, each with its own reason code and message.
  • Gate generation on a reranker relevance threshold, and check the answer claim by claim after generation.
  • Never tell users a policy does not exist when they simply cannot access it.
  • Keep a fixed test set with near misses and unanswerable questions, labelled with the expected behaviour.
  • Track unsupported answers and unnecessary refusals together, and fix retrieval before lowering the threshold.
  • Review the no-answer log to find documents that were never ingested and policies nobody has written.

Frequently asked questions

How do you stop a RAG system from making up answers?

Add two checks: a relevance threshold after retrieval, so the model does not generate from weak passages, and a claim-by-claim grounding check after generation, so unsupported sentences are removed or the system abstains. Then test both on questions your documents cannot answer.

What should a RAG assistant say when it cannot find an answer?

Which sources it searched, which version or date it used, what exactly is missing and who can help next. If part of the question is supported, it should answer that part with citations and name the gap.

Should the assistant reveal that a restricted document exists?

No. It should say that no answer was found in the documents available to the user. Claiming the policy does not exist is false, and mentioning a restricted document leaks information.

How do you choose the abstention threshold?

Run a fixed test set of answerable, partly answerable and unanswerable questions at several thresholds and compare unsupported answers with unnecessary refusals. Pick the point whose trade-off fits the cost of a wrong answer, and add stricter checks for high-stakes topics.

Is a high refusal rate a sign of a safe system?

Not necessarily. Unnecessary refusals often point to retrieval problems, such as questions worded differently from the documents, and an assistant that declines too often stops being used. Measure refusals and unsupported answers together.

All articles