In short Artificial intelligence (AI) is the broad goal of getting computers to do things that need human-like intelligence. Machine learning (ML) is a subset of AI — the most common way we build it today — where systems learn patterns from data instead of following hand-coded rules. All machine learning is AI, but not all AI is machine learning. Deep learning and generative AI are subsets nested further inside ML.

“AI” and “machine learning” get used as if they’re the same thing, and in casual conversation that’s usually harmless. But they’re not synonyms — one is a big idea and the other is a specific technique nested inside it. Getting the relationship straight makes you noticeably sharper in any conversation about technology, because you’ll know which layer people are actually talking about.

Any intelligent behavior — including hand-coded rulesArtificial IntelligenceLearns patterns from data (a subset of AI)Machine LearningNeural networks — a subset of MLDeep LearningCreates content — a subset of deep learningGenerative AI

All ML is AI, but not all AI is ML — Hover any part for detail.

The nested-boxes picture

The cleanest way to see the relationship is as boxes inside boxes:

  • Artificial intelligence (AI) is the outer box — the broad ambition of getting computers to do things that normally require human intelligence: recognizing images, understanding language, making decisions, playing games.
  • Machine learning (ML) is a box inside AI — the dominant modern approach, where instead of a programmer writing every rule, the system learns patterns from lots of examples.
  • Deep learning sits inside ML — a powerful ML technique using layered “neural networks,” behind most recent breakthroughs.
  • Generative AI (and the LLMs that power chatbots) sits inside deep learning — models that create new content.

So the rule is simple: all machine learning is AI, but not all AI is machine learning. Our AI, ML & GenAI module has a diagram of exactly this nesting.

AI without machine learning

To really get the distinction, it helps to know that AI doesn’t have to involve learning. Early AI — and plenty of systems still in use — worked on hand-coded rules: a programmer explicitly wrote the logic. A chess program following pre-programmed strategies, or a tax system applying “if income is over X, then Y,” is a form of AI, but there’s no learning involved. The machine only does what a human explicitly told it to.

That rules-based approach is AI, but it is not machine learning. The machine isn’t figuring anything out from data — it’s following instructions.

What makes it “machine learning”

Machine learning flips the model. Instead of writing the rules, you show the system thousands of examples and let it learn the patterns itself. Show it thousands of emails labeled “spam” or “not spam,” and it learns to recognize spam — without anyone listing every rule. Show it years of sales data, and it learns to predict which customers might leave.

The defining feature: the system’s behavior comes from data, not from hand-written logic. That’s why ML got so powerful as data and computing power exploded — it can find patterns far too subtle or numerous for a human to code by hand.

Key point: the test for machine learning is “did it learn this from data, or did a programmer write the rule?” If it learned from examples, it’s ML. If a human coded the logic directly, it’s AI but not ML.

Side by side

Artificial IntelligenceMachine Learning
What it isThe broad goal of intelligent machinesA specific way to achieve it
How it worksAny method — including hand-coded rulesLearns patterns from data
RelationshipThe whole fieldA subset of AI
ExampleA rule-based chess engineA spam filter trained on examples
The test“Does it act intelligently?”“Did it learn from data?”

Why the distinction matters at work

When a colleague says “let’s use AI for that,” it’s worth knowing which layer they mean. A traditional ML model trained on your historical data can predict or classify things — forecast demand, score leads, flag fraud — but it needs good data and a clear target. A generative AI tool (an LLM) can produce language — draft a reply, summarize a report — but it knows nothing specific about your business unless you give it that context. Different layers, different requirements, different projects. Naming the layer turns a fuzzy “use AI” into something you can actually scope. This is the core skill in the AI & Automation course.

How to use the terms

  • “Is this a machine-learning model trained on our data, or a rules-based system?” (naming the approach)
  • “That’s AI, but not ML — it’s following rules a human wrote, not learning.” (the sharp distinction)
  • “Machine learning needs good historical data and a clear target to predict.” (what ML requires)
  • “An LLM is generative AI — a few boxes deep inside machine learning.” (placing the layers)

Get the nesting straight — AI contains ML contains deep learning contains generative AI — and you’ll never again be thrown by the alphabet soup. For the layers below this one, see What Is an LLM? and What Is Generative AI?.

Related reading: What Is Generative AI? · What Is an LLM? · AI Agents at Work