Rules versus examples
Traditional software follows instructions a programmer wrote out in advance. If a customer’s balance is below zero, show a warning. If a password is shorter than eight characters, reject it. This works well when the rules are easy to state.
Some tasks resist that approach. Try writing exact rules for deciding whether an email is junk, or whether a photo contains a cat. Every rule you write has exceptions, and the exceptions have exceptions. Machine learning takes a different route. Instead of writing the rules, you collect many examples and let a program work out a pattern that fits them.
The basic ingredients
Most machine learning projects share a few parts.
- Data. A collection of examples. For a junk-mail filter, each example is an email, often paired with a label saying whether people considered it junk.
- Features. The pieces of information the program looks at, such as which words appear, who sent the message, or how many links it contains. In some modern systems the program works out useful features by itself from raw input.
- A model. A mathematical function with adjustable settings, often called parameters. Given an input, it produces an output, such as a score between 0 and 1.
- A training process. A method that adjusts the settings so the model’s outputs match the examples more closely.
The word “model” can be confusing. It is not a miniature copy of the world. It is closer to a formula with many dials, and training is the act of turning the dials.
How training works
Imagine a hypothetical model that guesses whether a house is expensive from its size. At first its settings are arbitrary, so its guesses are poor. The training process compares each guess with the known answer and measures the error. It then nudges the settings in the direction that reduces the error, and repeats this many times, often over the whole collection of examples more than once.
The idea is the same for far larger models: guess, measure the mistake, adjust, repeat. What changes is the size. A simple model might have a handful of settings, while the largest ones have billions. The structure behind many of the larger systems is a family called neural networks, built from layers of simple adjustable units.
Testing on examples the model has not seen
A model that does well on the examples it studied has not necessarily learned anything useful. It might have memorized them. So practitioners usually split their data into parts. The model learns from a training portion and is then checked on a separate test portion it never saw. If it performs well on both, that is encouraging. If it performs well on the first and poorly on the second, something has gone wrong, a problem usually called model overfitting.
Choosing how to measure success matters too. If only a small share of emails are junk, a filter that labels everything as fine would still look accurate in a simple count, while being useless. Careful teams look at several measures, and at which kinds of mistakes are costly.
Common kinds of learning
Machine learning is often grouped by what kind of feedback the program gets.
- Learning from labeled examples, where each example comes with the right answer. This is usually called supervised learning, in contrast to methods that work with unlabeled data.
- Finding structure without labels, such as grouping customers whose behavior looks similar.
- Learning from trial and feedback, where a program tries actions and receives rewards or penalties. This is often used for game-playing and some control problems.
Many real products combine these approaches.
Where you already meet it
Machine learning sits behind many ordinary tools. Search engines use it in parts of how they sort results. Phones use it to turn speech into text and to sort photos. Shops and video services use it to suggest what to look at next. Systems that read images are used in areas such as medical AI and self-driving technology, usually under close human oversight and testing. Newer generative AI tools also rest on machine learning, trained on very large collections of text or images.
What it cannot do
Machine learning finds patterns that were present in its data, and that has consequences.
- If the data is incomplete, outdated or skewed, the model inherits those flaws. This is one source of the unfairness known as algorithmic bias, and it is why data cleaning is a large part of real projects.
- A model can pick up on coincidences. A pattern that held in the examples may not hold in the world.
- It does not understand things the way a person does. A system that labels photos well may fail on a picture that looks a little different from anything it saw.
- Its answers are usually probabilities or best guesses, not guarantees.
None of this makes the technology useless. It means that the sensible question is rarely “is it intelligent?” and more often “what was it trained on, how was it tested, and what happens when it is wrong?” Those questions are also the core of judging AI claims in marketing, since a confident label says little about how a product was built or tested.
A short mental model
If you remember one thing, make it this: machine learning is pattern fitting guided by examples. The quality of the examples, the way success is measured, and the care taken in testing often matter more than the cleverness of the mathematics. With that in mind, most news about “AI that learns” becomes easier to read calmly.