Find a course

Module 3: Generative AI and Language ModelsLesson 8 of 1013 min

Using AI Tools Well: Prompts, Hallucinations and Verification

Write prompts that get useful results, understand why AI hallucinates, and build habits for checking AI output before you rely on it.

Step 1 of 14Learn

The case that cited cases that did not exist

In 2023, lawyers in a New York court case filed a brief citing several earlier court decisions. The judge and opposing lawyers could not find them. They did not exist. The lawyers had asked a chatbot for supporting cases, and it produced realistic case names, quotes and citations, all invented. The lawyers were sanctioned, and the story became a warning heard around the world.

This failure has a name: hallucination, meaning AI output that is fluent and confident but false or unsupported. It follows directly from how language models work. The model generates the most plausible continuation of the text. A plausible court citation looks like a party name, a "v.," another name, a volume number, a reporter abbreviation and a year. The model knows that pattern extremely well. Whether a real case matches it is a different question that next-token prediction does not check.

Hallucinations are most likely when:

  • You ask for specific details: citations, quotes, statistics, URLs, dates, names of small companies or people.
  • The topic is obscure or recent, so there was little training data, or it falls after the training cutoff.
  • The question assumes something false, such as "Why did the city ban bicycles in 2019?" The model may invent a reason rather than reject the premise.
  • You ask it to explain its own reasoning or sources after the fact.

Newer models hallucinate less than older ones, and tools that ground answers in search results or your documents reduce the problem further. None eliminate it.

Step 2 of 14Practice · Select all that apply

Which requests carry a high risk of hallucination? Select all that apply.

Select all that apply.

Step 3 of 14Practice · Diagram

How likely is a made-up answer?

Hallucination risk rises when the model must supply exact facts it may never have seen, and falls when you give it the material.

Which request carries the highest risk?

Tap the shape that answers the question, then press Check.

How likely is a made-up answer?Scale: Rewording your text, Brainstorming ideas, Summarizing a pasted file, Well-known facts, Recent or obscure events, Exact citations and quotes.Low riskCheck factsHigh risk02468101Rewording your text2.5Brainstorming ideas4Summarizing apasted file5.5Well-known facts8Recent or obscureevents9.5Exact citations andquotes
Illustrative ranking, not measured values.
Rewording your text

Everything it needs is in your prompt.

Brainstorming ideas

There is no single right answer to get wrong.

Summarizing a pasted file

Usually reliable, but it can still slip in claims that are not in the source.

Well-known facts

Often right, sometimes confidently wrong.

Recent or obscure events

Little or no training data, so it fills gaps with plausible text.

Exact citations and quotes

Names, page numbers and quotes are easy to invent and hard to spot.

Step 4 of 14Learn

Writing prompts that work

A prompt is everything you give the model: your instructions, context, examples and any material to work with. Since the model generates what is most plausible given your text, a vague prompt gets a generic answer. More useful context makes the useful answer more likely.

Compare these two prompts:

Write an email about the meeting.

I manage a team of six designers. Write a short, friendly email telling them our Thursday 2 p.m. review is moving to Friday at 10 a.m. because the client rescheduled. Ask them to bring their latest drafts. Keep it under 100 words.

The second prompt includes five ingredients that consistently help:

  1. Role and context: who you are, who the audience is, what the situation is.
  2. A clear task: what exactly you want produced.
  3. Specifics and constraints: length, tone, format, what to include or avoid.
  4. Examples: if you want a particular style, show one or two samples. This is called few-shot prompting.
  5. Output format: a table, bullet points, a numbered plan, plain text with no headings.

Other habits that help:

  • Break big tasks into steps. Ask for an outline, review it, then ask for the full draft.
  • Ask it to work through the problem step by step for math or logic, and to show its work so you can check it.
  • Give it permission to say it doesn't know, for example: "If you're not sure, say so rather than guessing."
  • Iterate. Treat the first answer as a draft. Tell the model what to change.

Step 5 of 14Practice · Spot the mistake

This prompt is meant to get a reliable summary of a 10-page report the user has pasted below it. Which parts weaken it? Click the weak parts.

Step 6 of 14Learn

Verify before you rely

Treat AI output like a draft from a fast, well-read intern who sometimes makes things up with a straight face: very useful, never final.

How much checking you need depends on the stakes:

  • Low stakes: brainstorming, rewording, a first draft of a casual email. Read it, adjust it, done.
  • Medium stakes: a work report, a summary of a document, code for a personal project. Check key facts and numbers against the source, test the code, and read critically.
  • High stakes: legal, medical, financial or safety decisions, anything published under your name, anything affecting other people. Verify every factual claim in an authoritative source, and have a qualified person review it.

Practical verification habits:

  1. Ask for sources, then open them. A link or citation is only evidence if it exists and says what the AI claims.
  2. Check numbers yourself. Language models can slip on arithmetic, especially multi-step calculations. Use a calculator or spreadsheet.
  3. Compare with the original. When AI summarizes a document, spot-check key points against the text.
  4. Watch for confident specifics. Exact figures, quotes and names are where invention hides.
  5. Ask the model to critique its own answer, then verify independently. Self-review catches some errors but is not proof.

Remember that AI tools can also be wrong in subtle ways: outdated information, a missing exception, a summary that drops the one caveat that mattered. Your judgment is the final layer, and you remain responsible for what you do with the output.

Step 7 of 14Practice · What would you do?

What would you do?

A chatbot drafts a report for you and states: "According to a 2021 national survey, 64% of small businesses use AI." You plan to include this in a presentation to your company's leadership. What should you do?

Step 8 of 14Diagram

Match your checking to the stakes

Match your checking to the stakesLayer diagram: High stakes, Medium stakes, Low stakes.High stakesMedium stakesLow stakes

Tap a shape with to see more.

High stakes

Legal, medical, financial, published or client-facing: verify every claim against primary sources and have a qualified person review.

Medium stakes

Work reports, document summaries, personal code: check key facts, numbers and quotes; test the code.

Low stakes

Brainstorming, rewording, casual drafts: read, adjust, done.

Step 9 of 14Note

Step 10 of 14Learn

Beyond text: images, audio and agents

Generative AI is not only chatbots.

Image generators create pictures from text descriptions. A common method, called diffusion, starts from random visual noise and removes it step by step, guided by the prompt, until an image emerges. These models learned from huge collections of images paired with captions. They are excellent at style and composition, but can stumble on hands, text inside images, exact counts of objects and precise spatial instructions like "the red cup to the left of the blue one."

Audio models transcribe speech, translate it and generate realistic synthetic voices from short samples. The same technology that helps someone who has lost their voice can also be used to fake a phone call from a relative.

Multimodal models handle several kinds of input at once. You can show them a photo of a broken appliance, a chart or a handwritten note and ask questions about it.

AI agents go a step further: instead of just answering, they take actions toward a goal, such as searching the web, filling in forms, writing and running code, or using other software. An agent might research flights, compare prices and draft a booking. Agents raise the stakes of errors, because a mistake is no longer just wrong text; it can be a wrong action. Good agent designs keep a human in the loop for anything consequential, like payments, sending messages or deleting files.

The same core lesson applies to all of them: these systems generate what is plausible based on their training, not what is guaranteed to be correct.

Step 11 of 14Diagram

How a diffusion model paints a picture

How a diffusion model paints a pictureProcess diagram: Pure random noise → Remove a little noise → Repeat dozens of times → Finished image.Pure randomnoiseRemove alittle noiseRepeatdozens oftimesFinishedimage

Tap a shape with to see more.

Pure random noise

The process starts from static, like an untuned TV.

Remove a little noise

The model predicts which pixels are noise, guided by your text prompt.

Repeat dozens of times

Shapes, then objects, then fine details emerge.

Finished image

Plausible, not guaranteed: hands, text and exact counts are typical weak spots.

Step 12 of 14Practice · Match the pairs

Match each prompt ingredient to an example of it.

Tap an answer, then tap the place where it belongs (or drag it there).

  1. Role and context
  2. Clear task
  3. Constraints
  4. Example (few-shot)
  5. Output format

Step 13 of 14Diagram

Anatomy of a strong prompt

Anatomy of a strong promptParts diagram: Your prompt, Who you are and context, One clear task, Constraints, An example, Output format, Source material.Your promptWho you areand contextOne clear taskConstraintsAn exampleOutputformatSourcematerial

Tap a shape with to see more.

Your prompt
Who you are and context

Background the model cannot guess.

One clear task

What exactly you want produced.

Constraints

Length, tone, audience, what to avoid.

An example

Show the style you want instead of describing it.

Output format

List, table, sections, word count.

Source material

Paste the text to work from and ask it to stick to it.

Step 14 of 14Practice · Choose one

Which prompt is most likely to get a useful, accurate summary of a long article you paste in?