Hallucination Mitigation: RAG, Decoding, and Training › Prompt Engineering for Factuality

Michael BrenndoerferMarch 20, 20264 min read
Language AI HandbookAll chapters
Part 56 of 67Hallucination and Factuality
Chapter 432Hallucination Mitigation: RAG, Decoding, and Training › Prompt Engineering for Factuality
Reading section 5 of 12 · Prompt Engineering for Factuality · 4 minSection 5 of 12 · 4 min

Book contents

Section 5 of 12 · 4 min read

Hallucination Mitigation: RAG, Decoding, and Training › Prompt Engineering for FactualityOne section · Sections in this chapter5 / 12 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Before reaching for training-based or retrieval-based mitigations, there is significant value in simply designing prompts that elicit more factual behavior from existing models. Prompt engineering for factuality is not a complete solution, but it is cheap, fast to iterate, and can provide meaningful improvements with no infrastructure cost.

Asking for Uncertainty

One of the most reliable prompt-level interventions is explicitly asking the model to express uncertainty when it is not confident. A prompt like "If you are not certain about any specific fact, please say so explicitly" significantly increases the rate at which models hedge uncertain claims, even without any training changes.

This works because instruction-following models are responsive to explicit framing. Without an explicit instruction to hedge, the model defaults to the style it was trained on, which typically involves confident assertion. With an explicit instruction, the model shifts its generation style toward more hedged formulations. The calibration of this hedge is imperfect: the model may hedge some claims it knows confidently, and fail to hedge others it does not know. But the direction of effect is reliable and useful.

Structured instructions that specify what to do when uncertain are more effective than vague instructions to "be careful." Compare:

Answer as accurately as possible. If you are unsure about specific facts such as dates, numbers, or names, say "I'm not certain about this" before giving your best estimate, and recommend that the user verify the information independently.

versus:

Be careful about accuracy.

The first instruction gives the model a specific behavioral template for uncertainty expression. The second is too vague to reliably change behavior.

Citing Sources

Asking the model to cite its sources for factual claims has two benefits. First, it encourages the model to use retrieved documents (in RAG settings) rather than parametric memory, because retrieved documents are the easiest thing to cite. Second, citations allow users to verify claims independently, turning hallucination from an invisible failure into a visible one: an uncited claim stands out, and a fabricated citation can be caught.

The limitation is that models can hallucinate citations with the same fluency they hallucinate facts. A model asked to cite sources may produce plausible-looking but nonexistent references. This is arguably worse than uncited hallucinations because it gives users a false sense of verifiability. To get the benefit of citations without this risk, you need a system that validates citations (e.g., checks that the cited document exists and contains the claimed content).

Step-by-Step Decomposition

Asking the model to break complex questions into sub-questions before answering each one reduces hallucination on multi-hop queries. The decomposition step forces the model to make its reasoning structure explicit, which makes errors more visible and allows retrieval to operate on focused sub-queries rather than the original complex question. This technique, called least-to-most prompting or question decomposition, has shown consistent improvements on multi-hop factoid question answering.

Out[6]:
Visualization
Grouped bar chart comparing factual accuracy for four prompt strategies across easy, medium, and hard queries.
Simulated factual accuracy improvement across prompt engineering strategies for three query difficulty levels. Simple queries (left group) show modest gains because baseline accuracy is already high. Medium-complexity queries (center) benefit most from combined strategies, with uncertainty prompting and citation forcing together yielding substantial improvements. Hard multi-hop queries (right) benefit most from decomposition, which reduces each step to a simpler sub-problem. Values are illustrative and based on published trends in the literature rather than a single benchmark.