How AI works

What's the difference between AI, machine learning and deep learning?

The three terms aren't rivals. Each one sits inside the one before, like boxes in boxes. Here's what each means, a real system for each, and a small spam filter you can work out by hand.

By the Toorova team · Published November 6, 2026 · 10 min read · How we write these

Short answer

Artificial intelligence is the broad goal of getting computers to do tasks that seem to need intelligence, by any method, including hand-written rules. Machine learning is one way to do AI: instead of writing the rules, you let the program work them out from examples. Deep learning is one kind of machine learning. It uses neural networks with several layers, which learn their own features from raw data like pixels or text. Each term sits inside the one before it.

How AI, machine learning and deep learning fit inside each other

AI, machine learning and deep learning are nested ideas, not competing technologies. Every deep learning system is a machine learning system, and every machine learning system is a kind of AI. The reverse doesn't hold. Plenty of AI involves no learning at all, and plenty of machine learning involves no deep networks.

Artificial intelligence (AI) is the oldest and broadest term. It goes back to a proposal dated August 31, 1955, in which John McCarthy, Marvin Minsky, Nathaniel Rochester and Claude Shannon asked for "a 2 month, 10 man study of artificial intelligence" the following summer. Their starting conjecture was that "every aspect of learning or any other feature of intelligence can in principle be so precisely described" that a machine could simulate it. That's a goal, and it says nothing about method. Google's machine learning glossary keeps it just as open today, defining AI as "a non-human program or model that can solve sophisticated tasks". Hand-written rules count. Search counts. Learning counts.

Machine learning (ML) is one way to build AI: instead of a person writing the rules, the program works them out from data. Carnegie Mellon's Tom Mitchell gives a precise version. A machine learns with respect to a task T, a performance measure P and a type of experience E "if the system reliably improves its performance P at task T, following experience E". In the same 2006 paper he draws the line with ordinary programming: computer science has mostly asked how to program computers by hand, while machine learning asks how to get computers to program themselves, from experience plus some initial structure.

Deep learning is one family of machine learning. It uses neural networks, math functions built from layers of small units that each multiply their inputs by adjustable numbers called weights and add the results up. "Deep" refers to how many layers are stacked between the input and the output. Google's glossary sets the bar low: a deep model is "a neural network containing more than one hidden layer", where a hidden layer is any layer between the input and the output. If you want to see the arithmetic inside one of those units, our explainer on what a neural network is works one out by hand.

Three nested boxes. The outer box is artificial intelligence, with a chess engine that searches as its example. Inside it is machine learning, with a spam filter that learns from labeled email. Inside that is deep learning, with an image model and a chatbot as examples.Artificial intelligenceany method: rules, search or learning · chess engineMachine learningrules learned from examples · spam filterDeep learningneural networks with several layersthat learn their own featuresimage model · chatbot
Each box sits inside the one around it. A chatbot is deep learning, which also makes it machine learning and AI. A classic chess engine is AI and nothing narrower.

AI without learning: how a classic chess engine plays

A chess engine is the clearest example of AI that doesn't learn. A classic engine does two jobs. It searches: it looks at the legal moves, the replies to each, the replies to those, and so on, building a tree of possible futures (with tricks to skip branches that can't change the answer). And it evaluates: at the end of each branch it scores the position with a formula, adding points for things like extra pieces and a safe king. Then it picks the move that leads to the best score, assuming the opponent also plays its best.

Nothing in that loop learns from data. The intelligence lives in the search and in a scoring formula that people wrote down. IBM's Deep Blue, which in May 1997 became the first computer system to defeat a reigning world chess champion, beat Garry Kasparov 3.5 to 2.5 in their rematch. It ran on 32 processors working in parallel and evaluated 200 million positions per second. IBM's own history of the machine credits brute-force computing power and an improved evaluation function, and doesn't describe it learning from games.

Stockfish, the open-source engine, used the same recipe. Its "classical" evaluation is handcrafted, a long scoring formula written by people. That makes it AI by any definition, and not machine learning, because people wrote every rule it scores with. Keep Stockfish in mind, because it comes back below. In 2020 it crossed the line.

Rule-based AI works well when the world is small and the rules are known. Chess has 64 squares and a rulebook that fits on a page. Most real problems aren't like that, and that's where learning comes in.

Machine learning: a spam filter that learns from examples, worked out

Take spam. You could try rules: if the subject says FREE, it's spam. Paul Graham tried exactly that before he wrote his August 2002 essay A Plan for Spam. He calls it the usual instinct, to write software that recognizes individual properties of spam, and reports that after about six months of it, catching the last few percent got very hard, while stricter rules started flagging real mail. Spammers change their wording faster than anyone can update a rulebook.

The machine learning version flips the job around. You don't write rules. You hand the program a pile of emails that people have already labeled spam or not spam, and it counts. Here's a toy version with made-up numbers, small enough to check on a napkin. Say you have 100 labeled emails: 40 spam and 60 legitimate ones (often called ham). The program counts how many of each contain two words.

WordSpam emails containing it (of 40)Ham emails containing it (of 60)
free24 (60%)3 (5%)
meeting2 (5%)18 (30%)

A new email arrives with the word "free" in it. How likely is it to be spam? Before reading it, the base rate says 40%, because 40 of the 100 emails were spam. Bayes' rule, a formula for updating a probability when new evidence comes in, combines that base rate with how often each kind of email contains the word:

P(spam | "free") = (0.40 × 0.60) ÷ (0.40 × 0.60 + 0.60 × 0.05) = 0.24 ÷ 0.27 ≈ 0.89

Seeing "free" moves the estimate from 40% to about 89%. Nobody wrote a rule saying "free" is suspicious. The counts said so.

Now suppose the email contains both "free" and "meeting". The simplest filters, called naive Bayes, multiply the word rates together as if the words had nothing to do with each other (that's the naive part):

spam score = 0.40 × 0.60 × 0.05 = 0.012
ham score = 0.60 × 0.05 × 0.30 = 0.009
P(spam) = 0.012 ÷ (0.012 + 0.009) ≈ 0.57

"Meeting" pulls the estimate back down to 57%, because it's six times more common in real mail than in spam. A real filter does this across thousands of words and far more email, and when spammers change their wording, it relearns from fresh labels. Graham's filter was built on word probabilities like these, though his formula differed in the details, and he reported that on his own mail it missed less than 5 per 1000 spams, with 0 false positives.

That's Mitchell's definition in action. The task T is sorting mail. The measure P is how many emails it sorts correctly. The experience E is the labeled emails. Give it more good labels and it gets better.

Notice what a person still decided, though: that the program should look at individual words. That choice is called feature engineering, which Google's glossary describes as "determining which features might be useful in training a model" and converting raw data into them. Deep learning is largely about handing that step to the machine too.

Deep learning: why an image model finds its own features

Words are a handy feature for email. Photos don't come with anything that convenient. A small color photo 224 pixels wide and 224 pixels tall is stored as 224 × 224 × 3 = 150,528 numbers: a red, a green and a blue brightness for every pixel. Try writing the rule that turns 150,528 numbers into "this is a cat". Look for whiskers? Which of the numbers are whiskers? That changes with the lighting, the angle, the breed and whatever's sitting in front of the cat.

Deep learning hands that problem to the network. A deep neural network takes the raw pixels as input, and each layer turns the previous layer's output into a new set of numbers. Training nudges every weight in every layer at once, so the final layer's answer gets closer to the right label. Nobody tells the middle layers what to measure. They settle on whatever helps. Stanford's CS231n course notes show what comes out of that in trained image networks: some neurons deep inside end up responsive to upper bodies, text, or specular highlights, and none of those were asked for. The features came from the data.

The example that made the field take notice is AlexNet, by Alex Krizhevsky, Ilya Sutskever and Geoffrey Hinton, published in 2012. It was a neural network with 60 million parameters (the adjustable weights), built from five convolutional layers, which slide small pattern detectors across the image, followed by fully connected layers. It learned from 1.3 million labeled photos to sort images into 1,000 classes. On the test set, the right answer was missing from its top five guesses only 18.9% of the time, which the authors described as considerably better than the previous state of the art.

That example also shows what deep learning costs. The toy spam filter above needed 100 emails and some counting. AlexNet needed over a million labeled photos and, in the paper's words, "a very efficient GPU implementation" to train in reasonable time. That's why deep learning took over problems where the input is raw and messy, like photos, sound and text, and nobody can write the features down. When a person can name the useful features, a simpler machine learning model may do the job with far less data.

AI vs machine learning vs deep learning, side by side

Here are the three approaches lined up, using the systems from this article. The first column means AI built from rules and search, with no learning, since the other two columns are also AI.

Rule-based AIClassic machine learningDeep learning
Where the behavior comes fromRules and search that people writePatterns learned from labeled examples, using features people chosePatterns and features both learned from raw data
Example hereDeep Blue, classic StockfishWord-counting spam filterAlexNet image classifier
Data it needsNone to get startedEnough labeled examples to count fromA lot: AlexNet trained on 1.3 million labeled photos
Can you see why it decided?Yes, trace the rulesUsually: you can see which words weighed mostHard: the reasoning is spread across millions of weights
What breaks itMore cases than anyone can write rules forFeatures that miss what actually mattersToo little data, or new data unlike the training data

Real systems mix all three

Stockfish shows how blurry the edges get in practice. In August 2020 its developers added a neural network evaluation called NNUE, explaining that it computes this value with a neural network based on basic inputs, where the value is the score for a position. In their tests it played more than 80 Elo points stronger, Elo being the rating scale chess uses to compare players. For a while the handcrafted evaluation stayed available as an option, but Stockfish 16.1, released in February 2024, removed the traditional handcrafted evaluation altogether. The search stayed. So today's Stockfish is search (rule-based AI) wrapped around a learned scoring function (machine learning, done with a neural network).

Chatbots sit firmly in the innermost box. A large language model is a deep neural network trained on huge amounts of text to predict the next word, which our explainer on how large language models work walks through. That makes it deep learning, and so also machine learning and AI. The app you chat with then adds ordinary hand-written software around the model, so even a chatbot is a mix.

Why marketing blurs AI, machine learning and deep learning

The terms get mixed up in ads and product pages for three reasons, and only one of them is dishonest.

The broad word is always technically true. Because the boxes nest, a product that uses a deep network can call itself AI, machine learning or deep learning, and none of the three is false. The widest, most familiar word usually wins.

Everyday meaning has drifted. To most people, "AI" now means chatbots and image generators, which are deep learning. But by the 1955 proposal's standard, and by Google's glossary, a few well-chosen if-then rules can count as AI too. So the same word can describe a model with billions of weights or a short script, and the label alone won't tell you which.

Sometimes the claim just isn't true. On March 18, 2024, the US Securities and Exchange Commission charged two investment advisers, Delphia and Global Predictions, with making false and misleading statements about their use of AI. Global Predictions had called itself the "first regulated AI financial advisor". The firms settled for $400,000 in combined penalties without admitting or denying the findings, and the SEC's chair called the practice "AI washing".

You can cut through a label with three questions. What does it learn from, if anything? Does it get better with more data, which is Mitchell's test for machine learning? And what kind of model is it, a set of rules, a classic statistical model or a neural network? A vendor that can't answer the first question probably isn't doing machine learning, whatever the box says.

Where beginners go wrong with AI, machine learning and deep learning

  • "AI and machine learning are the same thing." Machine learning is a part of AI. Google's glossary puts it formally: machine learning is a sub-field of artificial intelligence. Deep Blue is the counterexample to keep handy, a famous AI with no learning in IBM's account of it.
  • "Deep means it understands more deeply." "Deep" counts layers. By Google's definition, a network with two hidden layers already qualifies. It says nothing about understanding.
  • "Neural network and deep learning are synonyms." Close, but a network with a single hidden layer is a neural network that isn't deep. In everyday use people say "deep learning" for nearly all modern neural networks, because nearly all of them have many layers.
  • "Machine learning means it learns while I use it." Most models learn during a training phase, then get used with their weights frozen. A spam filter that improves over time is being retrained on new labels, which is a deliberate step someone set up. Our explainer on neural networks covers the difference between training and use.
  • "Deep learning replaced everything else." Even after Stockfish swapped its handcrafted scoring for a neural network, it still relies on hand-designed search to pick moves. When a person can name the features that matter, a simpler model trained on less data is often the more practical choice. The newest tool isn't automatically the right one.

Common questions

Is ChatGPT AI, machine learning or deep learning?

All three. ChatGPT runs on a large language model, which is a deep neural network trained on text. That makes it deep learning, and since deep learning is a kind of machine learning, and machine learning is a kind of AI, all three labels are correct.

Is machine learning part of AI?

Yes. Machine learning is one way of building AI, where the program learns its behavior from examples instead of following rules a person wrote. Google's machine learning glossary describes it formally as a sub-field of artificial intelligence.

Can you have AI without machine learning?

Yes. Rule-based systems and search programs are AI with no learning. A classic chess engine that searches possible moves and scores positions with a hand-written formula is a well-known example.

Is a neural network the same as deep learning?

Not exactly. A neural network counts as deep once it has more than one hidden layer, the layers between input and output. Almost every neural network in use today is deep, which is why people often use the two terms interchangeably.

Should I learn machine learning before deep learning?

It helps. Deep learning uses the same ideas as the rest of machine learning, such as training data, a measure of error, and testing on examples the model hasn't seen. Those are easier to grasp on a small model first.

Learn it properly

AI Literacy is the beginner path that starts from this question. Short lessons with exercises cover what AI is, the difference between hand-written rules and learning from examples, what's inside a trained model, and how one neuron and then layers of them work.

See AI Literacy in the Toorova catalog →

Sources

  1. A Proposal for the Dartmouth Summer Research Project on Artificial Intelligence (1955) · McCarthy, Minsky, Rochester and Shannon, hosted by Stanford University
  2. The Discipline of Machine Learning (CMU-ML-06-108) · Tom M. Mitchell, Carnegie Mellon University, 2006
  3. Machine Learning Glossary · Google for Developers
  4. Deep Blue · IBM History
  5. Introducing NNUE evaluation · Stockfish, 2020
  6. Stockfish 16.1 · Stockfish, 2024
  7. A Plan for Spam · Paul Graham, 2002
  8. ImageNet Classification with Deep Convolutional Neural Networks · Krizhevsky, Sutskever and Hinton, NeurIPS 2012
  9. CS231n: Visualizing what ConvNets learn · Stanford University
  10. SEC Charges Two Investment Advisers with Making False and Misleading Statements About Their Use of Artificial Intelligence · US Securities and Exchange Commission, 2024

Read next