Great question! To reduce or avoid LLM hallucination (when the model makes up inaccurate, false, or unverifiable information), the way you structure your prompt is critical. Here are strategies and additions you can make to your prompt to reduce hallucinations:
✅ 1. Be Explicit About Factuality
Add a direction to only provide verified, factual, or sourced information:
Examples:
- ✅ “Only respond with information that is verifiable or backed by reliable sources.”
- ✅ “If you don’t know the answer, say you don’t know.”
- ✅ “Do not make up facts—limit your response to what is accurate.”
- ✅ “Avoid speculation. Cite known data only.”
✅ 2. Ask for Sources or Citations
Encourage citation or linking to known information:
Examples:
- ✅ “Cite your sources when providing facts or statistics.”
- ✅ “Include the source (title or author) of any claim.”
- ✅ “Only provide information that has been published or can be substantiated by external references.”
⚠️ Note: GPT models can fabricate citations. Asking it to double-check if the source exists (or confirming via search) can help.
✅ 3. Frame the Task as Summarization, Not Generation
Instead of prompting it to "create" or "explain," guide it to "summarize known information".
Examples:
- ✅ “Summarize what experts have said about…”
- ✅ “List known, verifiable facts about…”
- ✅ “Summarize from [source] if available. Do not invent content.”
✅ 4. Use a Narrow and Specific Prompt
Broad or open-ended prompts are more likely to elicit speculative or generic responses.
Instead of:
- ❌ “Tell me about quantum physics.”
Try:
- ✅ “List 3 well-documented principles in quantum physics with brief explanations and their sources.”
✅ 5. Use System-Like Instructions (for Developers)
If you have access to API parameters or “system prompts,” you can provide model-level guidance to prevent hallucinations.
Example system message:
“You are a precise, factual assistant. Never fabricate information. Always say 'I don’t know' if unsure.”
🛠️ Example Prompt Applying These Tips:
“I am writing a research paper. Provide only factual, verifiable information about CRISPR gene editing. If you don’t know the answer or the source is unclear, say so. Include citations if possible, and do not speculate.”
💡 Bonus: Use Retrieval-Augmented Generation (RAG)
For developers: combine GPT with external factual sources, such as a custom document or knowledge base. This improves accuracy by grounding answers in known data.
If you want, I can help you rewrite a specific prompt you're working on!