Module 1: AI Foundations
Free Preview

Where AI Falls Apart

Lesson 1.2 25–35 minutes 5 activities

Hallucinations: Confident, Detailed, and Completely Wrong

In Lesson 1.1, you learned that AI predicts the next word based on patterns. Most of the time, this produces useful output. But sometimes, the prediction engine generates something that sounds perfectly reasonable and is entirely made up.

This is called a hallucination. And it's one of AI's most dangerous failure modes — not because the output looks wrong, but because it looks right.

Here's a real-world example: people have asked AI tools to recommend legal cases to support an argument. The AI responded with case names, court details, dates, and legal reasoning — all presented with total confidence. The problem? The cases didn't exist. The AI invented them because its pattern-matching predicted that "a legal case citation should look like this," and it generated one that fit the pattern perfectly.

Hallucinations happen because AI optimizes for what sounds plausible, not what's true. It has no way to check facts against reality. It has no internal sense of "I'm not sure about this." It just predicts — and sometimes those predictions land in fiction disguised as fact.

Answer: Because they look and sound completely credible. Other errors might be obviously wrong (like garbled text or a nonsense answer), but hallucinations come wrapped in confidence, specific details, and proper formatting — making them easy to trust if you're not actively checking.

Bias: Garbage In, Garbage Out

Remember that AI learns from training data — text written by humans. And humans, as it turns out, have biases. Those biases end up baked into the training data, and the AI absorbs them as patterns.

If the training data contains more stories about doctors who are men, the AI learns a pattern: "doctor" associates with "he." If the data contains stereotypes about certain neighborhoods, the AI will reproduce those stereotypes in its outputs. It's not being intentionally unfair — it's just matching patterns it found in the data.

This is the "garbage in, garbage out" problem. The model is only as fair, accurate, and balanced as the data it was trained on. And since its training data comes from the internet and published text — which reflect centuries of human biases — the AI inherits those biases.

As a builder, this matters. If you're building something that makes recommendations, generates content, or interacts with people, you need to think about what biases might be hiding in the AI's outputs. We'll go deeper on this in Module 6, but keep it on your radar starting now.

How Bias Flows Through AI Systems

Biased Training Data → Model Learns Biased Patterns → Biased Outputs → Affects Real People

Context Windows: AI Has a Short Memory

When you have a conversation with an AI tool, it might feel like the AI remembers everything you've said. But here's what's actually happening: every time you send a message, the AI receives your entire conversation so far as input and generates a new response. It doesn't "remember" — it re-reads.

The catch: there's a limit to how much text the AI can re-read at once. This is called the context window. Think of it like a desk that can only hold so many papers. Once the desk is full, the oldest papers fall off the edge. If your conversation gets long enough, the AI literally can't see what you said at the beginning anymore.

This has practical consequences for builders. If you're working on a complex project and your conversation with AI gets very long, it may start contradicting things it said earlier or forget instructions you gave it. Not because it's being difficult — because those earlier messages scrolled out of its context window.

Answer: Generally false. Most AI tools don't retain memory between separate conversations. Within a single conversation, the AI re-reads the whole exchange each time but can lose track of early messages once the context window fills up.

Math and Reasoning: Where Prediction Hits a Wall

If AI is a pattern-matching machine, you'd expect it to struggle with tasks that require actual logic and precise calculation. And you'd be right.

AI can seem great at math when the problem is common enough to appear in its training data. Ask it "What's 15% of 200?" and it nails it — because that type of calculation appeared thousands of times in its training text. But give it an unusual multi-step problem, and it can confidently produce a wrong answer because it's predicting what a correct-looking answer should look like rather than actually computing.

The same goes for logical reasoning. AI can follow common reasoning patterns, but it can trip on basic logic puzzles that a human would solve easily. It might tell you something contradicts itself in the same paragraph without noticing. Why? Because it generates text one word at a time. It doesn't step back, re-read its own output, and think "wait, that doesn't make sense."

The takeaway for builders: Never trust AI math without double-checking. Never assume AI reasoning is logically sound. Use AI to draft, brainstorm, and accelerate your work — but when precision matters, verify everything.

Key Concepts

  • Hallucinations are confident, specific AI outputs that are completely fabricated
  • Bias enters AI through training data reflecting human stereotypes
  • Context windows limit how much text AI can process at once
  • AI struggles with precise math and logical reasoning
  • Smart builders know AI's weaknesses and plan around them

Try It: AI Fail Files

Time to put your new knowledge to work. Below are five real-world examples of AI failures. For each one, identify the type of failure and explain what went wrong.

Fail #1: The Fake Research Paper

A student asked AI for research sources on climate change. The AI responded with a detailed citation: "Johnson, M. (2019). 'Atmospheric Carbon Patterns in the Arctic.' Journal of Environmental Studies, 45(3), 234-251." The student used this citation in their research paper and submitted it. The teacher flagged it — the journal, the authors, and the paper don't exist.

Failure Type: Hallucination

The AI saw a pattern ("a research citation should look like this") and filled in the blanks with plausible-sounding but completely made-up information. It had no way to verify whether these sources actually exist.

Fail #2: The Biased Recommendation

A hiring manager asked AI to describe what a typical CEO looks like. The AI responded: "Picture a tall man in his 50s with graying hair, wearing a navy suit and speaking in a deep, confident voice." It consistently used male pronouns and masculine descriptors. When asked about CEOs from different industries, the pattern repeated.

Failure Type: Bias

The AI learned from training data where the majority of high-profile CEOs in published text were men. It absorbed the pattern and now reproduces that stereotype when describing executives.

Fail #3: The Forgotten Instructions

A designer told AI: "Always use blue as the primary color in your designs." They had a long conversation with AI, asking for 20+ different design iterations. Early iterations were blue. Around message 20, the designer asked for a new variant and AI produced a design in red and yellow, completely ignoring the original instruction.

Failure Type: Context Window Limit

The long conversation eventually exceeded the AI's context window. The original instruction ("always use blue") scrolled out of view. AI could no longer "see" it, so it didn't follow it anymore.

Fail #4: The Math Mistake

A student asked AI to solve a multi-step word problem: "Sarah bought 8 items at $2.50 each, then spent another $4 on tax and shipping. What's the average cost per item?" The AI responded: "8 items × $2.50 = $20, plus $4 = $24 total. Average per item: $24 ÷ 8 = 4 dollars per item." This is wrong. The correct answer is $3 per item ($24 ÷ 8 = 3).

Failure Type: Math Error

The AI predicted what a "correct-looking answer" should sound like but made a calculation error. It generated "4 dollars" instead of "3 dollars" because 4 is a rounder number that appears frequently in similar problems.

Fail #5: The Contradicting Expert

Someone asked AI: "Is chocolate safe for dogs?" The AI responded: "Yes, chocolate is perfectly safe for dogs and can be a healthy treat." Then, in the same response, later: "Dogs should never eat chocolate — it's toxic and can cause serious harm." Both statements appeared in the same answer, with no acknowledgment of the contradiction.

Failure Type: Reasoning/Logic Error

The AI predicted both patterns ("chocolate is safe" and "chocolate is toxic") because both appeared in its training data. It generated one after the other without checking whether they contradict. It doesn't re-read its own work the way humans do.

Check Your Understanding

1. What is an AI hallucination?

Explanation: A hallucination is when AI generates output that's completely made up but presented with confidence and detail. It's one of the most dangerous AI failure modes because it looks credible.

2. Why does AI sometimes produce biased outputs?

Explanation: AI bias comes from the training data, which reflects real-world biases in published text, the internet, and human-written documents. The AI absorbs these patterns without intentional bias from programmers.

3. You're 30 messages into a conversation and AI starts ignoring early instructions. Most likely explanation?

Explanation: AI doesn't hold onto past conversations in memory — it re-reads what you've said each time. But there's a limit to how much it can re-read at once (the context window). Once early messages scroll out, it can't "see" them anymore.

4. What's the BEST strategy for using AI on math tasks?

Explanation: AI is great at helping you think through math problems, but it can make confident calculation errors. Always verify the final answer yourself, especially on multi-step problems or when the stakes are high.

5. AI says "Great Wall of China was built in 1823 by Emperor Tokugawa." What type of failure is this?

Explanation: This is a hallucination. The AI invented a specific, detailed "fact" (wrong emperor, wrong date) that sounds plausible but is completely made up. The confidence and specificity are hallmark signs of a hallucination.

Reflect & Write

Think about a situation where you accepted information without questioning it — from a website, a friend, a social media post, or anywhere. Write 2–3 sentences: What made you trust that information? Now that you've seen how AI can be confidently wrong, what's one habit you want to build for checking information?

Project Checkpoint

No project action required yet. But as you start thinking about project ideas, keep today's lesson in mind: What kinds of AI failures could affect the project you're thinking about? If your project involves AI-generated content, how would you build in verification?

Level Up: Coming Next

Lesson 1.3 — How to Check AI's Work. You know what AI gets wrong. Next, you'll learn exactly how to catch those errors before they cause problems.

Continue to Lesson 1.3 →