Tutorials Prompt Engineering Tutorial
AI Hallucinations — Complete Guide
AI Hallucinations — Complete Guide: free step-by-step lesson with examples, common mistakes, and interview tips — part of Prompt Engineering Tutorial on Toolliyo Academy.
On this page
Prompt Engineering Tutorial · Lesson 4 of 100
AI Hallucinations
Prompts → Apps
Prompts · 1 — Basics · ~6 min · Module 1: Prompt Engineering Foundations
What is this?
Hallucination means the model states confident facts that are wrong or missing from your data. It fills gaps because next-token prediction favors fluent text.
Why should you care?
PromptVerse support and legal search need citation rules so agents do not send fabricated policy clauses.
See it live — copy this example
Copy the prompt into ChatGPT, Claude, or your LLM API playground and compare outputs.
SYSTEM: Answer ONLY from CONTEXT. Each claim needs [doc_id]. If missing, reply: INSUFFICIENT_CONTEXT.
CONTEXT:
[pol-12] Refunds within 30 days for unused seats.
USER: Do annual plans get pro-rated refunds?
What happened?
- The prompt forbids outside knowledge and forces doc tags.
- Without CONTEXT, the model must refuse instead of guessing refund rules.
Practice next
- Give a model a question with no context attached.
- Repeat with one true paragraph and citation rule.
- Score: invented detail yes/no.
- Require direct quotes for legal numbers.
- Log when INSUFFICIENT_CONTEXT fires.
Remember
Models guess when facts are absent. Retrieve then constrain. Refusal beats wrong certainty.
Wrong SLA quote
Bot cites a 99.99% uptime SLA not in the contract.
Outcome: Citation-only prompt cuts fabricated SLAs in eval runs.
Interview prep for this lesson
Practice these questions aloud after reading—each links to a full structured answer.
Sign in to ask a question or upvote helpful answers.
No questions yet — be the first to ask!