Skip to content
The Daily Triptych001 / 365
Function fitting to training examples

The model adjusts its internal parameters until the curve passes close to the labelled points. The curve is defined everywhere, but accuracy depends on the input resembling the training distribution.

II · THE IDEA · ARTIFICIAL INTELLIGENCE

What Machine Learning Is, and Is Not

Foundations · Computer science · Mid-twentieth century

▶ Listen · narrated

The phrase 'machine learning' suggests something closer to human cognition than what actually happens. The gap between the metaphor and the mechanism explains most of the surprises.

At a glance

What it is
A program that adjusts internal parameters to fit a function to training examples
What it produces
A mathematical mapping from inputs to outputs, optimised to minimise error on the training set
What it is not
A system that understands, reasons, or generalises the way humans do
Core requirement
Enough examples to constrain the space of possible functions

Imagine you are teaching a friend to recognise oak trees by walking through a forest and pointing at examples. After seeing fifty oaks, your friend starts recognising new ones. They have learned a pattern: lobed leaves, rough bark, acorns in autumn. Machine learning works similarly, but with an important difference. Your friend is updating a mental model of what an oak is — its features, its role in the ecosystem, how it differs from a beech. A machine learning system is adjusting numbers in a mathematical function until its output matches the labels you gave. Show it fifty images labelled 'oak' and it learns a mapping from pixel patterns to the label 'oak'. It does not learn what an oak is. If you show it an oak in winter, bare of leaves, it may fail unless your original fifty included winter oaks. The system has no broader understanding to fall back on. It has a function, tuned to the examples it saw.

Look closer

  1. The function has no semantics built in

    A machine learning system does not arrive with concepts like 'cat' or 'grammar' or 'fairness' encoded in its structure. It has parameters — often billions of them — initialised to small random values. Training adjusts those parameters so that the function's output matches the labels in the training data. If the data pairs images of cats with the label 'cat', the system learns a mapping that produces 'cat' for similar images. It has not learned what a cat is in any broader sense. It has learned a correlation.

  2. Generalisation is statistical, not logical

    When a trained model encounters an input it has never seen, it does not reason about it. It interpolates — or, more boldly, extrapolates — from the patterns present in the training set. If those patterns are strong and the new input is similar enough to the training distribution, the model often produces a useful answer. If the input is out of distribution, the model still produces an answer, because the function is defined everywhere, but the answer may be confidently wrong. There is no mechanism that says 'I do not know.'

  3. The child analogy breaks at correction

    A child who calls a dog a cat can be told 'No, that is a dog' and will update a conceptual model that applies across contexts. A machine learning model trained on static data cannot do this during inference. It can be retrained with new examples, but that is a separate, computationally expensive process, not an on-the-fly correction. Some systems simulate correction by storing examples and retrieving them later, but the core function itself remains fixed after training ends.

The story

Machine learning is the practice of writing a program that writes itself. More precisely, you supply a mathematical structure with adjustable parameters, a dataset of input-output pairs, and an algorithm that tunes the parameters until the structure's predictions match the outputs closely. The result is a function: something that takes an input and produces an output according to a fixed, learned rule.

The structure is often called a model. The tuning process is training. The dataset is the training set. The algorithm that adjusts the parameters is the learning algorithm, and it typically works by calculating how far the model's current predictions are from the correct answers — a quantity called the loss — then nudging the parameters in whichever direction reduces that loss. Repeat this across thousands or millions of examples, and the parameters settle into a configuration that minimises error on the data you showed it.

This is not reasoning. The model does not form hypotheses, test them, or revise a theory. It searches a space of possible functions for one that fits the data. The search is guided by gradient descent or a related optimisation method, which is efficient but blind: it follows the slope of the loss surface downhill, without any understanding of what the data represents.

The function that results can be extremely complex. A neural network with a hundred million parameters is computing a function with a hundred million degrees of freedom, capable of fitting extraordinarily intricate patterns. But complexity is not comprehension. The model has learned to reproduce the statistical regularities present in the training set. If you train it on photographs labelled with object names, it learns correlations between pixel patterns and labels. It does not learn what the objects are for, how they behave, or what they are made of, unless those properties are somehow encoded in the pixel patterns themselves and the training set is large and varied enough to expose them.

This is why machine learning systems can be both impressive and brittle. They excel at tasks where the training data is abundant and the test cases resemble the training distribution. They fail, often silently, when the input is subtly different from anything they have seen. A model trained to recognise stop signs in clear daylight may not recognise one at dusk, or with a sticker on it, unless the training set included those variations. The model has not learned the concept of a stop sign. It has learned a pattern.

The popular metaphor — that these systems learn like children — is misleading in several specific ways. A child integrates information across sensory modes, updates beliefs in real time, asks questions, and generalises from a handful of examples by leveraging a rich prior model of the physical and social world. A machine learning system does none of these things unless each capability is explicitly engineered and trained. The learning is narrow, data-hungry, and frozen once training ends. Calling it learning is not wrong, but it is a different kind of learning, and mistaking one for the other leads to misplaced expectations about what the system can and cannot do.

Why it mattered then

The core idea — that you could specify a task by supplying examples rather than writing explicit rules — emerged in the mid-twentieth century, as computers became powerful enough to search large parameter spaces. Early systems learned simple functions: linear classifiers, decision trees, polynomial fits. The appeal was immediate. For tasks where the rules were hard to articulate — recognising handwritten digits, filtering spam, predicting equipment failure — machine learning offered a way to let the data specify the solution. By the 1980s and 1990s, methods like neural networks and support vector machines were demonstrating that with enough data and the right structure, learned functions could outperform hand-coded rules on a growing range of problems. The shift mattered because it moved the bottleneck from human ingenuity in rule design to the availability and quality of data.

Why it matters now

Machine learning is now the dominant approach to building systems that process language, images, and sensor data at scale. The functions being learned have grown vastly more complex — models with billions of parameters, trained on datasets scraped from the entire public internet — but the underlying principle remains function-fitting. Understanding this matters because the metaphors used to describe these systems often obscure their actual behaviour. When a model produces a plausible-sounding but false statement, it is not lying or confused. It is outputting the continuation that best fits the statistical patterns in its training data. When it fails on an edge case, it is not being stupid. It is extrapolating from a distribution that did not include that case. Recognising machine learning as function-fitting rather than cognition helps set accurate expectations, design better safeguards, and ask the right questions about where these systems should and should not be deployed.

The surprising detail

One of the more counterintuitive properties of machine learning is that a model can perform well on its training set and poorly on real-world data, not because it failed to learn, but because it succeeded too well. This is called overfitting: the model has learned the noise and idiosyncrasies of the training examples rather than the underlying pattern. A function with enough parameters can memorise the training set exactly, achieving zero error, while generalising badly to anything new. Preventing this requires techniques like regularisation, which penalise complexity, or early stopping, which halts training before memorisation sets in. The fact that perfect training performance is often a warning sign, not a success metric, runs counter to intuition from most other engineering disciplines.

Remember this

Machine learning fits a function to data. It does not reason, and it does not know when it is guessing.

Test yourself

A model is trained to predict whether a loan application will default, using historical data from 1990 to 2010. It performs well on a held-out test set from the same period. In 2025, its predictions are wildly miscalibrated. Explain why this is not a failure of machine learning as such, but a consequence of what machine learning is.

Go deeper

Image: Original diagram, The Daily Triptych. Licence: Original work. Source.

← Back to day 1