What AI actually is.
And what it isn't.
"AI" is the most overused word in technology. It describes everything from a spam filter to ChatGPT to a startup's marketing page. This lesson separates the vocabulary from the substance — what AI, machine learning, and deep learning actually mean, how a model is trained, and why the recent explosion in capability happened. No hype. Just the mechanism.
Three terms, nested like Russian dolls: AI is the broad field (machines doing intelligent things). Machine learning is a subset (systems that learn from data instead of being programmed with rules). Deep learning is a subset of ML (neural networks with many layers). All deep learning is machine learning, all machine learning is AI, but not all AI is machine learning. When people say "AI" today, they mean deep learning — even though they don't realize it.
Before this lesson: you should be comfortable with Python basics — variables, functions, loops, dicts. If not, start with the Python track.
🪆 AI vs ML vs DL — the nested hierarchy
Three terms everyone uses as synonyms. They're not.
┌─────────────────────────────────────────────────────┐ │ ARTIFICIAL INTELLIGENCE (AI) │ │ The broad field — machines doing intelligent tasks │ │ │ │ ┌───────────────────────────────────────────────┐ │ │ │ MACHINE LEARNING (ML) │ │ │ │ Systems that learn from data │ │ │ │ │ │ │ │ ┌─────────────────────────────────────────┐ │ │ │ │ │ DEEP LEARNING (DL) │ │ │ │ │ │ Neural networks with many layers │ │ │ │ │ │ │ │ │ │ │ │ • CNNs (images) │ │ │ │ │ │ • RNNs (sequences) │ │ │ │ │ │ • Transformers (LLMs — GPT, Claude) │ │ │ │ │ │ │ │ │ │ │ └─────────────────────────────────────────┘ │ │ │ │ │ │ │ │ • Linear regression │ │ │ │ • Decision trees │ │ │ │ • SVMs │ │ │ │ • Clustering │ │ │ │ │ │ │ └───────────────────────────────────────────────┘ │ │ │ │ • Rule-based systems (Eliza, expert systems) │ │ • Classical search algorithms │ │ • Game-playing (chess, go — before DL) │ │ │ └─────────────────────────────────────────────────────┘
AI (broadest)
Any technique that makes machines do things that look intelligent. Includes rule-based systems that don't learn at all — like a chess engine that plays from a hand-coded evaluation function. When people say "AI," they're usually thinking of the inner circles.
ML (middle)
Systems that improve through exposure to data. Instead of writing rules, you show examples and the model learns the pattern. Linear regression is ML. Decision trees are ML. This is what most "AI products" actually use.
DL (innermost)
ML with neural networks that have many layers. It dominates image recognition, speech, and language. ChatGPT, Claude, Midjourney — all deep learning. Everything that made AI famous recently is deep learning specifically.
Why the confusion
People say "AI" when they mean "DL." Marketing amplifies this because "AI" sounds more impressive. When you read "AI-powered," mentally translate it to "neural network powered." That's what's actually running.
Translate "AI" to "deep learning" in your head. When a product says "AI-powered," it almost always means deep learning — sometimes supervised ML, sometimes a pre-trained LLM API call. Very rarely does it mean the broad category of AI (rule-based systems, classic search, symbolic reasoning). Knowing this saves you from being impressed by things that are actually simple — or dismissing things that are actually sophisticated.
🎓 Training vs inference
The two phases of every AI model. Different cost, different speed, different purpose.
TRAINING (teaching) ─────────────────────────────────────────── What: Show the model thousands of examples and adjust its internal numbers (weights) to reduce errors. When: Once, before deployment Cost: Expensive — GPUs, hours to weeks GPT-4 training: months, ~$100M Small: Minutes on a laptop INFERENCE (using) ─────────────────────────────────────────── What: Give the trained model new input, get its prediction. When: Every time a user interacts Cost: Cheap — milliseconds per query GPT-4 inference: ~$0.001 per query Small: Microseconds Analogy: Training = going to school (slow, expensive, once) Inference = doing your job (fast, cheap, every day)
Training
The learning phase. Data goes in, weights get adjusted, the model gets better. It's slow (hours to weeks for large models), expensive (GPU compute), and happens once before deployment. This is where the AI is actually "created."
Inference
The usage phase. Input goes in, prediction comes out. It's fast (milliseconds), cheap (fractions of a cent for API calls), and happens every time you use the model. This is what an API call to ChatGPT actually is.
Fine-tuning
A second, shorter training phase. You take a pre-trained model (like GPT) and train it a bit more on your own data. It's cheaper than training from scratch, and it's how you specialize a general model for a specific use case.
Why the distinction matters
Training is where AI companies spend money. Inference is where users spend money. If you're building on top of an API (OpenAI, Anthropic), you're only paying for inference. If you're training a model, you're paying for both.
Every time you use ChatGPT, you're using inference — not training. The model was already trained. You're just giving it input and getting output. This is why ChatGPT is fast — inference takes seconds, while training took months. It's also why ChatGPT can't "learn" from your conversation: your messages don't update the model's weights. They just influence the current conversation's context window.
📊 Supervised vs unsupervised learning
Two of the main training paradigms. One uses labels, one doesn't.
SUPERVISED LEARNING (labeled data)
───────────────────────────────────────────
Data: Input + expected output pairs
("this photo" → "cat", "this email" → "spam")
Task: Learn the mapping from input to output
So you can predict output for new input
Examples:
• Image classification
• Spam detection
• Sentiment analysis
• Price prediction
• Medical diagnosis
Cost: Expensive — humans must label data
Common: The most-used paradigm in production
UNSUPERVISED LEARNING (unlabeled data)
───────────────────────────────────────────
Data: Just input, no expected output
(100,000 customer records, no labels)
Task: Find patterns, groupings, or structure
Examples:
• Customer segmentation
• Anomaly detection
• Dimensionality reduction
• Recommendation systems
• Data exploration
Cost: Cheaper — no labeling required
Common: Less common in production, but very useful
REINFORCEMENT LEARNING (reward signal)
───────────────────────────────────────────
Data: An environment + a reward function
The model learns by trial and error
Task: Learn the sequence of actions that
maximizes cumulative reward
Examples:
• Game playing (AlphaGo, chess engines)
• Robotics control
• Autonomous driving
• RLHF (how ChatGPT was fine-tuned)
Cost: Expensive to train, fragile
Common: Powerful but specialized
Supervised
Training with labeled examples. The model learns to map input to output by seeing thousands of pairs. The most common paradigm. The main cost is labeling data — humans have to review and label thousands of examples.
Unsupervised
Training without labels. The model finds patterns on its own. Used for clustering (grouping similar items), anomaly detection (spotting unusual data), and dimensionality reduction (simplifying complex data). Harder to evaluate because there's no "right answer."
Reinforcement
Training by trial and error. The model interacts with an environment, gets rewards or penalties, and learns the strategy that maximizes reward. AlphaGo used this. So did the RLHF that made ChatGPT useful.
Which one for what
Labeled data available → supervised. No labels, need to find patterns → unsupervised. Need to optimize sequential decisions → reinforcement. Most beginner AI projects are supervised.
The labeling cost is real. For supervised learning, humans have to label every training example. For 100,000 images, that's weeks of work or thousands of dollars to a labeling company. This is why so much AI research focuses on reducing label requirements — few-shot learning, self-supervised learning, and synthetic data generation all target this bottleneck. It's the single biggest cost in building production ML.
🚀 Why AI suddenly got so good
Three things converged. None of them alone was enough.
Neural networks existed since the 1950s. Deep learning existed since the 1990s. So why did "AI" only become a household term in 2022? Because three things converged at the same time — data, compute, and algorithms. Remove any one of them and the recent explosion doesn't happen.
1. Data
The internet produced billions of examples — text, images, video, labeled by users for free. Before the web, you couldn't train a model on a billion examples. After, you could. This was the first domino.
2. Compute
GPUs — designed for video games — turned out to be perfectly suited for the matrix math neural networks need. Training that took weeks on CPUs took hours on GPUs. 100x speedup changed what was possible.
3. Algorithms
The transformer architecture (2017) made it practical to train on much larger datasets. Attention — the key idea — let models look at all parts of the input at once instead of one at a time. Every modern LLM is built on this.
4. The flywheel
These three converged to enable the fourth: scale. Larger models with more data and more compute kept producing better results. GPT-2 (2019) was a toy. GPT-3 (2020) was impressive. GPT-4 (2023) was transformative. Same architecture, more scale.
AI didn't suddenly become intelligent — it became trainable. The mechanism is the same as it was in 2000. Neural networks that adjust weights to reduce error. What changed is that we could finally feed them enough data and enough compute to work. This is important: it means today's AI is a scale story, not a breakthrough story. Which also means the next big jump will probably come from even more scale — or from a fundamentally different mechanism. Knowing this helps you evaluate claims about "AGI" without hype.
🔍 What just happened
The mental model — five ideas that make AI legible.
AI is pattern-matching at scale
Every AI system is finding patterns in data. A spam filter finds patterns in email text. A language model finds patterns in word sequences. There's no "understanding," "reasoning," or "consciousness" — just patterns. This is why AI is impressive within its training distribution and fails outside it.
Training adjusts numbers
A neural network is millions of parameters — numbers. Training is adjusting those numbers so the model's output matches the training data. That's the entire process. Everything else — backpropagation, gradient descent, learning rate — is a way to make the adjustment process efficient.
Inference is fast; training is slow
Once trained, the model is frozen. Using it (inference) is fast and cheap — a matter of milliseconds. Training is slow and expensive — hours to weeks. This asymmetry is why AI companies train once and serve millions of users.
Labels are the bottleneck
Supervised learning — the most common paradigm — needs labeled examples. This is expensive. Every AI startup has to pay for labels, gather them from users, or invent tricks to learn without them. The ongoing cost of AI is data labeling, not compute.
The recent jump is a scale story
Neural networks haven't fundamentally changed since the 1990s. What changed is data (the internet), compute (GPUs), and architecture (transformer). These enabled bigger models, which worked better than anyone expected. It's not "AI became intelligent" — it's "AI became trainable at scale."
🏆 Challenge
Three tasks. No code — just thinking through the concepts.
Task 1 — Classify the AI
For each of these, decide: is it AI (broadest)? Is it ML? Is it DL? Or is it some combination?
1. A spam filter that learns from users marking emails as spam
2. A chess engine that plays by evaluating board positions with hand-coded rules
3. ChatGPT generating a response to your question
4. Netflix recommending movies based on your watch history
5. A calculator app doing arithmetic
Answer each. Then for each one that's ML or DL, decide whether the training is supervised, unsupervised, or reinforcement.
Task 2 — Training vs inference
For each of these products, identify what's training and what's inference:
1. ChatGPT responding to a user
2. OpenAI training GPT-5
3. A face-recognition doorbell identifying someone
4. A bank training a fraud detection model
5. Spotify recommending your next song
Which side (training or inference) is more expensive? Which happens more often? Why does this matter for AI companies?
Task 3 — Design a model
Pick one problem. Design the training approach:
1. Classify customer reviews as positive or negative
2. Detect fraudulent credit card transactions
3. Cluster users into groups based on behavior
4. Recommend products to a shopper
For your chosen problem, answer:
• Supervised, unsupervised, or reinforcement?
• What data would you need?
• Where does the data come from?
• What's the training cost likely to be?
• What could go wrong?
This is exactly the kind of planning a real ML engineer does before writing any code.
⚠️ Common mistakes
The misconceptions that keep people confused about AI.
They're nested, not identical. Deep learning is ML, ML is AI, but AI includes things that aren't ML at all (rule-based systems). Use the terms precisely — it's the first sign you actually understand the field.
AI finds patterns. It doesn't understand. GPT doesn't "know" what a cat is — it knows what word tends to follow "the cat is." This distinction matters for every AI product you evaluate and every claim about "AGI."
ChatGPT isn't training on your conversation — it's doing inference. Your messages influence the current session's context, not the model's weights. The model is frozen after training.
You don't need a math degree, but you do need to understand what a derivative is and what a matrix is. Without that, backpropagation and neural networks are pure magic — and you'll never debug a model that isn't working.
"AGI by 2027," "AI will replace all developers," "AI is useless." All predictions, no certainty. The truth: AI is a powerful pattern-matching tool with real, specific capabilities and real, specific limits. Learn the mechanism, ignore the prophecies.
TensorFlow.js runs models in your browser. A laptop CPU can train small models in seconds. You need a GPU only for large-scale training — not for learning the concepts or building small projects.
LLMs are the top of the stack. Starting there means you understand the "what" but not the "how." Learn supervised learning, then neural networks, then transformers, then LLMs. The foundation matters.
Every "supervised" model needs labeled data. That's the actual cost of AI — not the compute, but the humans labeling millions of examples. Understanding this is what separates people who build AI from people who use AI.
➡️ What's next
You understand the vocabulary. Next: how machine learning actually works.
❓ Frequently asked questions
What is artificial intelligence?
AI is the broad field of making machines perform tasks that normally require human intelligence — recognizing images, understanding language, making decisions, playing games. The term covers everything from simple rule-based systems to modern large language models. When people say 'AI' today, they usually mean machine learning or deep learning specifically.
What is the difference between AI, machine learning, and deep learning?
AI is the broad field. Machine learning is a subset of AI — systems that learn from data instead of being explicitly programmed with rules. Deep learning is a subset of machine learning — neural networks with many layers. All deep learning is machine learning, all machine learning is AI, but not all AI is machine learning.
What does training a model mean?
Training is the process of showing a model lots of examples so it learns the patterns. For an image classifier, training means showing it 100,000 labeled images and adjusting its internal numbers (weights) so it predicts the right label more often. Training happens once, offline, usually on powerful hardware.
What is the difference between training and inference?
Training is teaching the model — showing it data and adjusting its weights. It's slow, expensive, and happens once. Inference is using the trained model — giving it new input and getting a prediction. It's fast, cheap, and happens every time a user interacts with the model.
What is supervised learning?
Supervised learning is training with labeled data. You show the model input-output pairs — photos labeled 'cat' and 'dog', emails labeled 'spam' and 'not spam' — and it learns the mapping. Most real-world AI is supervised. The main cost is labeling data — humans have to label thousands of examples.
What is unsupervised learning?
Unsupervised learning is training without labels. You show the model raw data and it discovers patterns on its own — clustering similar items, finding anomalies, reducing dimensionality. Used for customer segmentation, anomaly detection, and recommendation systems.
Why did AI suddenly get so good?
Three things converged around 2012-2020: (1) Data — the internet produced billions of labeled examples, (2) Compute — GPUs made training neural networks 100x faster, (3) Algorithms — the transformer architecture (2017) made it possible to train on much more data. None of these alone was enough. Together they made deep learning practical.
Do I need a math degree to learn AI?
No. You need to understand: matrices (they're just grids of numbers), derivatives (they tell you which direction to adjust weights), probability (for handling uncertainty), and vectors (for representing data). That's high-school-plus level math, not a degree. Most AI work is applying existing models — engineering, not research.