Modern AI Engineering

Machine Learning vs Deep Learning vs Generative AI Explained

By Modern AI Engineering · · 7 min read

The three terms are not rivals. They sit inside each other. Artificial intelligence is the widest term: any system that does a task we associate with intelligence. Machine learning is the part of AI where the system learns from data instead of following hand-written rules. Deep learning is the part of machine learning that uses neural networks with many layers. Generative AI is a use of deep learning where the model creates new content such as text, images, audio or code.

So every generative AI model is a deep learning model, and every deep learning model is a machine learning model. The reverse is not true.

What is machine learning?

In ordinary programming, a person writes the rules. In machine learning, a person provides examples and the computer finds the rules. You show a model many emails marked spam or not spam, and it learns a pattern that separates them.

There are a few ways a model can learn. In supervised learning every example comes with the right answer. In unsupervised learning there are no answers, and the model looks for structure, such as groups of similar customers. In reinforcement learning an agent tries actions and learns from rewards.

Classic machine learning works well on data that fits in a table: rows of customers, columns of facts about them. Linear regression predicts a number, such as a price. Logistic regression predicts a category, such as will this loan be repaid. These models are quick to train, cheap to run and easy to explain.

What is deep learning?

Deep learning is machine learning with neural networks that have many layers. A neural network is a stack of simple units. Each unit multiplies its inputs by weights, adds a bias and passes the result on. One unit can do very little. Many layers of them can represent very complicated patterns.

The key difference from classic machine learning is who designs the features. In classic machine learning a person decides what the model looks at, for example the number of links in an email. This is called feature engineering. A deep network learns its own features from raw data. Early layers pick up simple patterns and later layers combine them into richer ones.

That is why deep learning took over tasks with raw, unstructured input: images, sound and language. The cost is that it needs more data and more computing power, and it is harder to explain why the model gave a particular answer.

What is generative AI?

Most earlier models were built to judge an input. Is this email spam? Is there a cat in this photo? What will the price be? Generative AI is built to produce something new: a paragraph, a picture, a piece of code.

A large language model does this by predicting the next token, again and again. Given the text so far, it gives a probability to every possible next piece of text, picks one, adds it and repeats. Image models often use a different method called diffusion, which starts from noise and removes it step by step until a picture appears.

Generative AI is defined by what it outputs, not by a separate kind of math. Underneath it is deep learning, and today most of it is built on one architecture, the Transformer.

Machine learning vs deep learning vs generative AI: comparison table

The table compares the typical case for each. There are exceptions in every row.

Machine learningDeep learningGenerative AI
Main ideaLearn patterns from dataLearn with many-layer neural networksCreate new content
Typical inputTables of numbers and categoriesImages, audio, textA prompt
Typical outputA number or a labelA label, a score or a vectorText, images, audio, code
FeaturesDesigned by peopleLearned by the networkLearned by the network
Data neededCan work with littleUsually a lotVery large for training, little to use
ExamplePredicting house pricesRecognising objects in photosA chat assistant

When should you use which?

Newer is not always better. Pick the simplest tool that solves the problem.

  • Use classic machine learning when your data is a table and you need a prediction you can explain, such as a risk score or a demand forecast.
  • Use deep learning when the input is raw, such as images, speech or long text, and you have enough examples to train or fine-tune a network.
  • Use generative AI when the output must be language or other content, or when the task is open-ended and hard to describe with labels: summarising, drafting, answering questions, writing code.
  • Combine them when it helps. A product can use an LLM to talk to the user and a small classic model to score a transaction.

Common confusions cleared up

Is ChatGPT machine learning or deep learning? Both, and generative AI as well. It is a generative model, built with deep learning, which is a kind of machine learning.

Is deep learning always better than machine learning? No. On small tables of data a simple model often does as well and costs far less to run and maintain.

Is generative AI the same as an LLM? An LLM is one kind of generative model, the kind that produces text. Image, audio and video generators are generative AI too.

Is AI the same as machine learning? No. AI is the wider goal. Machine learning is the most successful way of reaching it so far. Older AI systems used hand-written rules with no learning at all.

Which one should you learn first?

Learn them in the order they are nested. Machine learning first, because it gives you the ideas everything else uses: training data, loss, overfitting, evaluation. Deep learning second, because it explains how a neural network learns through gradient descent and backpropagation. Generative AI third, because by then the Transformer and next-token prediction will make sense.

The AI Engineering Bootcamp follows this order. Module 2 covers machine learning, Module 3 covers neural networks, and Module 4 opens with a lesson on what generative AI is before going inside the Transformer.

Frequently asked questions

Is deep learning a part of machine learning?

Yes. Deep learning is the branch of machine learning that uses neural networks with many layers. All deep learning is machine learning, but not all machine learning is deep learning.

Is generative AI a type of deep learning?

Yes. Modern generative models, including large language models and image generators, are deep neural networks. Generative AI describes what the model produces, not a separate technique.

Do I need machine learning to learn generative AI?

You need the basics. Ideas such as training, loss and overfitting come from machine learning, and generative models rely on them. A few weeks of foundations is enough to start.

What is the difference between AI and generative AI?

AI is the whole field of systems that perform intelligent tasks. Generative AI is the part of it that creates new content such as text, images or code.

Learn it properly: the AI Engineering Bootcamp

More articles