Hallucination

الهلوسة (Hallucination)

GLS-000119

Beginnerai-prompting1 min read
ai hallucinationllm hallucinationconfabulationai liesfalse confident answer

Definition

When an AI model confidently states something false — inventing facts, URLs, code, or references that don't exist.

عندما يُصرِّح نموذج AI بثقة بشيء خاطئ — يخترع حقائق أو URLs أو كودًا أو مراجع غير موجودة.

Why It Matters

Beginners using AI coding assistants often copy hallucinated code without testing it — leading to bugs and security issues. Always verify AI output.

المبتدئون الذين يستخدمون مساعدي ترميز AI غالبًا ما ينسخون كودًا مهلوسًا دون اختباره — مما يُؤدي إلى أخطاء ومشاكل أمنية. تحقق دائمًا من مخرجات AI.

Full Definition

AI hallucination occurs when a language model generates plausible-sounding but incorrect or made-up content. Examples: citing a research paper that doesn't exist, inventing an npm package with a fake API, writing code that compiles but does the wrong thing, or stating outdated facts as current. Hallucination is a known limitation of all current LLMs, not a bug — it's a property of how they generate text.
هلوسة AI تحدث عندما يولّد نموذج لغوي محتوى يبدو معقولًا لكنه غير صحيح أو مخترَع. أمثلة: الاستشهاد بورقة بحثية غير موجودة، اختراع حزمة npm بـ API وهمي، كتابة كود يُترجَم لكنه يفعل الشيء الخاطئ، أو ذكر حقائق قديمة كحقائق حالية. الهلوسة قيد معروف لجميع LLMs الحالية، وليست خطأً — إنها خاصية تولّد النص.

Example Usage

An AI suggests importing from 'next/ai-helpers' — a package that doesn't exist. The developer must verify every import AI suggests.

يقترح AI استيرادًا من 'next/ai-helpers' — وهي حزمة غير موجودة. يجب على المطوّر التحقق من كل استيراد يقترحه AI.

Knowledge Graph

Avoid these mistakes when using Hallucination:

1

Treating AI output as ground truth without verification

2

Using hallucinated code in production without running it first

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Hallucination.

Explain:
1. What is Hallucination and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Treating AI output as ground truth without verification, Using hallucinated code in production without running it first
5. Best practices and production tips

Official Resources

No official documentation link on file for Hallucination yet.