Grokking Generative AI Fundamentals
Vote

0% completed

​

AI, ML, Deep Learning, GenAI: What's the Difference?

Part 1: Four Terms, One Picture

Part 2: Artificial Intelligence, the Widest Circle

Part 3: Machine Learning, Rules Learned From Data

Part 4: Deep Learning, Many Layers of Learning

Part 5: Generative AI, Models That Create

Part 6: Where Large Language Models Sit

Part 7: Narrow Models and General-Purpose Models

Part 8: What This Changes for an Engineer

Common Mistakes

Key Takeaways

Four products each describe one of their features as "AI":

  1. A map app that finds the fastest route home.
  2. An email service that moves spam into a separate folder.
  3. A photo app that finds every picture of your dog.
  4. A support tool that writes a first draft of each reply.

All four products are right to use the word "AI". Each feature does a task that usually requires human thinking, which is what "AI" means. But only the fourth feature is generative AI, because only the fourth creates something new: a reply that did not exist before. The other three find or sort things that already exist. The four features are also built differently, and each approach has a different cost.

Engineers hear four related terms every day: artificial intelligence, machine learning, deep learning, and generative AI. They also hear about large language models, or LLMs. This lesson explains how these terms relate and where each fits.

Part 1: Four Terms, One Picture

The four terms are not four separate things. Each one sits inside the one before it, like a set of nesting dolls, where each hollow doll holds a smaller one:

  • Artificial intelligence is the largest doll and the widest idea.
  • Machine learning sits inside AI, so every machine learning system is also an AI system.
  • Deep learning sits inside machine learning, so every deep learning model is also a machine learning model.
  • Generative AI sits inside deep learning, because today's generative models are deep learning models.

The diagram below shows the same idea as nested circles. It also shows where large language models fit: inside generative AI.

AI holds machine learning, machine learning holds deep learning, deep learning holds generative AI, and large language models sit inside generative AI
AI holds machine learning, machine learning holds deep learning, deep learning holds generative AI, and large language models sit inside generative AI

The nesting works in only one direction. Every generative AI model is a form of AI, but most AI systems are not generative. The route finder and the spam filter are both AI, and neither one creates anything new.

Part 2: Artificial Intelligence, the Widest Circle

Artificial intelligence (AI) is any software that performs tasks that usually require human thinking. Examples include recognizing a face, translating a sentence, planning a route, and choosing a chess move.

The name AI says nothing about how the software works. Some AI systems learn from data. Many older ones learn nothing and instead follow rules people wrote by hand.

A rule-based system makes decisions based on rules a person writes. A fraud check with the rule "block any card used in two countries within one hour" is a rule-based system. So is the map app from the start of this lesson, which finds the fastest route. These systems are AI, but not machine learning, because nothing in them is learned from examples.

Part 3: Machine Learning, Rules Learned From Data

Machine learning (ML) is a way to build AI in which software learns its own rules from examples instead of a person writing them. These examples are called training data.

Consider the spam filter in an email service. A person could write rules by hand, such as "flag any email that contains the word 'winner.'" But spammers change their words, and then the old rules stop working. Machine learning solves this problem differently. You give the system thousands of emails that people have already labeled as spam or not spam. The system finds patterns that separate the two groups, then applies those patterns to new emails.

The diagram below compares three ways to build the same spam filter.

Three ways to build a spam filter: rules written by people, a model trained on labeled examples, and a deep learning model that learns its own features
Three ways to build a spam filter: rules written by people, a model trained on labeled examples, and a deep learning model that learns its own features

Look at what changes from left to right. The person does less of the work, and the data does more. This shift explains every inner circle.

The result of training is called a machine learning model. It is a set of learned numbers that turns an input into an output. A model can only be as good as its training data. If the examples are wrong or one-sided, the model learns the wrong patterns.

Part 4: Deep Learning, Many Layers of Learning

To understand deep learning, start with a neural network. A neural network is a model built from many small math units arranged in layers, where each layer passes its results to the next. Deep learning is machine learning that uses neural networks with many layers. "Deep" means that there are many layers.

The main advantage of deep learning is that it learns useful features on its own. A feature is a measurable property of the input that helps with the task, such as the number of links in an email. In classic machine learning, an engineer often chooses features manually. A deep learning model can start from raw input, such as the full text of an email or the pixels of a photo, and learn which patterns matter. This is how the photo app can find your dog.

This advantage has a cost. Deep learning needs a lot of training data and computing power. Training usually runs on graphics processors, or GPUs, which can do many calculations at once. A later lesson, Neural Networks in One Lesson, looks inside a network layer by layer.

Part 5: Generative AI, Models That Create

Generative AI is the part of deep learning that creates new content. A generative model doesn't just label an input. It produces something that did not exist before, such as a paragraph, a block of code, an image, or a voice clip.

Compare two requests about the same email. "Is this email spam?" has a fixed set of answers, so the model only has to pick one. "Write a polite reply to this email" has almost unlimited answers, so the model has to build one, word by word. The first task is called classifying, and the second is called generating. The next lesson compares these two kinds of models in detail.

Generative AI can produce several types of output:

  • Text, such as answers, summaries, and emails.
  • Code, such as functions, tests, and fixes.
  • Images, created from a written description.
  • Audio and video, such as speech in a chosen voice.

Part 6: Where Large Language Models Sit

A large language model (LLM) is a deep learning model trained on a massive amount of text to predict the next word. It writes a whole answer by making that one prediction many times in a row. "Large" refers to two things: the size of the model, which can hold billions of learned numbers, and the size of its training data.

An LLM is one kind of generative AI, not all of it. Image generators, for example, are generative AI, but they are not language models. Also, not every model built on LLM ideas is generative. Some of these models turn text into numbers for search and write nothing.

Many people now use "AI" to mean "an LLM," because LLMs are the most visible AI tools. As an engineer, use the terms exactly. When a teammate says "AI," ask which circle they mean.

Part 7: Narrow Models and General-Purpose Models

Most AI before LLMs was narrow. A narrow model is built and trained for one task. A spam filter only filters spam, and a face-unlock model only matches faces. For each new task, a team trains a new model.

LLMs changed this. A general-purpose model is a single model that can do many different tasks, and the instructions in each request choose the task. The same LLM can summarize a document, translate a sentence, write a test, and answer a support question. To change the task, you change the request instead of training a new model.

The diagram below compares the two approaches.

Narrow AI uses one trained model per task, while a general-purpose model handles many tasks, chosen by the instructions in each request
Narrow AI uses one trained model per task, while a general-purpose model handles many tasks, chosen by the instructions in each request

General-purpose does not mean that the model can do everything or that it thinks like a person. A system that matches people across most kinds of thinking is called artificial general intelligence (AGI). Today's models are not AGI. They are very capable with language and code, but they still make confident mistakes, which later lessons cover.

Part 8: What This Changes for an Engineer

Knowing the circles helps you choose the right tool, and that choice affects cost, speed, and how predictable a feature is. A general-purpose LLM is flexible, but each call costs money, takes noticeable time, and can return a different answer for the same input. A rule or a small narrow model is cheaper, faster, and more predictable.

The table below applies this reasoning to a few common tasks. These are typical choices, not fixed rules.

TaskOften the right toolWhy
Block a card used in two countries within an hourA ruleThe condition is exact and easy to write down
Flag spam in a high-volume inboxA narrow ML modelPatterns change, and each check must be fast and cheap
Detect objects in photosA deep learning modelRaw pixels need learned features
Draft a reply to a customer emailA generative model, such as an LLMThe output is new text with many valid answers

The four products from the start of this lesson now fall into place. The route finder searches the roads by fixed rules. The spam folder uses a narrow ML model. The dog search uses a deep learning model, and the reply drafter uses an LLM.

When you plan a feature, start from the task, not from the tool. Ask what the output looks like. If it is a fixed label or a yes-or-no, a rule or a narrow model may be enough. If it is open-ended text, code, or an image, generative AI is the right choice.

Common Mistakes

Mistake 1: Treating the four terms as the same thing. "AI," "ML," and "LLM" point to different circles. Mixing them up leads to unclear plans and wrong tool choices.

Mistake 2: Using an LLM when a rule or a small model would do. An LLM can classify spam, but at high volume a narrow model does the same job faster, more cheaply, and more predictably.

Mistake 3: Hearing "general-purpose" as "general intelligence." A general-purpose model can do many tasks, but it can still be confidently wrong. Plan for checks, not for perfect answers.

Key Takeaways

  • The four terms sit inside each other. AI holds machine learning, machine learning holds deep learning, and deep learning holds generative AI.
  • Not all AI learns. Rule-based systems are AI, but only machine learning learns its rules from data.
  • Deep learning finds its own features. It uses neural networks with many layers, and it needs a lot of data and computing power.
  • An LLM is one kind of generative AI. It writes by predicting the next piece of text, over and over.

The next lesson, Generative vs Discriminative Models, compares models that sort with models that create. It also explains why creating is harder.

Reading Progress

0%


Vote for new content

On This Page

Part 1: Four Terms, One Picture

Part 2: Artificial Intelligence, the Widest Circle

Part 3: Machine Learning, Rules Learned From Data

Part 4: Deep Learning, Many Layers of Learning

Part 5: Generative AI, Models That Create

Part 6: Where Large Language Models Sit

Part 7: Narrow Models and General-Purpose Models

Part 8: What This Changes for an Engineer

Common Mistakes

Key Takeaways