Machine learning sits behind almost everything called AI today: the chatbots that answer questions, the recommendations that show you the next video, and the spam filters that keep your inbox clean. Yet few people know how it works. The idea is simpler than it sounds. Instead of writing every rule by hand, a program is given examples and finds the patterns itself. This article explains what machine learning is, how a model is trained, the four ways a model can learn, and where the limits lie.

Machine learning is the part of artificial intelligence where a program learns its behaviour from data instead of having every rule written by hand. A working definition has four parts. First, data: examples described by features, numbers or categories the model can read, and, in supervised learning, a label, the answer to predict. Second, a model family: a function shape with adjustable parameters. A straight line has two, a decision tree has thousands of split thresholds, and a large neural network has billions of weights. Third, a loss function: one number for how wrong the parameters are. Fourth, an optimiser: a procedure that changes the parameters to lower the loss, usually gradient descent. The learned parameters plus the code that applies them form the model.

Training runs in a loop. The model makes predictions for examples whose answers are known, the loss function measures how wrong it was, and the optimiser adjusts the parameters a little. That loop repeats thousands or millions of times until the error on held-out data stops improving. Held-out data is the key: a model is trained on one part of the data and tested on another part it has never seen. That is the only way to check whether it has really learned or has simply memorised the training data. A model that knows the training data perfectly but fails on new data has overfitted, and that is one of the most common mistakes in practice.

The four ways a model learns

Supervised learning is the workhorse behind most products. The model trains on labelled examples: past customers who cancelled and ones who stayed, transactions that were fraudulent and ones that were not. It learns the mapping from inputs to known answers, then predicts for new cases. Supervised problems come in two forms: classification, which predicts a category, such as spam or not spam, and regression, which predicts a number, such as a price or a time to failure. Most AI systems people use every day, from spam filters to credit scoring, are supervised learning.

Unsupervised learning works without answers. The algorithm is handed a dataset and told, in effect, to find structure on its own: groups of similar customers, outliers that might signal fraud, or a more compact representation of the data. The most common task is clustering, grouping similar items together. Because there are no predefined answers, the result needs human judgement to decide whether the groups found mean anything.

Self-supervised learning sits between the two and powers today's large language models. The labels are manufactured from the data itself, by hiding part of it and predicting it, such as the next word in a sentence. That lets a model learn from huge amounts of unlabelled text before it is fine-tuned for a specific task. Reinforcement learning, finally, learns from experience: an agent acts in an environment, receives rewards or penalties, and over time learns which strategy pays off. It powers game-playing systems, robot control and parts of the fine-tuning of language models, where human preferences act as the reward signal.

What neural networks have to do with it

A neural network is a model family, not a way of learning. It is made of layers of simple computing units, each forming a weighted sum of its inputs and passing the result through a simple function. During training, the weights are adjusted until the network gives the right answers. Deep networks with many layers can learn complex patterns, such as the features that make up a face in a photo or the structure that makes a sentence grammatical. Today's large models, such as Google's Gemini 4 family or Anthropic's Claude, are neural networks trained with self-supervised learning on huge amounts of data.

That also explains why machine learning moved so much money in 2026. Anthropic raised a record 81.3 billion dollars in its stock market debut in November 2026, at a valuation of about 1.5 trillion dollars. Google released Gemini 4 Neon in November 2026, another model in its Gemini 4 family. Those numbers show how much capital flows into models, but they say nothing about whether a single model is good. A model is only as good as its data, its evaluation and the task it was built for.

Where machine learning fails

Machine learning has clear limits, and knowing them matters as much as knowing how it works. First, a model only learns what is in its data. If the data is biased, the model is biased. Second, a model cannot explain why it made a decision, at least not in the way a person can. A doctor, a bank or a court using an AI decision needs to know that. Third, models can be attacked: small, targeted changes to inputs can fool a model, and poisoned training data can change its behaviour. Fourth, training large models costs a lot of energy and computing power, which raises the question of whether a smaller, simpler model would do the job.

The practical question for readers is not whether machine learning works, but whether it is the right choice for a given task. Three questions help: are there enough labelled examples, or a clear reward, is there a simple rule that already solves the problem, and how will the model be tested when it meets new data. A model that cannot answer those questions is not a tool but a risk. Anyone who asks those questions understands machine learning better than most headlines written about it.