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.
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 programming | Machine learning | |
|---|---|---|
| What the developer writes | The rules | A learning procedure and a goal |
| What goes in | Data plus rules | Data plus the correct answers (or just data) |
| What comes out | Answers | A model that has learned the rules |
| Works best when | The rules are known and easy to write down | The rules are too complex or fuzzy to write down |
| Example | Calculating tax from a fixed rate table | Recognising 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.
| Term | What it means | Example |
|---|---|---|
| Artificial intelligence (AI) | The whole field of building systems that do tasks associated with human intelligence | Chess engines, spam filters, self-driving systems, chatbots |
| Machine learning | AI that learns its behaviour from data rather than hand-written rules | Fraud detection, recommendation feeds, credit scoring |
| Deep learning | Machine learning that uses neural networks with many layers | Face unlock, speech-to-text, large language models |
| Generative AI | AI, almost always deep learning, that creates new text, images, audio, video or code | ChatGPT, 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
- 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.
- 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).
- 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.
- 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.
- 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.
- 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.
- 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.
| Type | What the model is given | What it learns to do | Everyday examples |
|---|---|---|---|
| Supervised learning | Examples with the correct answer attached (labels) | Predict the answer for new examples | Spam filters, house-price estimates, medical-image screening |
| Unsupervised learning | Examples with no answers | Find structure or groups on its own | Customer segmentation, anomaly and fraud detection |
| Reinforcement learning | A goal, and rewards or penalties for its actions | Choose actions that earn the most reward | Game-playing systems, robot control, training reasoning models |
| Self-supervised learning | Raw data, with part of it hidden | Predict the hidden part from the rest | Pre-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.
| Algorithm | Type | How it works, in one line | Typical use |
|---|---|---|---|
| Linear regression | Supervised (regression) | Fits a straight line or plane through the data | Price and demand forecasts |
| Logistic regression | Supervised (classification) | Outputs the probability that something belongs to a class | Credit risk, click prediction |
| Decision tree | Supervised | Splits data with a series of yes/no questions | Loan approvals, triage rules |
| Random forest and gradient-boosted trees | Supervised | Combine hundreds of decision trees and average or chain their answers | Fraud detection, tabular business data |
| k-nearest neighbours | Supervised | Labels a new example by looking at the most similar known examples | Simple recommendations |
| Support vector machine | Supervised (classification) | Finds the boundary that best separates two classes | Text classification, older image tasks |
| k-means clustering | Unsupervised | Groups examples into k clusters around central points | Customer segmentation |
| Principal component analysis | Unsupervised | Compresses many features into a few that keep most of the information | Simplifying data before modelling |
| Neural network | Any | Layers of connected units whose connection strengths are learned | Images, 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
| Architecture | Built for | Examples |
|---|---|---|
| Convolutional neural network (CNN) | Images and video | Photo tagging, face unlock, medical-image analysis |
| Recurrent neural network (RNN) and LSTM | Sequences such as text and audio | Older speech recognition and translation systems, now largely replaced by transformers |
| Transformer | Language, and increasingly images, audio and video | Every major large language model, including the models behind ChatGPT, Claude and Gemini |
| Diffusion model | Generating images, video and audio | Most 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 learning | Deep learning | |
|---|---|---|
| How it finds patterns | People choose and engineer the features the model looks at | The network learns its own features from raw data |
| Data needed | Works with hundreds to thousands of examples | Usually needs tens of thousands to billions of examples |
| Hardware | Runs on an ordinary computer’s CPU | Needs GPUs or other AI chips to train at scale |
| Training time | Seconds to hours | Hours to months |
| Best at | Structured, tabular data: spreadsheets, transactions, sensor readings | Unstructured data: images, audio, video, text |
| Explainability | Often easy to see why it made a decision | Hard to explain; often called a black box |
| Examples | Credit scoring, churn prediction, demand forecasting | Face 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 it | What the model does | Type |
|---|---|---|
| Email inbox | Sorts spam and phishing from real mail | Supervised classification |
| Streaming and shopping apps | Recommends what to watch, listen to or buy next | Supervised and unsupervised |
| Banking | Flags card payments that look fraudulent | Supervised and anomaly detection |
| Phone camera and photo library | Unlocks with your face, sharpens photos, groups pictures by person | Deep learning (CNNs) |
| Voice assistants and dictation | Turns speech into text | Deep learning |
| Maps | Predicts traffic and arrival times | Supervised regression |
| Translation apps | Translates text and speech between languages | Deep learning (transformers) |
| Chatbots | Answers questions, writes and writes code | Deep learning (large language models) |
| Science | Predicts protein structures; AlphaFold’s Demis Hassabis and John Jumper shared half of the 2024 Nobel Prize in Chemistry | Deep 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.
- Biased data, biased model. If historical data reflects unfair decisions, a model trained on it learns to repeat them. A hiring model trained on past hires can learn to favour the kinds of people who were hired before.
- Data drift. The world changes after a model is trained. A fraud model trained before a new scam appears will not recognise it, which is why deployed models are monitored and retrained.
- Overfitting. As above, a model can memorise its training data and fail on new cases.
- The black-box problem. Deep learning models with millions or billions of parameters are hard to explain, which matters in lending, healthcare and law, where people are entitled to know why a decision was made.
- Confident errors. A model always produces an answer, even on inputs unlike anything it has seen. Large language models are the most visible case: they can state wrong facts fluently, which our AI hallucinations guide covers.
- Data and compute costs. Deep learning needs large datasets and expensive chips. That is a big part of why frontier AI is concentrated in a handful of well-funded companies.
A short history of machine learning
| Year | Milestone |
|---|---|
| 1958 | Frank Rosenblatt describes the perceptron, an early single-layer neural network |
| 1959 | Arthur Samuel’s draughts-playing paper popularises the term “machine learning” |
| 1982 | John Hopfield introduces the Hopfield network, a neural network that can store and reconstruct patterns |
| 1986 | Rumelhart, Hinton and Williams publish their backpropagation paper in Nature |
| 1990s–2000s | Classical methods such as support vector machines and random forests dominate practical machine learning |
| 2012 | AlexNet wins ImageNet by a wide margin |
| 2016 | Google DeepMind’s AlphaGo beats Lee Sedol 4-1 at Go, using deep neural networks trained on human games and by self-play reinforcement learning |
| 2017 | Google researchers publish the transformer, the architecture behind modern language models |
| 2019 | Yoshua Bengio, Geoffrey Hinton and Yann LeCun receive the 2018 ACM Turing Award, announced in March 2019, for their work on deep neural networks |
| 2022 | OpenAI launches ChatGPT, bringing deep learning-based generative AI to the mainstream |
| 2024 | John 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:
- Learn Python. It is the dominant language for machine learning.
- Learn the basics of statistics and linear algebra. Enough to understand what a model is doing, not a maths degree.
- Start with classical machine learning using the open-source scikit-learn library on small, tabular datasets.
- Move to deep learning with PyTorch or TensorFlow, two widely used open-source deep learning frameworks.
- 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.