Skip to content
C

Generative AI

Complete learning notes


1. Introduction

Every algorithm you've studied so far — from Linear Regression through CNNs and Transformers — has been fundamentally about ANALYZING existing data: predicting a category, a number, or a cluster. Generative AI flips this around: instead of analyzing, it CREATES new, original content — images, text, music — that didn't exist before. This topic builds the core intuition behind this fascinating shift.


2. What is Generative AI?

Term: Generative AI

Simple definition: Generative AI refers to AI systems that create new, original content — such as images, text, music, or code — rather than simply analyzing or classifying existing data.

In simple words: Nearly everything else in this course has been about a model looking at something and answering a question about it ("is this spam?", "what's this house worth?"). Generative AI instead asks the model to PRODUCE something brand new — "draw me a cat wearing a hat," "write me a poem about autumn" — content that never existed until the model generated it.

Technical explanation: Generative AI models learn the underlying probability distribution of their training data (e.g., what makes an image "look like" a realistic photo, or what makes a sentence "sound like" natural language), then sample from this learned distribution to produce new, original outputs that share the same statistical characteristics as the training data, without directly copying any single training example.


3. Why is it Important?

  • It represents one of the most visible, culturally significant recent developments in AI — powering tools like AI image generators and the chat-based AI assistants many people now use daily.
  • It fundamentally differs from every "discriminative" (analyzing/classifying) technique covered elsewhere in this course, making it an important conceptual category to understand clearly.
  • It directly sets up LLM Basics (Topic 8) — Large Language Models are, at their core, a specific and enormously impactful application of generative AI to text.

4. Prerequisites

Comfort with Neural Networks (Topic 2) and NLP (Topic 6), particularly the concept of the Transformer architecture.


5. Core Concepts

  1. Generative vs Discriminative models
  2. GANs (Generative Adversarial Networks) — a foundational image-generation intuition
  3. Diffusion models — a modern, widely-used image-generation approach
  4. Text generation as a generative task (bridging to Topic 8)

6. Detailed Explanation

a) Generative vs Discriminative Models

Term: Discriminative Model

Simple definition: A model that learns to distinguish between different categories or predict an outcome — essentially everything covered in Modules 4-7 of this course (Logistic Regression, Decision Trees, etc.) is discriminative.

In simple words: A discriminative model answers "given this input, what category/value does it belong to?" A generative model instead answers "can you produce a brand-new example that PLAUSIBLY could belong to this category?"

b) GANs (Generative Adversarial Networks)

Term: GAN (Generative Adversarial Network)

Simple definition: A generative approach using two competing neural networks — a "Generator" that creates fake content, and a "Discriminator" that tries to tell fake content apart from real content — where both networks improve together through this ongoing competition.

In simple words: Imagine a forger (the Generator) trying to create convincing fake paintings, and an art expert (the Discriminator) trying to catch the fakes. As the expert gets better at spotting fakes, the forger is forced to get better at creating convincing ones — and this back-and-forth competition, repeated many times, eventually produces a forger capable of creating remarkably realistic fake paintings (or, in AI terms, realistic fake images).

c) Diffusion Models

Term: Diffusion Model

Simple definition: A generative approach that learns to create images by starting with pure random noise and gradually "cleaning it up," step by step, into a coherent, realistic image — the reverse of a process where a real image is gradually turned into noise.

In simple words: Imagine watching a photograph slowly dissolve into random static, frame by frame. A diffusion model learns to run this process IN REVERSE — starting from pure static and gradually "reconstructing" a coherent image, step by step. Most modern AI image generators (as of this course's writing) are built on diffusion models.

d) Text Generation (Bridging to LLMs)

Generative AI applied to TEXT works conceptually similarly — a model learns the statistical patterns of language well enough that it can generate new, coherent, plausible text, one piece at a time, based on everything generated so far. This is exactly the foundation for Large Language Models, covered in depth in Topic 8.


7. How It Works (GAN Example)

  1. The Generator network creates a fake image, starting from random noise.
  2. The Discriminator network examines both real training images and the Generator's fake images, trying to correctly identify which is which.
  3. Both networks are updated: the Discriminator improves at catching fakes; the Generator improves at fooling the Discriminator.
  4. This process repeats many times, with the Generator gradually producing increasingly realistic, convincing images.

8. Real-World Example

AI image generation tools that can create a photorealistic image from a text description ("a golden retriever wearing sunglasses, digital art") are a direct real-world application of generative AI — typically using diffusion models today, though earlier systems used GANs. Similarly, AI writing assistants generating original paragraphs of text are applying the same generative principle, adapted to language via the Transformer architecture (Topic 6).


9. Advantages

  • Enables entirely new creative and productivity applications — generating art, writing, music, and code that didn't exist before.
  • Can assist with rapid prototyping, brainstorming, and content creation across countless creative and professional fields.
  • Diffusion models and modern LLMs have achieved remarkably high-quality, coherent generated output.

10. Limitations

  • Generated content can be factually incorrect or nonsensical, especially for text (a phenomenon called "hallucination," explored further in Topic 8).
  • Raises genuine ethical and legal questions around copyright, misinformation (e.g., deepfakes), and the training data used.
  • GANs, in particular, can be notoriously difficult and unstable to train, requiring careful balancing between the Generator and Discriminator.

11. Common Mistakes

  • Assuming generative AI models "understand" content the way humans do — they're generating statistically plausible outputs based on learned patterns, not reasoning from genuine comprehension.
  • Confusing GANs and Diffusion Models — GANs use a competing generator/discriminator pair; diffusion models use a noise-removal process. Both are generative, but mechanically quite different.
  • Treating generated content as automatically factually accurate, especially for text generation.

12. Best Practices

  • Always critically evaluate generative AI output, especially for factual claims (relevant directly to Topic 8's discussion of LLM limitations).
  • Be mindful of the ethical and legal considerations (copyright, misuse potential, misinformation) surrounding generative AI use and deployment.
  • Understand which category (GAN, diffusion, or Transformer-based text generation) underlies a specific tool, to better anticipate its strengths and limitations.

13. Real-World Applications

  • AI image and art generation tools.
  • AI writing assistants and chatbots (directly connecting to Topic 8's LLMs).
  • Synthetic data generation for training other ML models when real data is scarce or sensitive.
  • Music and audio generation tools.

14. Interview-Oriented Points

  • Be ready to explain the difference between discriminative and generative models.
  • Understand the core intuition behind GANs (competing generator/discriminator) and diffusion models (reversing a noise process).
  • Be able to explain why generated content (especially text) isn't guaranteed to be factually accurate.

15. Exam-Oriented Points

  • Generative AI creates new content; discriminative models (Modules 4-7) classify/predict from existing data.
  • GANs use a competing Generator and Discriminator; Diffusion models reverse a noise-adding process to construct images.
  • Generative AI applied to text is the foundation for LLMs (Topic 8).

16. Comparison Table — Discriminative Models vs Generative Models

AspectDiscriminative Models (Modules 4-7)Generative Models (This Topic)
Core question answered"What category/value does this input belong to?""Can you create a new, plausible example?"
Example algorithmsLogistic Regression, Decision Trees, CNNs (classification)GANs, Diffusion Models, LLMs (text generation)
Typical outputA label, category, or numberNew content: an image, text, audio, etc.
Example use caseSpam detectionGenerating a new image from a text description

17. Quick Revision

  • Generative AI creates new content, in contrast to discriminative models which classify/predict from existing data.
  • GANs use a competing Generator/Discriminator pair; Diffusion models reverse a noise-adding process to construct realistic images.
  • Generated content isn't guaranteed to be factually accurate or original in a legally/ethically uncomplicated way.
  • Text generation via Generative AI is the direct foundation for LLMs, covered next in Topic 8.

Mock Test

  • Generative AI — Quick Test

    A 10-question multiple-choice check on Generative AI.

    10 questions · 10 min · Easy
    Start Mock Test