Machine learning is a way of building computer systems that learn patterns from examples rather than following rules written out by programmers. Instead of a person specifying every condition — “if an email contains these words, in this order, treat it as spam” — a machine learning system is shown many examples and adjusts itself until its outputs match the desired pattern closely enough to be useful on new examples it has never seen.
Almost every modern AI system you have heard of, including the large language models behind today’s AI assistants, is built with machine learning. It is less a single technology than the engine room underneath most of contemporary AI — the method by which systems acquire their capabilities. This article explains how that method works, in plain terms, and where its limits are. It sits under this pillar’s main guide, How Artificial Intelligence Works.
The core idea: rules learned, not rules written
Traditional software is explicit. A programmer writes instructions; the computer follows them exactly. This works well when the rules of a task are clear and stable — calculating a payroll deduction, sorting a spreadsheet.
Many valuable tasks have no writable rulebook. Nobody can write down the complete set of rules that distinguishes a photo of a cat from a photo of a dog, or a fraudulent transaction from an unusual-but-legitimate one. The patterns are real, but they are too numerous, subtle, and context-dependent to hand-code.
Machine learning inverts the process. You provide:
- Examples — data: emails, photos, transactions, recordings, text.
- A learning procedure — an algorithm that can adjust a model’s internal settings.
- A measure of success — some way of scoring whether the model’s output was right or wrong, better or worse.
The system then tunes itself against the examples, gradually reducing its errors. What it ends up with is a model: a mathematical structure whose settings encode the patterns it found. The programmer designed the learning process; the specific patterns came from the data. That is the sense in which the machine “learns,” and it is worth being precise about it — the model does not understand its subject the way a person does. It has fit a pattern, at scale, which is a narrower and more mechanical thing. (This description is itself a simplification, labeled as such: real systems involve substantial human design at every stage, from choosing data to setting objectives.)
Training vs. inference: the two phases
Machine learning systems live in two distinct phases, and confusing them causes real misunderstandings.
Training is the learning phase. The model processes its training data — potentially enormous quantities of it — and adjusts its internal settings in response to its errors. Training happens before the system is used, usually on powerful hardware, and it can take hours, days, or far longer for the largest models. Training is where the data shapes the behavior.
Inference is the using phase. A trained model, its settings now fixed, takes a new input — a photo it has never seen, a question it was never asked — and produces an output by applying the patterns it learned. When you ask an AI assistant a question, that is inference. The model is not, in that moment, learning from you; it is using what training built. (Some products add systems around the model that can store preferences or retrieve current information, but the base model’s settings do not change with each conversation.)
The practical consequence: a model’s behavior was largely decided before you ever met it, by the data it was trained on. Inference reveals the behavior; training created it.
The three main types of learning
Supervised learning: learning from labeled examples
In supervised learning, every training example comes with the correct answer attached — a label. Emails labeled “spam” or “not spam.” Medical images labeled with a diagnosis. Houses labeled with their eventual sale price. The system makes a prediction, compares it to the label, and corrects itself, millions of times, until its predictions on new, unlabeled examples are reliable.
Example: a spam filter trained on millions of labeled emails learns which combinations of words, senders, and structures tend to indicate spam — including patterns no human would think to write as a rule.
Unsupervised learning: finding structure without labels
In unsupervised learning, there are no correct answers provided. The system looks for structure in the data itself — grouping similar items together, or flagging items that do not fit any group.
Example: a retailer feeds in purchasing records with no labels attached, and the system groups customers into clusters — bargain hunters, bulk buyers, occasional gift purchasers — that the retailer did not define in advance but can now recognize and serve differently. Nobody told the system the groups existed; the structure was in the data.
Reinforcement learning: learning from consequences
In reinforcement learning, the system learns by acting and receiving feedback — rewards and penalties — over many attempts. It is not shown correct answers; it discovers, through trial and error at a scale no human could match, which actions lead to better outcomes.
Example: a system learning to play a board game by playing millions of games against itself, keeping the strategies that win. The same basic approach teaches warehouse robots to grasp objects and is used, in a form adapted for the purpose, to fine-tune AI assistants toward responses people rate as more helpful.
Why the data decides the behavior
Because the model is built from its training data, the data’s properties become the model’s properties. Three consequences follow.
More representative data usually means better generalization. A model trained on a narrow slice of the world performs well on that slice and poorly outside it. A face-recognition system trained mostly on one demographic will, predictably, be less accurate on others — not because anyone programmed bias in, but because the pattern it learned was drawn from an unrepresentative sample.
The model learns correlations, including misleading ones. Machine learning finds patterns that predict, not patterns that explain. A famous pattern in the research literature: a model learned to identify a type of military vehicle in photos partly by the time of day the photos were taken, because the two classes of photos happened to be shot in different light. The correlation was real in the data and useless in the world. Models do not know the difference unless the data or the evaluation forces the issue.
Garbage data produces garbage behavior. Errors, duplicates, outdated records, and mislabeled examples in training data become errors in the model’s outputs. This is not a defect of particular systems; it is the direct consequence of how learning works. The system has no source of truth other than what it was given. Which is also why corrupting the data is such an effective way to corrupt the system — deliberately feeding a model false examples, a practice called data poisoning, is a real and documented attack, covered in depth in this site’s information-integrity cluster. Honest data problems and deliberate ones produce the same kind of damage through the same door: the training set.
What machine learning cannot do
- It cannot exceed its data for long. A model can recombine patterns impressively, but it has no independent access to reality against which to check them.
- It does not know when it is out of its depth. A model will usually produce an output for an input far outside its training distribution with the same fluency as for a familiar one, unless separate safeguards are built around it.
- It does not pursue truth; it pursues its objective. The system optimizes the measure it was given. If that measure is a proxy — clicks, engagement, a test score — the model will find the shortest path to the proxy, which is not always the outcome anyone wanted.
- It changes behavior when retrained. New data, new model. The same product name can behave noticeably differently across versions, because the underlying pattern structure has been rebuilt.
Why this matters beyond the technology
For a business owner, the takeaway is concrete. The AI systems now answering questions about companies are machine learning systems: their behavior was shaped by data, and much of the data describing your business — your website, your listings, reviews, profiles, and what others publish about you — is part of the environment those systems learned from or draw on. You cannot reprogram the model. You can govern the quality of your own contribution to its data: accurate, consistent, current information, in places these systems read. That is a data-quality discipline, and machine learning is exactly why it matters.
Related reading
- How Artificial Intelligence Works — the pillar guide
- What Is Artificial Intelligence?
- What Is Generative AI?
- How Do AI Models Learn?
- Why Do AI Systems Sometimes Give Incorrect Answers?
Published: November 1, 2026
Last reviewed: November 1, 2026