Generative AI: How It Creates ✨

Class 9Age 13–14Lesson 7 of 12πŸ†“ Free
AI-generated art on a screen next to a student writing a creative prompt on paper, colourful generative art in background
Watch first - 2-3 minutes

Class 9 Lesson 7 - Generative AI: How It Creates

No sign-in needed - English narration - Safe for all school ages

Meet Aryan β€” Class 9, Mumbai

Aryan is a huge fan of Bollywood music. One day he typed a description into an AI music tool: "Create an upbeat Rajasthani folk song for a school dance competition, with tabla and flute." In 20 seconds, a full song played back. He was stunned. "Did the AI compose this? Or copy it from somewhere?"

He asked his computer science teacher, who said: "It generated it β€” that's completely different from copying. The AI learned patterns from thousands of songs and created a new one following those patterns." This lesson explains exactly how that works β€” from GANs to transformers to why AI sometimes confidently makes things up.

Concept
What Does "Generative" Mean?

Most AI you've studied so far is discriminative β€” it draws boundaries between categories (spam vs not spam, cat vs dog). Generative AI is different β€” it learns the patterns in data so deeply that it can create new examples that look/sound/read like they came from the real world.

Think of it this way: A discriminative AI is like a judge at a baking contest β€” it says "this cake is good / bad." A generative AI is like the baker β€” it creates a new cake following learned patterns of great baking.
Part 1
GANs: Generator vs Discriminator

Generative Adversarial Networks (GANs) were invented in 2014. They use two neural networks in competition:

🎨
Generator
Creates fake images from random noise. Goal: fool the Discriminator.
β†’
πŸ”
Discriminator
Decides: real image or fake? Goal: catch the Generator.
β†’
πŸ”
Training Loop
Both networks improve each round. Generator makes better fakes. Discriminator gets better at spotting them.

After millions of training rounds, the Generator becomes so good that even the Discriminator can't tell real from fake. That Generator IS the AI model β€” like DALL-E 1 or early deepfake systems.

Part 2
Three Generative AI Architectures
πŸŒ€
Diffusion Models
Learn to remove noise from a noisy image step by step. To generate: start with pure noise, then denoise it into a real image. Used by DALL-E 3, Stable Diffusion, Midjourney.
πŸ”
Transformer + Attention
Processes all words simultaneously (not one at a time). "Attention" lets the model focus on relevant words anywhere in the sentence. Foundation of GPT-4, Gemini, Claude. Invented at Google in 2017 ("Attention Is All You Need" paper).
🎡
Autoregressive Models
Predict the next token (word/note/pixel) based on all previous tokens. Repeat until the output is complete. GPT models and music AIs like Suno/Udio work this way.
Fun fact: ChatGPT, Gemini, Claude, and Copilot are all transformer-based autoregressive language models. They predict one word at a time, yet do it so fast (millions of tokens per second on GPU clusters) that it feels instant.
Part 3
Prompt Engineering: How to Talk to AI Better

The quality of your output depends heavily on how well you write your prompt. Here's the difference:

❌ Weak Prompt
Write a story about a student.
Too vague. The AI makes random choices β€” age, setting, tone, length β€” and you get a generic story.
βœ… Strong Prompt
Write a 3-paragraph short story about a 14-year-old girl in Hyderabad who discovers she can talk to AI models in Telugu. Tone: hopeful and funny. End with a surprising twist. Avoid mentioning technology brand names.
Specific role, context, age, location, tone, length, constraint β€” gives the AI exactly what it needs to create something you'll actually use.
Part 4
Generative AI Tools You Can Try
ChatGPT / Gemini
Text generation
DALL-E / Midjourney
Image generation
Stable Diffusion
Image (open source)
Suno / Udio
Music generation
ElevenLabs
Voice cloning / TTS
Runway / Pika
Video generation
Critical Thinking
The Hallucination Problem

Generative AI doesn't "know" facts β€” it predicts the most statistically likely next token. This means it can produce confidently-stated falsehoods β€” called hallucinations.

Example hallucination: Ask an AI "Who won the 2026 Nobel Prize for Physics?" It may give a convincing name with a detailed reason β€” even though it has no knowledge of 2026 events. The AI is pattern-matching, not fact-retrieving.

πŸ§ͺ Check Your Understanding β€” Lesson 7 Quiz

1. What is the key difference between discriminative and generative AI?
a) Discriminative AI uses more data
b) Discriminative AI classifies data; generative AI creates new data that matches learned patterns
c) Generative AI can only make images, not text
d) They are exactly the same β€” just different names
2. In a GAN, what is the job of the Generator?
a) To judge whether an image is real or fake
b) To create fake data good enough to fool the Discriminator
c) To label training data
d) To measure model accuracy
3. Diffusion models (like Stable Diffusion) generate images by:
a) Copying pixels from a database of real images
b) Having the Generator fool the Discriminator
c) Starting from pure noise and step-by-step removing noise to reveal a meaningful image
d) Converting text directly to pixels without any learning
4. The "Attention" mechanism in transformers allows the model to:
a) Pay more attention to longer sentences
b) Focus on relevant words anywhere in the input, regardless of their position
c) Process words one at a time from left to right
d) Remove stop words automatically
5. Which prompt is most likely to produce a useful, specific output?
a) "Write about climate change"
b) "Tell me everything about AI"
c) "In 5 bullet points, explain how climate change affects Indian farmers. Use simple English for a Class 9 student."
d) "Climate"
6. AI "hallucination" means:
a) The AI crashes when confused
b) The AI generates confidently-stated false or made-up information
c) The AI produces images that look too realistic
d) The AI takes too long to respond
7. Autoregressive models like GPT generate text by:
a) Removing noise from a noisy text input
b) Predicting the next most likely word/token, one at a time
c) Copying sentences from their training data
d) Running two competing networks against each other
8. You ask an AI "Who won the 2028 Olympics 100m sprint?" and it gives a confident name with details. What should you do?
a) Trust it β€” AI has access to future events
b) Share it on social media immediately
c) Verify the answer through official sports news sources β€” this is likely a hallucination
d) Ask the AI again β€” it will correct itself
← Lesson 6: Regression Lesson 8: NLP Basics β†’