From rules to learning from data
Traditional software follows instructions written by a person. A programmer anticipates the situations the program will meet and writes explicit rules for each one: if a message contains a particular phrase, mark it as spam; if a value exceeds a threshold, raise an alert. This works well when the rules are known and stable. It works poorly when the patterns are too subtle, too numerous, or too changeable for anyone to write down by hand.
Machine learning takes a different route. Instead of writing the rules, a developer supplies examples and lets the system infer the rules itself. Given thousands of messages already labelled as spam or not spam, a machine learning system can discover the combinations of words, senders, and structure that tend to separate the two, including patterns a human author might never think to specify. The output of this process is not a program written by a person but a set of learned values, called a model, that maps inputs to outputs.
This shift matters because it lets software handle tasks that resist explicit description. Recognising a face, translating a sentence, or estimating the price of a house involves relationships too intricate to enumerate. Learning those relationships from data, rather than legislating them in advance, is the central idea that distinguishes machine learning from conventional programming.
How machine learning fits within artificial intelligence
The terms artificial intelligence, machine learning, and deep learning are often used loosely, but they describe nested ideas of decreasing breadth. Understanding the nesting removes much of the confusion around them.
| Term | What it refers to | Relationship |
|---|---|---|
| Artificial intelligence | The broad aim of building systems that perform tasks associated with human intelligence | The widest field |
| Machine learning | Systems that learn behaviour from data rather than following hand-written rules | A subset of artificial intelligence |
| Deep learning | Machine learning that uses neural networks with many layers | A subset of machine learning |
Artificial intelligence is the outermost category and includes approaches that involve no learning at all, such as hand-coded logical rules. Machine learning sits inside it as the family of methods that learn from data. Deep learning sits inside machine learning as one particularly capable technique. Most systems described as AI in recent years, including large language models, are built with machine learning, and usually with deep learning in particular.
The three main types of learning
Machine learning methods are commonly grouped into three broad types according to the kind of feedback the system receives while it learns. The boundaries are not rigid, and practical systems often blend them, but the categories are a useful map.
Supervised learning is the most widely used. The system is trained on examples that are already labelled with the correct answer: images tagged with what they show, emails marked as spam or legitimate, historical records paired with known outcomes. The system learns to reproduce those labels and can then apply them to new, unlabelled inputs. Predicting a number, such as a price, is called regression; sorting inputs into categories, such as spam or not spam, is called classification.
Unsupervised learning works with data that carries no labels. Instead of predicting a known answer, the system looks for structure on its own, such as grouping similar customers together or detecting that a transaction is unlike the others. It is useful when labels are unavailable or expensive to produce, and for exploring data whose patterns are not yet understood.
Reinforcement learning learns through interaction. An agent takes actions in an environment and receives rewards or penalties depending on the results, gradually adjusting its behaviour to accumulate more reward over time. This framing suits problems that unfold as a sequence of decisions, such as controlling a robot, playing a game, or scheduling resources, where each choice affects what happens next.
Data, features, and models
Three ideas underpin any machine learning system: the data it learns from, the features that describe each example, and the model that stores what has been learned.
Data is the collection of examples used for learning. Its quality and coverage largely determine how well the finished system performs, because the model can only learn patterns that are present in the examples it is shown. A dataset that is incomplete, mislabelled, or unrepresentative of real conditions will produce a model with the same weaknesses.
Features are the individual measurable properties used to describe each example. For predicting a house price, features might include floor area, number of rooms, and location. Choosing and preparing good features has long been an important part of the work, though deep learning can, in some settings, learn useful features directly from raw data such as pixels or text.
A model is the object produced by training. It contains internal values, often called parameters or weights, that encode the learned relationship between inputs and outputs. Training a model means adjusting these values so that its predictions match the examples as closely as possible. Simple models may hold a handful of parameters; large modern models hold billions.
Training and inference
The life of a machine learning system has two distinct phases, and keeping them separate clarifies much of how the technology behaves in practice.
Training is the learning phase. The system processes the example data repeatedly, compares its current predictions against the known answers, measures the error, and adjusts its parameters to reduce that error. This cycle continues until the model performs well enough. Training is computationally demanding and is done in advance, sometimes over days or weeks on specialised hardware for the largest models.
Inference is the use phase. Once training is complete, the parameters are fixed, and the model is applied to new inputs to produce predictions. Inference is typically far faster and cheaper than training, and it is what happens each time a person actually uses the system: filtering an incoming email, suggesting a film, or flagging a suspicious payment. A model that is not retrained does not learn from these new inputs; it simply applies what it learned during training.
A central goal throughout is generalisation: the ability to perform well on inputs the model has never seen, rather than merely memorising the training examples. A model that memorises its training data but fails on new data is said to overfit, and guarding against this is one of the recurring challenges of the field.
Everyday examples
Machine learning is already embedded in many ordinary systems, often invisibly. A few familiar cases show the range of tasks it handles.
| Application | What the system learns | Type of task |
|---|---|---|
| Spam filtering | Which message patterns distinguish unwanted mail from wanted mail | Supervised classification |
| Recommendations | Which items a person is likely to want based on past behaviour and similar users | Pattern and preference modelling |
| Fraud detection | Which transactions differ from a customer's normal activity | Anomaly detection |
| Image recognition | Which visual patterns correspond to particular objects or people | Supervised classification |
These examples share a common shape. In each, the useful rules are too complex, too personal, or too changeable to write out by hand, so the system is instead trained to infer them from data. The same underlying approach also powers speech recognition, machine translation, medical image analysis, and the large language models that generate text.
Strengths and limitations
Machine learning is powerful precisely where explicit rules fail: problems with rich, noisy patterns and abundant examples. It can uncover relationships humans would miss, adapt to new data when retrained, and scale to tasks that would be impractical to program by hand. These strengths explain its spread across so many fields.
The limitations are equally important and follow directly from how the technology works. A model is only as good as its training data; if that data is narrow, outdated, or skewed, the model inherits those flaws. Because it learns statistical patterns rather than meaning, it can reproduce and even amplify bias present in historical records, producing outputs that are systematically unfair. It also tends to be unreliable on inputs unlike anything it was trained on, and many models cannot explain their reasoning in terms a person can inspect, which complicates trust and accountability.
It is therefore accurate to describe machine learning as pattern prediction rather than understanding. A system can be highly effective at its task while having no comprehension of what it is doing, and it can be confidently wrong. Treating its outputs as useful predictions to be checked, rather than as guaranteed truths, is the realistic posture. The technology is a well-understood set of statistical methods, not magic, and its results deserve the same scrutiny as any other measurement.
Frequently asked questions
What is machine learning in simple terms?
Machine learning is a way of building software that learns patterns from examples rather than being programmed with explicit rules. A developer supplies data and a learning method, and the system adjusts its own internal settings until it can make useful predictions on new, unseen inputs.
What is the difference between machine learning and artificial intelligence?
Artificial intelligence is the broad goal of building systems that perform tasks associated with intelligence. Machine learning is one approach within that field, in which behaviour is learned from data. Not all artificial intelligence uses machine learning, but most modern systems described as AI rely on it.
What are the three main types of machine learning?
The three commonly cited types are supervised learning, which learns from labelled examples; unsupervised learning, which finds structure in unlabelled data; and reinforcement learning, which learns through trial and error guided by rewards. Many practical systems combine elements of more than one.
What is the difference between training and inference?
Training is the process of adjusting a model's internal values using data, which is computationally intensive and done in advance. Inference is using the finished model to make a prediction on a new input, which is usually much faster and is what happens each time the system is actually used.
Is deep learning the same as machine learning?
Deep learning is a subset of machine learning that uses neural networks with many layers. All deep learning is machine learning, but machine learning also includes simpler methods such as decision trees and linear models that do not use deep neural networks.
What are the main limitations of machine learning?
Machine learning depends heavily on the quality and representativeness of its training data. It can reproduce or amplify bias present in that data, struggles with situations unlike anything it has seen, and generally cannot explain its reasoning in human terms. It predicts patterns rather than understanding meaning.
More from highlevel.ai
Continue with related explainers: How AI works sets out the wider mechanics; What is an LLM covers the models behind modern chat systems; What is generative AI explains systems that produce new content; What AI is used for surveys practical applications; and A high-level history of AI places these ideas in context.