On this page

The three nested circles

What is artificial intelligence?

What is machine learning?

What is deep learning?

What is generative AI?

Not all generative models are deep learning

One problem, four approaches: a spam filter

Trade-offs: data, compute and explainability

Which approach to use when

What this means for your skills and career

Generative AI vs machine learning vs deep learning compared

Frequently asked questions

Related reading

Generative AI vs Machine Learning vs Deep Learning: How They Relate

Image
Arslan Ahmad
Machine learning is a part of AI, deep learning is a part of machine learning, and generative AI is a kind of model that today is mostly built with deep learning.
Image

The three nested circles

What is artificial intelligence?

What is machine learning?

What is deep learning?

What is generative AI?

Not all generative models are deep learning

One problem, four approaches: a spam filter

Trade-offs: data, compute and explainability

Which approach to use when

What this means for your skills and career

Generative AI vs machine learning vs deep learning compared

Frequently asked questions

Related reading

Artificial intelligence, machine learning, deep learning and generative AI are not four competing technologies. They are nested ideas. Artificial intelligence (AI) is the broadest field, machine learning is one way to build AI, and deep learning is one way to do machine learning. Generative AI describes what a model does rather than how it is built: it creates new content, such as text, images or code, and today almost all of it runs on deep learning.

That short answer settles most of the confusion, but it hides a few details that matter when you choose a tool or read a job description. Some AI involves no learning at all. Some generative models are not deep learning. And the newest approach is not always the best one, because each step inward on the map costs more data, more computing power and more effort to explain.

This article explains each term in plain language, shows how they fit together, solves one problem four different ways, and ends with a table and a short guide to choosing between them.

The three nested circles

The simplest way to picture the relationship is three circles, one inside the other.

Three nested circles: artificial intelligence contains machine learning, which contains deep learning. Generative AI overlaps mostly with deep learning and partly with classic machine learning.

  • Artificial intelligence is the outer circle. It covers any computer system that performs a task we would normally say requires intelligence, such as recognizing speech, planning a route or playing chess.
  • Machine learning is the middle circle. It covers AI systems that learn their behavior from examples instead of following rules a person wrote by hand.
  • Deep learning is the inner circle. It covers machine learning systems built from neural networks with many layers.

Generative AI does not form a fourth circle inside deep learning. It cuts across the map, because "generative" describes the job a model does, not the technique used to build it. Most generative systems in use today, such as chat assistants and image generators, sit inside the deep learning circle. A few older and simpler generative models sit in the machine learning circle but outside deep learning. Keeping that distinction in mind prevents the most common mistake, which is treating "AI" and "generative AI" as the same thing.

What is artificial intelligence?

Artificial intelligence is the field of building computer systems that perform tasks associated with human intelligence. The definition is about the task, not the method. A chess program that searches millions of possible moves is AI. So is a voice assistant, a route planner, and a fraud detector.

There are two broad ways to build an AI system:

  • Write the rules by hand. An engineer studies the problem and encodes the logic directly. One such rule might flag any transaction over $5,000 when the same card was used in two countries within one hour. Systems built this way are called rule-based systems, and older large examples are called expert systems.
  • Let the system learn the rules from data. The engineer provides many examples, and an algorithm finds the patterns. This is machine learning.

Rule-based AI is still common and still useful. Tax software, game opponents and many business workflows run on explicit rules, because the rules are known, stable and must be auditable. The weakness of hand-written rules appears when the patterns are too many, too subtle or change too often for a person to write down. Nobody can write a complete rule set for recognizing a cat in a photo, which is why the field moved toward learning.

What is machine learning?

Machine learning is a way of building AI in which a program improves at a task by studying examples rather than by being told the rules. The program has adjustable numbers inside it (parameters), and training is the process of setting those numbers so the program's outputs match the examples as closely as possible. The trained result is called a model.

Machine learning has three main styles, which differ in the kind of feedback the model receives.

  • Supervised learning. Every training example comes with the correct answer (a label). A model sees thousands of house listings with their sale prices and learns to predict the price of a new listing. Most business machine learning is supervised, because companies already hold labeled history such as past sales, past fraud cases and past support tickets.
  • Unsupervised learning. The examples have no labels, and the model finds structure on its own. A retailer can group its customers into segments by purchase behavior without telling the model what the segments should be. This grouping task is called clustering.
  • Reinforcement learning. The model, called an agent here, takes actions in an environment and receives a reward or penalty after each one. Over many attempts it learns which actions lead to the highest total reward. Game-playing systems and some robotics controllers learn this way.

Classic machine learning, meaning machine learning without deep neural networks, usually depends on features. A feature is a measurable property of the input that a person chooses and computes, such as "number of rooms" or "distance to the nearest school." Choosing good features (feature engineering) often decides whether the model works. Algorithms in this group include linear regression, logistic regression, decision trees and gradient-boosted trees. These methods train quickly, run on ordinary computers and remain the strongest choice for many problems involving tables of numbers.

What is deep learning?

Deep learning is machine learning that uses neural networks with many layers. A neural network is a model made of simple connected units arranged in layers. Each unit takes numbers in, multiplies them by learned weights, adds them up and passes the result forward. One layer is not very powerful, but many layers stacked together can represent extremely complex patterns. The word "deep" refers to that number of layers, which ranges from a handful to more than a hundred.

The important change is not the layer count itself. It is what the layers allow. In classic machine learning, a person decides which features matter. In deep learning, the early layers learn features directly from raw data. In an image model, the first layers learn to detect edges, the next layers combine edges into textures and shapes, and later layers combine shapes into objects such as eyes, wheels or letters. Nobody writes an edge detector by hand. The network discovers it because edges help it reduce its errors.

This ability is why deep learning took over tasks with raw, unstructured inputs: images, audio and text. A well-known turning point came in the ImageNet image recognition competition. A deep convolutional network called AlexNet reached a top-5 error rate of 15.3 percent, against 26.2 percent for the second-best entry, according to the original AlexNet paper. Top-5 error means the share of test images where the correct label is missing from the model's five best guesses. Within a few years, deep networks were the standard approach for vision, speech recognition and translation.

Deep learning has costs. It needs much more data than classic methods, often millions of examples. It needs specialized hardware, usually graphics processors (GPUs), to train in reasonable time. And its internal reasoning is hard to inspect, because the learned features are spread across millions or billions of weights rather than written in named columns.

What is generative AI?

Generative AI is the group of AI systems that create new content, such as text, images, audio, video or code, that resembles the data they learned from. When you ask a chat assistant to draft an email, or ask an image model for a picture of a red bicycle on a beach, the output did not exist before. The model produced it.

To see what makes a model generative, it helps to compare two kinds of models:

  • A discriminative model learns to tell categories apart. Given an email, it outputs "spam" or "not spam." Given a photo, it outputs "cat" or "dog." It learns the boundary between classes and nothing more.
  • A generative model learns what the data itself looks like, well enough to produce new examples. Instead of deciding whether an email is spam, it can write a new email that reads like a real one.

In short, a discriminative model asks which label fits an input, while a generative model asks what a plausible input would look like. In probability terms, the generative model learns how likely each possible piece of content is, so it can sample new content from that distribution.

Modern generative AI is built almost entirely on deep learning. Large language models, which power chat assistants and coding tools, are deep neural networks called transformers that are trained to predict the next piece of text. Image generators are usually diffusion models, which learn to turn random noise step by step into a picture that matches a description. If you want to see how a language model turns a question into an answer, How Large Language Models Work: Tokens, Embeddings, Attention walks through each stage. For a wider introduction to what these systems can create and where they fail, see What Is Generative AI? How Models Create Text, Images and Code.

Not all generative models are deep learning

The claim "generative AI is a type of deep learning" is close, but not exact. Generative models existed long before deep networks, and some are still used.

  • Markov chains generate sequences by choosing each next item based only on the few items before it. A simple text generator can count which word tends to follow each pair of words in a book, then produce new sentences by sampling from those counts. The output is generative, but there is no neural network involved.
  • Gaussian mixture models describe data as a combination of a few bell-shaped clusters. Once fitted, they can produce new data points by first picking a cluster and then sampling a point near its center. They are a classic machine learning method, often taught alongside clustering.
  • Naive Bayes classifiers are technically generative models too, because they learn how likely each word is within each class. They are mostly used for classification, which shows that "generative" describes how a model learns, not only whether it produces text or pictures.

What changed is quality. These older models can generate simple sequences or data points, but they cannot write a coherent page of text or produce a realistic photograph. Deep networks made that possible, which is why "generative AI" in everyday use almost always means deep learning systems such as large language models and diffusion models.

One problem, four approaches: a spam filter

A spam filter is a good example because every approach on the map has been used for it. Each version below solves the same task: decide what to do with an incoming email.

The same spam problem solved four ways: hand-written rules, classic machine learning with chosen features, deep learning on raw text, and a generative model that drafts a reply.

Approach 1: hand-written rules (AI without learning). An engineer writes rules such as "if the subject contains 'FREE MONEY' or the sender's domain is on a block list, move the email to spam." This version is easy to understand and needs no training data. It fails as soon as spammers change their wording, because every new trick needs a new rule. Teams that rely on rules alone end up maintaining hundreds of them.

Approach 2: classic machine learning with hand-made features. The team collects, for illustration, 50,000 emails that users have already marked as spam or not spam. An engineer turns each email into features, such as the count of each word, the number of links, whether the sender is in the user's contacts, and the share of capital letters. A model such as logistic regression or naive Bayes learns how much weight to give each feature. This version adapts when the team retrains it on fresh labeled mail, trains in minutes on a laptop, and can show which features drove each decision. Its accuracy depends on the features a person thought to include.

Approach 3: deep learning on raw text. The team feeds the raw text of each email into a neural network, which learns its own internal representation of the words, their order and their meaning. It can catch spam that uses new wording, misspellings or images of text, because it learns patterns no one listed as a feature. In return, it needs far more labeled examples, often millions, and a GPU to train. It is also harder to explain why one particular email was flagged.

Approach 4: a generative model. A large language model can do something the first three cannot: write. It can read a message, decide whether it is a genuine customer question, and draft a reply for a person to review. The same model can also classify spam when asked, but that is an expensive way to answer a yes or no question. Each call to a large model costs far more computing power than a call to a small classifier, so most production systems keep a cheap classifier for filtering and use the generative model only for the tasks that need writing.

The lesson from the four versions is that each step inward adds capability and adds cost. The right answer depends on what the task needs.

Want to learn these foundations properly, from the ground up?

Grokking Modern AI Fundamentals explains machine learning, neural networks, transformers and generative models in plain language, with worked examples at every step.

Trade-offs: data, compute and explainability

Three costs change as you move from rules to classic machine learning to deep learning and generative models.

Data. Rule-based systems need no training data, only knowledge of the domain. Classic machine learning typically works with thousands to hundreds of thousands of labeled rows. Deep learning usually needs far more, often millions of examples, unless you start from a model that someone else already trained. Large generative models are trained on enormous text and image collections, which is why almost every team uses a pretrained model rather than training one from the beginning.

Compute. A logistic regression model can train in seconds on a laptop. A deep network for images or text may need hours or days on GPUs. Training a large language model needs thousands of GPUs running for weeks, a budget only a small number of organizations can afford. Running the model also costs money: every response from a large generative model takes far more computation than one prediction from a small classifier.

Explainability. A rule can be read directly. A classic model shows which features carried the most weight, so a bank can state that a loan was declined mainly because of the debt-to-income ratio. A deep network's reasons are spread across millions of weights, so explanations have to be approximated with separate tools. For generative models, the output itself can be wrong while sounding confident, so teams must test it carefully. LLM Evaluation: How to Test an LLM App Before It Ships covers how that testing works.

These costs explain why classic methods remain common. In regulated areas such as lending and insurance, a model that can be explained is often required, not just preferred.

Which approach to use when

Use the simplest approach that meets the need. In practice, that means working through the map from the outside in.

  • Use rules when the logic is known, stable and must be auditable line by line. Examples are tax calculations, eligibility checks and simple routing.
  • Use classic machine learning when your data is a table of numbers and categories, such as customer records, transactions or sensor readings. Gradient-boosted trees remain among the strongest methods for this kind of tabular data, they train quickly, and they can be explained.
  • Use deep learning when the input is raw and unstructured, such as images, audio or free text, and you have plenty of data or can start from a pretrained model.
  • Use generative AI when the task is to produce something: draft text, summarize documents, answer questions in natural language, write code or create images. Plan for testing and for cost, because outputs vary and every call is relatively expensive.

Many real systems combine several approaches. A support platform might use rules to route urgent tickets, a classic model to predict which customers will leave, a deep model to transcribe phone calls, and a large language model to draft replies. Knowing where each technique sits on the map helps you choose the right one for each part instead of using one tool everywhere.

What this means for your skills and career

The nested map also describes a sensible learning order.

  • Start with machine learning basics. Supervised learning, training and test data, overfitting (when a model memorizes its training data and performs poorly on new data) and evaluation metrics apply to every inner circle.
  • Then learn how neural networks train. Layers, weights, loss functions and gradient descent explain why deep models behave as they do.
  • Then learn transformers and generative models. Tokens, embeddings, attention and next-token prediction explain how large language models work and why they fail in the ways they do.

For most software engineers, the most valuable skill is not training models from the beginning. It is building reliable products on top of pretrained models: choosing the right model for a task, giving it the right context, testing its outputs, and controlling its cost. Interviews for these roles increasingly include AI system design questions, which test exactly that judgment. AI System Design Interview: The Complete Guide explains what those rounds cover.

Generative AI vs machine learning vs deep learning compared

Machine learning (classic)Deep learningGenerative AI
What it isModels that learn from examplesMachine learning with many-layer neural networksModels that create new content
Defined byThe methodThe methodThe task
Typical inputTables of chosen featuresRaw images, audio, textText, images, or other content
Typical outputA label or a numberA label, a number, or a representationNew text, images, audio, or code
Data neededThousands of rowsOften millions of examplesPretrained on huge collections
ComputeA laptopGPUsMany GPUs to train; costly to run
ExplainabilityFairly easyHardHard; outputs need testing
ExampleFraud scoring on transactionsImage recognitionA chat assistant drafting a reply

Frequently asked questions

Is generative AI a type of machine learning? Yes. Generative AI systems learn from data, so they fall inside machine learning. Most modern ones are also deep learning systems, such as large language models and diffusion models.

Is all generative AI deep learning? No. Older generative models, such as Markov chains and Gaussian mixture models, are not deep learning. They can generate simple sequences or data points. Generative AI in everyday use, such as chat assistants and image generators, is built on deep learning.

What is the difference between AI and machine learning? AI is the broad goal of making computers perform tasks that seem to need intelligence. Machine learning is one way to reach that goal, in which the system learns from examples. A rule-based system written entirely by hand is AI but not machine learning.

What is the difference between machine learning and deep learning? Deep learning is a part of machine learning that uses neural networks with many layers. Classic machine learning usually depends on features a person chooses, while deep learning learns its own features from raw data. Deep learning needs more data and computing power in return.

Is ChatGPT machine learning or deep learning? Both. ChatGPT is built on a large language model, which is a deep neural network called a transformer. Deep learning is a part of machine learning, so the system belongs to both groups, and it is also generative AI because it produces new text.

Should I learn machine learning before generative AI? For most people, yes. Ideas such as training data, overfitting and evaluation apply to every model, and they make generative models much easier to understand. Engineers who only build applications on top of existing models can start with generative AI, but the basics will still help them debug and test.

Which is better for tabular business data? Usually classic machine learning. Methods such as gradient-boosted trees train quickly, perform very well on tables of numbers and categories, and can be explained. Deep learning offers less advantage on this kind of data.

Ready to build a solid foundation in modern AI?

Grokking Modern AI Fundamentals takes you from the basics of machine learning through neural networks to large language models, so every new AI term has a clear place on the map.

AI

What our users say

Brandon Lyons

The famous "grokking the system design interview course" on http://designgurus.io is amazing. I used this for my MSFT interviews and I was told I nailed it.

Arijeet

Just completed the “Grokking the system design interview”. It's amazing and super informative. Have come across very few courses that are as good as this!

Eric

I've completed my first pass of "grokking the System Design Interview" and I can say this was an excellent use of money and time. I've grown as a developer and now know the secrets of how to build these really giant internet systems.

More From Designgurus
Annual Subscription
Get instant access to all current and upcoming courses for one year.

Access to 50+ courses

New content added monthly

Certificate of completion

$31.08

/month

Billed Annually

Recommended Course
Grokking Prompt Engineering for Professional Portfolio and Job Search

Grokking Prompt Engineering for Professional Portfolio and Job Search

679+ students

4.2

Elevate your career with Grokking Prompt Engineering for Professional Portfolio and Job Search - the ultimate AI-powered guide for crafting a standout portfolio, polishing resumes and cover letters, and nailing interviews in today’s competitive job market.

View Course
Join our Newsletter

Get the latest system design articles and interview tips delivered to your inbox.

Read More

Design an AI Agent: The 7-Layer Blueprint

Arslan Ahmad

Arslan Ahmad

AI Company Interview Process: How ElevenLabs, Decagon, Together AI, Linear, and Vercel Hire

Arslan Ahmad

Arslan Ahmad

Designing LLM Inference Systems: Batching, Memory, and GPUs

Arslan Ahmad

Arslan Ahmad

Single-Agent vs Multi-Agent Systems: When Splitting the Work Is Worth It

Arslan Ahmad

Arslan Ahmad

Design Gurus logo
One-Stop Portal For Tech Interviews.
About Us
Our Team
Careers
Partners
Contact Us
Become Affiliate
Copyright © 2026 Design Gurus, LLC. All rights reserved.