MISSION 2.1 · LEVEL 2 — MACHINE LEARNING FUNDAMENTALS

AI vs. Machine Learning vs. Deep Learning vs. Generative AI

The nested-sets mental model that ends the terminology confusion — what each term actually means, where LLMs sit, and how to choose between predictive ML and generative approaches.

MISSION 3 OF 9 IN THE PUBLISHED JOURNEY · LEVEL 2: Machine Learning Fundamentals · 12 MIN READ · BADGE TRACK: ML FUNDAMENTALS

FundamentalsMachine LearningDeep LearningGenAI

Introduction

Ask five people to define “AI,” “machine learning,” “deep learning,” and “generative AI” and you will get five overlapping Venn diagrams drawn from memory. The confusion is not embarrassing — it is expensive. Teams pick the wrong approach because they mislabel the problem, and interviewers probe exactly this vocabulary to see whether you think in categories or in buzzwords.

This mission gives you the one mental model that resolves all of it: these four terms are nested sets, not competing technologies.

Learning objectives

  • Draw the containment relationship between AI, ML, DL, and GenAI from memory.
  • Place LLMs, transformers, and classic algorithms in the correct layer.
  • Decide when a problem calls for predictive ML versus generative AI.
  • Use the vocabulary precisely in design discussions and interviews.

The nested-sets model

Each term is a strict subset of the previous one:

┌────────────────────────── ARTIFICIAL INTELLIGENCE ──────────────────────────┐
│  Any technique that makes machines exhibit intelligent behavior —           │
│  including rule-based systems and search.                                   │
│                                                                             │
│   ┌──────────────────── MACHINE LEARNING ─────────────────────┐             │
│   │  Systems that learn patterns from data instead of being    │             │
│   │  explicitly programmed with rules.                         │             │
│   │                                                            │             │
│   │   ┌────────────── DEEP LEARNING ──────────────┐            │             │
│   │   │  ML using multi-layer neural networks.     │            │             │
│   │   │                                            │            │             │
│   │   │   ┌───── GENERATIVE AI ─────┐              │            │             │
│   │   │   │  Models that produce     │              │            │             │
│   │   │   │  new content: text,      │              │            │             │
│   │   │   │  images, code, audio.    │              │            │             │
│   │   │   │  (LLMs live here.)       │              │            │             │
│   │   │   └─────────────────────────┘              │            │             │
│   │   └────────────────────────────────────────────┘            │             │
│   └─────────────────────────────────────────────────────────────┘             │
└───────────────────────────────────────────────────────────────────────────────┘

Read it from the outside in:

  • Artificial intelligence — the umbrella. A rules engine that approves loans is AI. So is a chess search tree. No learning required.
  • Machine learning — the subset of AI where behavior is learned from data rather than hand-coded. A spam filter trained on labeled emails is ML.
  • Deep learning — the subset of ML where the learned function is a multi-layer neural network. Vision, speech, and the transformer architecture all live here.
  • Generative AI — the subset of deep learning whose output is new content rather than a label or a score. Large language models, image diffusion models, and code generators are generative.

So: every LLM is deep learning, every deep learning model is machine learning, every machine learning system is AI — but almost no AI system is an LLM. That last clause is the one teams forget when they reach for GPT to solve a problem that a logistic regression would solve better, cheaper, and more explainably.

Where familiar things sit

Thing you knowLayerWhy
A rules-based approval workflowAI (not ML)Intelligent behavior, zero learning
Spam classifier trained on labeled emailML (not DL)Learns from data, classical model
Face recognition CNNDeep learningMulti-layer neural network, discriminative
Fraud-detection gradient boostingML (not DL)Learned from data, tree-based
GPT-class LLM answering questionsGenerative AITransformer, produces new text
Midjourney / Stable DiffusionGenerative AIDiffusion model, produces images
A vector search indexNone of the aboveIt is retrieval infrastructure, not a learned model

That last row trips people: an embedding index is not “AI” in the model sense — it is a data structure built from an embedding model. Knowing this keeps architecture diagrams honest.

Predictive vs. generative: the engineering decision

The most consequential line in the diagram is not DL vs. GenAI — it is discriminative (predictive) vs. generative, because it determines cost, latency, and risk:

DimensionPredictive MLGenerative AI
OutputA label, score, or numberNew content (text, images, code)
Cost per callMicroseconds, near-free100ms–seconds, per-token cost
Failure modeConfident wrong scoreConfident wrong prose
ExplainabilityFeature importances, SHAPHard; needs tracing and citations
Typical useForecasting, scoring, classificationDrafting, summarizing, extracting, conversing

The engineering rule of thumb: if the answer is one of a known set of values, you want predictive ML. If the answer must be composed from unbounded possibilities, you want generative AI. And when a generative system needs to be right rather than merely fluent — enterprise knowledge work — you add retrieval (RAG) and evaluation on top.

A real-world composite: a demand-forecasting platform might use classical ML for the forecast (cheap, accurate, explainable) and an LLM to explain the forecast to analysts in natural language. Choosing one technology for both jobs is the mistake; choosing the right layer for each job is the skill.

Why this matters for the rest of the roadmap

  • Level 2 builds on predictive ML fundamentals — datasets, overfitting, metrics — because they remain the grammar of every learned system, including LLMs.
  • Level 3 goes deep into the deep-learning layer: embeddings, transformers, tokens.
  • Levels 4–7 are generative-AI engineering: LLM apps, RAG, agents, production discipline.
  • Level 8 returns to the full diagram, because senior engineers are the ones who know when not to use the flashiest layer.

Hands-on exercise

Take three systems from your own organization (or three well-known products) and classify each into the nested sets — then answer:

  1. Which layer does each actually operate in?
  2. Is any of them mislabeled in internal conversations (“our AI” for a rules engine)?
  3. For each, would a different layer serve the user better at lower cost?

Write one sentence per system defending the classification. If you cannot defend it, you do not understand the taxonomy yet — reread the diagram.

Key takeaways

  • AI ⊃ ML ⊃ Deep Learning ⊃ Generative AI — nested sets, not competing options.
  • LLMs are generative deep learning; most enterprise “AI” historically was not ML at all.
  • The predictive-vs-generative line drives cost, latency, and failure-mode decisions.
  • Retrieval infrastructure (vector indexes) is not a model — keep diagrams honest.
  • Choosing the right layer for each job is a senior-level skill this roadmap builds toward deliberately.

Continue your journey

Next mission: Supervised, Unsupervised, and Reinforcement Learning (coming soon) — or continue with the published missions Python for Experienced Software Engineers and Embeddings: Turning Meaning into Vectors. Full journey: roadmap overview.

PROGRESS IS SAVED IN YOUR BROWSER AND SYNCED ACROSS THE ROADMAP.