Category leaders

Guide

What Is Machine Learning?

A plain-English guide to machine learning: what it is, how a model learns from data, the main types of learning, common algorithms, what deep learning is and how it differs from machine learning, everyday examples, where machine learning goes wrong, and how the field got here.

November 6, 2026 · Updated November 23, 2026 · The AI Rankings

Quick answer: Machine learning is the branch of artificial intelligence in which a computer learns how to do a task from examples, instead of following rules a programmer wrote by hand. You show a machine learning model thousands or millions of examples, such as emails labelled “spam” or “not spam”, and it adjusts its internal settings until it can make the right call on examples it has never seen. Deep learning is the most powerful kind of machine learning: it uses neural networks with many layers, and it is the technology behind ChatGPT, Claude, Gemini, image generators and modern speech recognition. The one caveat: a machine learning model only knows the patterns in its training data, so gaps or bias in the data become gaps or bias in the model.

This page is the explainer: what machine learning is, how it works, its main types, and how deep learning fits in. For the deep learning models behind today’s chatbots, see what is an LLM. For one-line definitions of everything else, see the AI glossary.


What is machine learning?

Machine learning (ML) is a way of building software that learns from data. Instead of writing step-by-step rules, developers give a program many examples and a goal, and the program adjusts itself until its outputs match the examples. The result, called a model, can then make predictions or decisions about new data it has never seen.

The difference from ordinary programming is the direction of travel:

Traditional programmingMachine learning
What the developer writesThe rulesA learning procedure and a goal
What goes inData plus rulesData plus the correct answers (or just data)
What comes outAnswersA model that has learned the rules
Works best whenThe rules are known and easy to write downThe rules are too complex or fuzzy to write down
ExampleCalculating tax from a fixed rate tableRecognising a cat in a photo

Nobody can write a complete set of rules for what a cat looks like from every angle, in every light, half hidden behind a sofa. A machine learning model shown enough labelled photos works it out for itself.

The term goes back to IBM researcher Arthur Samuel, whose paper “Some Studies in Machine Learning Using the Game of Checkers” was published in the IBM Journal in July 1959. Samuel’s program learned to play draughts better than Samuel himself, after what he describes as “8 or 10 hours of machine-playing time”. His idea is often paraphrased as giving computers the ability to learn without being explicitly programmed, and that is still the clearest one-line definition.

Machine learning vs AI vs deep learning vs generative AI

The four terms are nested, not interchangeable.

TermWhat it meansExample
Artificial intelligence (AI)The whole field of building systems that do tasks associated with human intelligenceChess engines, spam filters, self-driving systems, chatbots
Machine learningAI that learns its behaviour from data rather than hand-written rulesFraud detection, recommendation feeds, credit scoring
Deep learningMachine learning that uses neural networks with many layersFace unlock, speech-to-text, large language models
Generative AIAI, almost always deep learning, that creates new text, images, audio, video or codeChatGPT, Claude, image generators

All deep learning is machine learning, and all machine learning is AI. The reverse is not true: a rule-based expert system is AI but not machine learning, and a spam filter built on a simple statistical model is machine learning but not deep learning. For the AI that learns to act rather than predict, see what is agentic AI.


How does machine learning work?

A machine learning model learns by making a guess, measuring how wrong the guess is, and nudging its internal numbers to be a little less wrong next time, millions of times over.

Step by step: training a model

  1. Collect data. Gather examples of the task. For a house-price model, that is past sales with each home’s size, location, age and selling price.
  2. Choose features and labels. Features are the inputs the model looks at (size, location, age). The label is the answer it should learn to produce (the selling price).
  3. Split the data. Most of the data is used for training. A portion is held back as a test set the model never sees during training, so its accuracy can be measured honestly.
  4. Pick a model. Choose a type of model, from a simple linear regression to a deep neural network. Every model has adjustable internal numbers called parameters, which start out random or at zero.
  5. Train. The model predicts prices for the training examples, a loss function measures how far off it is, and an optimisation method, usually a version of gradient descent, adjusts the parameters to shrink that error. This loop repeats until accuracy stops improving.
  6. Evaluate. Run the trained model on the held-back test set. If it scores well on training data but badly on test data, it has memorised rather than learned.
  7. Deploy and monitor. Put the model to work on new data. Running a trained model to get an answer is called inference. Accuracy is watched over time, because the world changes and the data the model was trained on goes out of date.

Parameters, training and inference

Parameters are the numbers a model learns. A simple house-price model might have a dozen. AlexNet, the image model that won the ImageNet competition in 2012, had 60 million parameters and 650,000 neurons. The largest language models have hundreds of billions to trillions, as the LLM guide explains.

Training is the expensive, one-off stage where those parameters are learned. Inference is the cheap, repeated stage where the finished model is used. Every time you ask a chatbot a question or your phone recognises your face, that is inference, which the AI inference guide explains in full. When an AI company quotes a price per million tokens, it is charging for inference; best LLM APIs compares those prices.

Overfitting: memorising instead of learning

Overfitting is the most common way machine learning goes wrong. An overfit model has learned the quirks of its training data so closely that it fails on anything new, like a student who memorised last year’s exam answers. The fixes are more and more varied data, simpler models, and techniques that penalise a model for over-complicating itself. The held-back test set in step 3 exists to catch it.


Types of machine learning

There are four main ways a machine learning model can learn. The difference is what kind of feedback the model gets.

TypeWhat the model is givenWhat it learns to doEveryday examples
Supervised learningExamples with the correct answer attached (labels)Predict the answer for new examplesSpam filters, house-price estimates, medical-image screening
Unsupervised learningExamples with no answersFind structure or groups on its ownCustomer segmentation, anomaly and fraud detection
Reinforcement learningA goal, and rewards or penalties for its actionsChoose actions that earn the most rewardGame-playing systems, robot control, training reasoning models
Self-supervised learningRaw data, with part of it hiddenPredict the hidden part from the restPre-training large language models on next-token prediction

Supervised learning

Supervised learning is the most widely used type. The model learns from labelled examples, and there are two main kinds of task: classification, where the answer is a category (spam or not spam, fraudulent or legitimate), and regression, where the answer is a number (a price, a delivery time, a temperature). The catch is that labels cost money: someone has to mark up every example, which is why data annotation is a job in its own right.

Unsupervised learning

Unsupervised learning works on data with no labels. The model looks for patterns on its own, such as groups of customers who behave alike (clustering) or transactions that look nothing like the rest (anomaly detection). It is useful when you do not know in advance what you are looking for.

Reinforcement learning

Reinforcement learning trains a model by trial and error. The model, called an agent, takes actions in an environment and receives rewards or penalties, and over many attempts it learns which actions pay off. Google DeepMind’s AlphaGo, which combined learning from human expert games with reinforcement learning from games against itself, beat world champion Lee Sedol 4-1 at Go in March 2016. It is also used to build reasoning models: labs reward a language model for reaching correct answers on maths and coding problems, as the LLM guide describes.

Self-supervised learning

Self-supervised learning is how large language models learn most of what they know. The model hides part of its own data and learns to predict it, for example by predicting the next token of a sentence. Because the answer is already in the text, no human labelling is needed, which is what makes it possible to train on trillions of words. Self-supervised pre-training is usually followed by supervised fine-tuning and reinforcement learning.

Some systems mix types. Semi-supervised learning uses a small labelled dataset alongside a large unlabelled one, which cuts labelling costs.


Common machine learning algorithms

An algorithm is the method a model uses to learn. You do not need to know the maths to use machine learning, but the names come up constantly.

AlgorithmTypeHow it works, in one lineTypical use
Linear regressionSupervised (regression)Fits a straight line or plane through the dataPrice and demand forecasts
Logistic regressionSupervised (classification)Outputs the probability that something belongs to a classCredit risk, click prediction
Decision treeSupervisedSplits data with a series of yes/no questionsLoan approvals, triage rules
Random forest and gradient-boosted treesSupervisedCombine hundreds of decision trees and average or chain their answersFraud detection, tabular business data
k-nearest neighboursSupervisedLabels a new example by looking at the most similar known examplesSimple recommendations
Support vector machineSupervised (classification)Finds the boundary that best separates two classesText classification, older image tasks
k-means clusteringUnsupervisedGroups examples into k clusters around central pointsCustomer segmentation
Principal component analysisUnsupervisedCompresses many features into a few that keep most of the informationSimplifying data before modelling
Neural networkAnyLayers of connected units whose connection strengths are learnedImages, speech, language, generative AI

For spreadsheet-style business data, such as rows of customers or transactions, gradient-boosted trees are still a common first choice because they are fast, accurate and need far less data than deep learning. For images, audio and language, neural networks win.


What is deep learning?

Deep learning is machine learning that uses artificial neural networks with many layers. Each layer transforms its input slightly, and stacking many layers lets the network learn complex patterns, such as edges, then shapes, then faces, directly from raw data. “Deep” refers to the number of layers, not to any deeper understanding.

A neural network is made of simple units, loosely modelled on neurons, arranged in layers. Each unit takes numbers in, multiplies them by learned weights, adds them up and passes the result on. On its own, each unit does almost nothing. Millions or billions of them, with their weights tuned by training, can recognise speech or write an essay.

Deep networks are trained with backpropagation, a method that works out how much each weight contributed to the error and adjusts it accordingly. David Rumelhart, Geoffrey Hinton and Ronald Williams popularised it in a 1986 paper in Nature. It remains the core training method for neural networks today.

Why deep learning took over

Neural networks are decades old. They took off after 2012 because three things arrived together: very large labelled datasets, graphics processing units (GPUs) cheap enough to train on, and better training methods.

The turning point was AlexNet. In the 2012 ImageNet image-recognition competition, the deep network built by Alex Krizhevsky, Ilya Sutskever and Geoffrey Hinton at the University of Toronto achieved a top-5 error rate of 15.3%, against 26.2% for the second-best entry. The network was trained on 1.2 million labelled images over five to six days on two Nvidia GTX 580 GPUs. Within a few years, deep learning had become the standard approach for vision, speech and language.

Main types of deep learning model

ArchitectureBuilt forExamples
Convolutional neural network (CNN)Images and videoPhoto tagging, face unlock, medical-image analysis
Recurrent neural network (RNN) and LSTMSequences such as text and audioOlder speech recognition and translation systems, now largely replaced by transformers
TransformerLanguage, and increasingly images, audio and videoEvery major large language model, including the models behind ChatGPT, Claude and Gemini
Diffusion modelGenerating images, video and audioMost AI image and video generators

The transformer, introduced by Google researchers in June 2017, is the design behind the current wave of AI. It lets a model weigh every part of its input against every other part at once, which made it practical to train on trillions of words. The LLM guide explains how it works in detail.


Deep learning vs machine learning

Deep learning is a subset of machine learning, so the real comparison is between deep learning and “classical” machine learning: the regression, tree and clustering methods above.

Classical machine learningDeep learning
How it finds patternsPeople choose and engineer the features the model looks atThe network learns its own features from raw data
Data neededWorks with hundreds to thousands of examplesUsually needs tens of thousands to billions of examples
HardwareRuns on an ordinary computer’s CPUNeeds GPUs or other AI chips to train at scale
Training timeSeconds to hoursHours to months
Best atStructured, tabular data: spreadsheets, transactions, sensor readingsUnstructured data: images, audio, video, text
ExplainabilityOften easy to see why it made a decisionHard to explain; often called a black box
ExamplesCredit scoring, churn prediction, demand forecastingFace recognition, speech-to-text, chatbots, image generators

The practical rule: if your data fits in a spreadsheet and you have thousands of rows, classical machine learning is usually cheaper, faster and easier to explain. If your data is images, sound or language, or you want a model that generates content, deep learning is the tool.

The key difference is feature engineering. To build a classical model that spots damaged parts on a production line, an engineer might hand-design measurements such as edge sharpness and colour variation. A deep learning model is simply shown labelled photos and works out which visual patterns matter for itself. That is why deep learning scales so well, and also why it needs so much more data and computing power.


Machine learning examples in everyday life

Most people use machine learning dozens of times a day without noticing.

Where you meet itWhat the model doesType
Email inboxSorts spam and phishing from real mailSupervised classification
Streaming and shopping appsRecommends what to watch, listen to or buy nextSupervised and unsupervised
BankingFlags card payments that look fraudulentSupervised and anomaly detection
Phone camera and photo libraryUnlocks with your face, sharpens photos, groups pictures by personDeep learning (CNNs)
Voice assistants and dictationTurns speech into textDeep learning
MapsPredicts traffic and arrival timesSupervised regression
Translation appsTranslates text and speech between languagesDeep learning (transformers)
ChatbotsAnswers questions, writes and writes codeDeep learning (large language models)
SciencePredicts protein structures; AlphaFold’s Demis Hassabis and John Jumper shared half of the 2024 Nobel Prize in ChemistryDeep learning

At the frontier, machine learning is mostly an industry undertaking. Stanford’s 2026 AI Index found that industry produced over 90% of notable AI models released in 2025.

For the tools built on this technology, see best AI models, best AI chatbots and best AI for data analysis.


Where machine learning goes wrong

Machine learning is powerful, but its weaknesses all trace back to one fact: a model only knows what is in its data.


A short history of machine learning

YearMilestone
1958Frank Rosenblatt describes the perceptron, an early single-layer neural network
1959Arthur Samuel’s draughts-playing paper popularises the term “machine learning”
1982John Hopfield introduces the Hopfield network, a neural network that can store and reconstruct patterns
1986Rumelhart, Hinton and Williams publish their backpropagation paper in Nature
1990s–2000sClassical methods such as support vector machines and random forests dominate practical machine learning
2012AlexNet wins ImageNet by a wide margin
2016Google DeepMind’s AlphaGo beats Lee Sedol 4-1 at Go, using deep neural networks trained on human games and by self-play reinforcement learning
2017Google researchers publish the transformer, the architecture behind modern language models
2019Yoshua Bengio, Geoffrey Hinton and Yann LeCun receive the 2018 ACM Turing Award, announced in March 2019, for their work on deep neural networks
2022OpenAI launches ChatGPT, bringing deep learning-based generative AI to the mainstream
2024John Hopfield and Geoffrey Hinton win the Nobel Prize in Physics “for foundational discoveries and inventions that enable machine learning with artificial neural networks”

How to get started with machine learning

You can use machine learning without building it. Chatbots, photo apps and spreadsheet AI features are all machine learning under the hood, and most people never need to go further.

If you want to build models yourself, the usual path is:

  1. Learn Python. It is the dominant language for machine learning.
  2. Learn the basics of statistics and linear algebra. Enough to understand what a model is doing, not a maths degree.
  3. Start with classical machine learning using the open-source scikit-learn library on small, tabular datasets.
  4. Move to deep learning with PyTorch or TensorFlow, two widely used open-source deep learning frameworks.
  5. Build projects on real data. Public datasets and competitions are the standard way to practise.

For structured options, see best AI courses and AI certifications. For running open models on your own machine, see best local LLMs and best open-source LLMs. If you are thinking about it as a career, our machine learning jobs guide covers the roles and where they are advertised.


Frequently asked questions

What is machine learning in simple terms?

Machine learning is a way of teaching computers by example instead of by instructions. A machine learning model is shown many examples, such as photos labelled “cat” or “dog”, and adjusts itself until it gets them right, so it can then handle new examples it has never seen.

What is the difference between AI and machine learning?

AI is the whole field of building systems that do tasks associated with human intelligence. Machine learning is the most widely used approach within AI, in which the system learns from data rather than following hand-written rules. All machine learning is AI, but some AI, such as a rule-based expert system, is not machine learning.

What is deep learning?

Deep learning is a type of machine learning that uses artificial neural networks with many layers. The layers learn increasingly complex patterns directly from raw data such as images, audio or text. Deep learning powers face recognition, speech-to-text, image generators and chatbots such as ChatGPT, Claude and Gemini.

What is the difference between deep learning and machine learning?

Deep learning is a subset of machine learning. Classical machine learning relies on people choosing the features a model looks at and works well on smaller, spreadsheet-style datasets. Deep learning uses many-layered neural networks that learn their own features, needs far more data and computing power, and is much better at images, audio and language.

What are the main types of machine learning?

The main types are supervised learning, which learns from labelled examples; unsupervised learning, which finds patterns in unlabelled data; reinforcement learning, which learns from rewards and penalties; and self-supervised learning, which learns by predicting hidden parts of its own data and is how large language models are pre-trained.

What are examples of machine learning?

Common examples include email spam filters, film and product recommendations, card-fraud detection, face unlock on phones, speech-to-text, traffic predictions in map apps, translation apps and AI chatbots. Google DeepMind’s AlphaFold protein-structure model, whose developers Demis Hassabis and John Jumper shared half of the 2024 Nobel Prize in Chemistry, is a scientific example.

Is ChatGPT machine learning?

Yes. ChatGPT is built on large language models, which are deep learning models, and deep learning is a type of machine learning. The models were pre-trained with self-supervised learning on large amounts of text, then refined with supervised fine-tuning and reinforcement learning.

Who invented machine learning?

No single person invented it. Arthur Samuel of IBM popularised the term in a 1959 paper on a draughts-playing program that learned to play better than he could. Frank Rosenblatt’s 1958 perceptron was an early neural network, and Geoffrey Hinton, Yoshua Bengio and Yann LeCun shared the 2018 Turing Award for the deep learning methods behind modern AI.

Does machine learning need a lot of data?

It depends on the model. Classical machine learning methods can work well with a few hundred to a few thousand examples. Deep learning usually needs far more: AlexNet was trained on 1.2 million labelled images in 2012, and today’s large language models are trained on trillions of tokens of text.

Is machine learning hard to learn?

Using machine learning tools is easy; building models takes some study. Most people start with Python, basic statistics and the scikit-learn library, then move to deep learning frameworks such as PyTorch.

What is a machine learning model?

A machine learning model is the trained result of the learning process: a mathematical function whose internal numbers, called parameters, were set by training on data. You give the model an input, such as a photo or a sentence, and it returns an output, such as a label, a number or generated text.

← All guides