← All questions
LLM FoundationsEasy· Prompting & Context Construction

Beyond retrieval, what's a prompt-design technique for...

The instinct to always answer is baked into how most LLMs are instruction-tuned — refusing or admitting ignorance is implicitly treated as a worse outcome than producing some answer, unless the prompt says otherwise. When a model is asked a question and the relevant fact isn’t actually in its context, that default pressure pushes it to fall back on parametric knowledge or plausible-sounding completion, and if that fallback is subtly wrong for the situation at hand, that’s a hallucination.

A grounding instruction — something like “answer only using the provided document; if the answer isn’t in it, say the information isn’t available” — directly counteracts that pressure by explicitly labeling “I don’t know” as an acceptable, expected output rather than a failure mode. It also narrows the model’s effective search space: instead of reasoning over everything it might know about the topic, it’s directed to check one bounded source and report what it finds there.

This isn’t a complete fix — models still sometimes ignore the instruction under distraction or with weak instruction-following, and it does nothing for hallucinations baked into the retrieved context itself. But it’s cheap, requires no architecture change, and reliably moves the needle, which is why it’s standard practice layered on top of retrieval rather than a replacement for it.

Code playground (Python)