AI Basics

How AI, Machine Learning and Deep Learning Relate to Each Other

See how artificial intelligence, machine learning and deep learning nest inside one another, with plain examples of each.

Key takeaways

  • AI is the broad field, machine learning is the part that learns from data, and deep learning is the part of machine learning built on many-layered neural networks.
  • In traditional programming a person writes the rules, while in machine learning a training process derives them from examples.
  • Deep learning drives much recent progress with images, speech and language, but simpler methods are often better for tidy table data.
  • Generative AI and large language models sit mostly inside deep learning.

The three terms nest inside one another. Artificial intelligence is the broadest: any technique that lets software do tasks we associate with intelligence. Machine learning is one part of AI, in which the software learns its behavior from data. Deep learning is one part of machine learning that uses neural networks with many layers.

So every deep learning system is a machine learning system, and every machine learning system counts as AI in the usual sense. The reverse does not hold. Some AI involves no learning at all, and much machine learning uses nothing deep. Once you see the nesting, a lot of confusing talk sorts itself out.

Picture the nesting

Imagine three boxes, one inside the next. The outer box holds everything called AI. The box inside it holds methods that learn. The innermost box holds one powerful family of learning methods. Generative systems, such as chatbots and image makers, live mostly in a corner of that innermost box.

From the broadest term to the narrowest
Artificial intelligence Any method for tasks that seem to need intelligence, including hand-written rules. Machine learning Behavior derived from examples or experience. Deep learning Learning with neural networks of many layers. Large language models Deep networks trained on huge amounts of text. Artificial intelligence Any method for tasks that seem to need intelligence, including hand-written rules. Machine learning Behavior derived from examples or experience. Deep learning Learning with neural networks of many layers. Large language models Deep networks trained on huge amounts of text.

The layers describe methods, so they say nothing about quality. A system in the inner box is not automatically smarter or safer than one in the outer box.

AI without learning

Before learning methods took over, much AI worked from knowledge that people typed in. An expert system might hold hundreds of if-then rules gathered from specialists: if the engine cranks but does not start, and there is fuel, then check the ignition. A program chains these rules together to reach advice.

Search methods are another example. A route finder can explore possible paths through a road map and pick a short one, using clever ways to skip unpromising options. A classic chess program looked many moves ahead and scored positions with a formula that programmers designed.

These approaches have real virtues. You can read the rules, explain each decision and change one behavior without retraining anything. Their weakness shows up when the world is messy. Try writing rules that identify a cat in any photo, from any angle, in any light, and you will give up quickly.

Machine learning: rules from examples

Machine learning turns the usual recipe around. Instead of writing the rule, you collect examples and let a training procedure find a pattern that fits them. The result is called a model.

Say you want to estimate the selling price of used bicycles. You gather past sales with the age, type, condition and final price. A learning method adjusts the model's internal numbers until its estimates come close to the real prices. Then you give it a bicycle it has not seen, and it produces an estimate.

The model is only as good as what it learned from. If your records contain no electric bicycles, its guesses about them deserve little trust. Developers therefore set some examples aside and test the model on them, to check that it works beyond the data it was trained on. This ability is called generalization.

Common styles include learning from labeled examples, finding structure in unlabeled data and learning by trial and reward. The article on supervised, unsupervised and reinforcement learning explains each.

Many machine learning methods are not deep

It is easy to assume machine learning means giant neural networks. Plenty of dependable systems use much simpler methods.

Method The idea in words Typical use
Linear regression Fit a straight-line relationship between inputs and a number Estimating a price or demand
Decision tree Ask a sequence of yes-or-no questions learned from data Sorting cases into groups
Random forest Let many different trees vote or average Risk scoring on table data
Nearest neighbors Look up the most similar past examples Simple matching and recommendation

These models often train quickly on an ordinary computer, need less data and are easier to inspect. For information arranged in rows and columns, such as customer records, tree-based methods remain very competitive. A team that reaches for the largest tool first may spend more and understand less.

Deep learning: many layers

A neural network is a model made of simple connected units. Each unit combines numbers from earlier units and passes a result onward. The strengths of the connections, called weights, are what training adjusts. "Deep" means there are many layers of units between input and output.

The depth matters because layers can build on each other. In an image network, early layers often respond to edges and colors, middle layers to textures and parts, and later layers to whole objects. Nobody specifies these stages; they emerge during training. In older approaches, experts spent much effort designing such features by hand.

The name suggests a brain, and early researchers did take loose inspiration from neurons. Artificial networks differ greatly from biological ones, so treat the comparison as a nickname. The explanation of neural networks through everyday comparisons goes further.

Why deep learning took off

The core ideas are decades old. What changed, broadly from around the early 2010s, was that several things came together: very large collections of digital data, graphics processors well suited to the arithmetic, and better training techniques. A deep network's strong result in a well-known image recognition competition in 2012 is often cited as a turning point.

Since then deep learning has become the usual choice for images, audio and language. Those are domains where useful patterns are hard to describe by hand and examples are plentiful.

The costs are real. Training large networks takes substantial computing power and electricity. Their inner workings are hard to interpret, so explaining a particular output is difficult. They can also learn shortcuts: relying on a background detail that happened to match the answer in training and fails elsewhere.

Where generative AI and chatbots fit

Generative AI means systems that produce new content, such as text, images, audio or code. Today's well-known examples are built with deep learning. A large language model is a deep network trained to predict pieces of text, and a chatbot is a product built around such a model.

A single product often mixes all the layers. A customer service assistant might use a language model to understand and write messages, a simpler learned model to detect urgent cases and fixed rules that forbid refunds above a set amount without a manager. Calling the whole thing "deep learning" would hide the rules that protect the business.

Choosing among them

If you are weighing an approach, or a vendor is, these questions help:

  1. Can the correct behavior be written down completely? If so, plain rules may be best.
  2. Is there plenty of relevant example data with trustworthy answers? Without it, learning struggles.
  3. Is the input a table of facts, or raw images, sound or free text? Raw material favors deep learning.
  4. Must you explain each decision to the person affected? Simpler models make that easier.
  5. What does it cost to run and maintain?

For instance, calculating late fees needs rules. Predicting which invoices are likely to be paid late could suit a simple learned model. Reading handwritten notes on those invoices is a natural job for a deep network.

It is also reasonable to start simple and compare. A plain rule or a small model gives you a baseline, a result that anything larger has to beat on fresh examples. If a deep network is only slightly better and far harder to explain, the extra complexity may not be worth it.

Common mix-ups

People sometimes say "the AI learned" about a system that was entirely hand-coded. Others use "machine learning" and "AI" as exact synonyms, which erases the rule-based side. A third confusion is believing that more layers always help. Depth adds capacity, and capacity without enough good data can lead to a model that memorizes its examples and handles new cases badly.

Another is assuming a trained model keeps learning while you use it. Many models are frozen after training and change only when the developer updates them. The article on training and inference explains the split.

Common questions

Is data science the same as machine learning?

No. Data science is a wider practice of drawing knowledge from data, including collecting, cleaning, statistics and communication. Machine learning is one of its tools.

Is statistics part of machine learning?

They overlap heavily and share methods. Statistics tends to emphasize explaining relationships and measuring uncertainty, while machine learning tends to emphasize accurate predictions on new cases. The line is a matter of emphasis.

Do I need to know the math to use these systems?

No. To use them well you need to know what they learned from, how they were tested and where they fail. Building new ones is where the mathematics becomes necessary.

Written for 4ArtificialIntelligence with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 43 articles in AI Basics →

Latest news on this topic