What Is Machine Learning?
Machine learning is a way of building computer systems that learn from examples instead of following rules a programmer writes by hand. The system is shown large amounts of data, finds patterns that connect inputs to outcomes, and uses those patterns to make predictions about new information it has not seen before. Most of the AI people use today, from spam filters to chatbots, is built with machine learning.
Rules vs examples: the core idea
Traditional programming means writing explicit instructions. To build a spam filter this way, a programmer has to decide what spam looks like and write rules for it: block emails containing certain phrases, block certain senders, and so on. Every new trick spammers use requires a new rule.
Machine learning flips the process. Instead of writing the rules, you collect thousands of emails that people have already marked as spam or not spam. A learning algorithm studies those examples and works out the patterns that separate the two groups, including patterns no person thought to write down. IBM summarizes the difference this way: rules-based AI requires someone to manually devise criteria for spam, while machine learning requires an appropriate algorithm and an adequate dataset.
The result of that learning is a model: a piece of software that takes new input, such as an email that just arrived, and produces a prediction, such as "probably spam."
The term is usually credited to IBM researcher Arthur Samuel, whose 1959 paper described a checkers program that improved by playing. A widely used later definition comes from computer scientist Tom Mitchell's 1997 textbook: a program learns if its performance at a task improves with experience.
How machine learning works, step by step
Here is how a machine learning system can learn to estimate house prices. Many models, including neural networks, are trained this way. Other methods, such as decision trees, build their patterns differently, but the overall cycle of collecting data, training, testing and putting the model to work is the same.
- Collect examples. Gather records of past home sales. Each record includes details about the house, such as size, number of bedrooms and neighborhood, plus the price it sold for. The details are called features. The known answer, the sale price, is called a label.
- Start with a model that knows nothing. The model contains many adjustable internal numbers, called parameters. At first they are set more or less at random, so its price guesses are poor.
- Make a guess and measure the error. The model looks at one house's features and predicts a price. That prediction is compared with the real sale price. The size of the mistake is measured with a scoring formula called a loss function.
- Adjust to reduce the error. The learning algorithm nudges the parameters in the direction that would have made the guess a little more accurate.
- Repeat many times. Steps 3 and 4 run across thousands or millions of examples, often many passes over the whole dataset. Each small adjustment improves the model slightly. This whole process is called training.
- Test on new examples. Before trusting the model, it is checked against house sales it never saw during training. This shows whether it learned general patterns or simply memorized the training examples.
- Put it to work. The finished model estimates prices for houses currently on the market. Using a trained model to make predictions is called inference.
- Monitor and retrain. Housing markets change. A model trained on last year's prices can drift out of date, so it is checked over time and retrained on newer data.
What "learning" means here
In machine learning, learning means adjusting numbers until the model's outputs match the examples well. The model does not understand houses the way a real estate agent does. It has found statistical relationships, such as "larger homes in this area tend to sell for more," and encoded them in its parameters.
That is why the quality of the examples matters so much. The model can only learn patterns that exist in its data.
Why testing on unseen data matters
A model that performs perfectly on its training examples but poorly on new ones has memorized rather than learned. This problem is called overfitting. It is like a student who memorizes the answers to last year's exam and then struggles when the questions change. Testing on held-back data is how builders catch it.
The main types of machine learning
Machine learning approaches are usually grouped by the kind of examples they learn from.
| Type | What it learns from | Everyday example |
|---|---|---|
| Supervised learning | Examples paired with correct answers (labels) | Learning to flag spam from emails already marked spam or not spam |
| Unsupervised learning | Data with no answers provided, to find structure on its own | Grouping shoppers with similar buying habits |
| Reinforcement learning | Trial and error, with rewards for good outcomes | A program learning to win a game by playing it many times |
| Self-supervised learning | Answers hidden inside the data itself | A language model learning by predicting the next word in real text |
Supervised learning is widely used in business applications. The house price example above is supervised learning.
Unsupervised learning is useful when no one has labeled the data. It can reveal groupings or unusual patterns, such as transactions that look different from a customer's normal behavior.
Reinforcement learning trains a system through feedback on its actions. It is also used in a modified form to refine chat assistants, where human ratings of responses act as the feedback.
Self-supervised learning is how large language models are trained at scale. The text itself supplies the answers: the model reads a passage with the next word hidden and learns to predict it.
Examples of machine learning you already use
Machine learning runs quietly inside many everyday products:
- Email spam filtering. Google says Gmail blocks more than 99.9% of spam, phishing attempts and malware, and that its AI-enhanced spam filtering blocks nearly 10 million spam emails every minute.
- Streaming recommendations. Netflix says its recommendation system uses your viewing history and ratings, what members with similar tastes watch, and details about titles such as genre and actors.
- Arrival time estimates. DeepMind, now Google DeepMind, reported in 2020 that machine learning improved the accuracy of Google Maps' real-time arrival estimates by up to 50% in some cities.
- Fraud alerts. Card networks use machine learning to score transactions for fraud risk. Mastercard said in 2024 that new AI techniques improved its fraud detection rates by 20% on average in initial modeling.
- Face recognition on phones. Apple says Face ID uses its TrueDepth camera and machine learning.
- Chat assistants. Tools like ChatGPT are built on models trained with machine learning on very large amounts of text.
For a wider look at machine learning across industries, see What Is AI Used For?.
How machine learning relates to AI and deep learning
Artificial intelligence is the broad field of building systems that perform tasks associated with human intelligence. Machine learning is one way to build AI, and today it is the dominant one. As IBM puts it, all machine learning is AI, but not all AI is machine learning.
Deep learning is a type of machine learning that uses neural networks with many layers. It powers most recent breakthroughs, including image recognition, speech recognition and large language models.
For a full side-by-side comparison of all three terms, see AI vs Machine Learning vs Deep Learning. For how the layered networks behind deep learning work, see What Is a Neural Network?.
Why machine learning matters
Machine learning turns data into predictions, and predictions increasingly drive decisions: which loan applications get approved, which support tickets get escalated, which products get recommended and which transactions get blocked.
You do not need to build models to work well with them. When someone says a product "uses machine learning," these questions get to what matters:
- What data was it trained on? Its predictions reflect that data, including any gaps or unfair patterns in it.
- How was it tested? Was it checked on data that resembles your real situation?
- How accurate is it, and on what? A single accuracy number can hide weak performance for specific groups or cases.
- How often is it updated? Patterns change, and models can go stale.
- What happens when it is wrong? Is there human review for important decisions?
Limitations and common misconceptions
It learns patterns, not causes. A model may learn that two things tend to occur together without any understanding of why. That can lead to confident predictions that fall apart when circumstances change.
Biased data leads to biased results. If historical data reflects unfair decisions, a model trained on it can reproduce them. The LATHIC Glossary entry on bias explains how this happens.
It struggles with situations unlike its training data. A model trained on one city's housing market may perform poorly in another.
Its reasoning can be hard to explain. Complex models, especially deep learning models, can make accurate predictions without offering a clear, human-readable reason.
Misconception: "Machine learning systems keep learning from every use." Many deployed models are fixed after training. They change only when their developers retrain or update them.
Misconception: "Machine learning means the computer thinks like a person." Machine learning finds statistical patterns. It can be very capable at specific tasks without anything resembling human understanding.
Related AI terms
- Machine learning: the short LATHIC Glossary definition
- Model: the trained system that makes predictions
- Dataset: the collection of examples a model learns from
- Inference: using a trained model to make predictions
- Overfitting: when a model memorizes its training data instead of learning general patterns
Frequently Asked Questions
What is machine learning in simple terms?
Machine learning is teaching computers by example. Instead of giving a computer step-by-step rules, you show it many examples, and it works out the patterns on its own. It then applies what it found to new situations, such as deciding whether an email is spam.
What is the difference between AI and ML?
AI, or artificial intelligence, covers any computer system that performs tasks associated with human intelligence. ML, or machine learning, is one method for building AI, in which systems learn patterns from data. All machine learning is a form of AI, but some AI, such as systems built only from hand-written rules, does not use machine learning.
Is ChatGPT machine learning?
Yes. ChatGPT runs on large language models built with machine learning, specifically deep learning. OpenAI says its models are trained on large amounts of text and learn relationships between words, which they use to predict the next most likely word when generating a response. The models were then refined using additional training that includes feedback from people.
What is machine learning used for?
Machine learning is used to make predictions and spot patterns in data. Common uses include filtering spam, recommending products and shows, detecting fraudulent transactions, estimating travel times, recognizing faces and speech, translating languages, forecasting demand and powering chat assistants.
How does machine learning work?
A machine learning system is given many examples, makes predictions about them, measures how wrong those predictions are, and adjusts its internal settings to reduce the errors. After repeating this across large amounts of data, it is tested on new examples. If it performs well, it is put to work on real data.
Sources
- IBM Think, "What is Machine Learning?" https://www.ibm.com/think/topics/machine-learning
- IBM History, "The games that helped AI evolve." https://www.ibm.com/history/early-games
- Arthur L. Samuel, "Some Studies in Machine Learning Using the Game of Checkers," IBM Journal of Research and Development, 1959 (bibliographic record). https://ebiquity.umbc.edu/paper/html/id/1190/Some-Studies-in-Machine-Learning-Using-the-Game-of-Checkers
- Tom Mitchell, Machine Learning, McGraw Hill, 1997 (book page). https://www.cs.cmu.edu/~tom/mlbook.html
- Carnegie Mellon University Qatar, 10-315 Introduction to Machine Learning lecture slides (Mitchell definition). https://web2.qatar.cmu.edu/~gdicaro/10315-Fall19/lectures/315-F19-1-Introduction.pdf
- Google for Developers, Machine Learning Crash Course, "What is ML?" https://developers.google.com/machine-learning/intro-to-ml/what-is-ml
- NIST Computer Security Resource Center Glossary, "machine learning." https://csrc.nist.gov/glossary/term/machine_learning
- Google Safety Center, "Gmail." https://safety.google/gmail/
- Netflix Help Center, "How Netflix's Recommendations System Works." https://help.netflix.com/en/node/100639
- Google DeepMind, "Traffic prediction with advanced Graph Neural Networks," September 3, 2020. https://deepmind.google/discover/blog/traffic-prediction-with-advanced-graph-neural-networks/
- Mastercard, "Mastercard supercharges consumer protection with gen AI," February 1, 2024. https://www.mastercard.com/news/press/2024/february/mastercard-supercharges-consumer-protection-with-gen-ai/
- Apple Support, "About Face ID advanced technology." https://support.apple.com/en-us/102381
- OpenAI Help Center, "How ChatGPT and our foundation models are developed." https://help.openai.com/en/articles/7842364-how-chatgpt-and-our-foundation-models-are-developed
- Ouyang et al., "Training language models to follow instructions with human feedback," arXiv 2203.02155, March 2022. https://arxiv.org/abs/2203.02155