When we think about machine learning models, we tend to picture them as extraordinarily complex systems. Neural networks work with millions of parameters, performing unreadable calculations, that even the people who design them cannot fully explain them. Yet these systems work, giving us accurate predictions about the world. To understand how this complexity manages to tell us something true about reality, it can help to start with something far simpler: a drawing.
Suppose we want to study the motion of a planet by representing the solar system as a very simplified drawing showing nothing but a large circle (the sun) and a smaller one (a planet). It is an extremely simplified model; there is no other planets, no moons and no asteroids. Even so, such an idealised representation can be useful. By using this model, if we consider the gravitational interaction between the sun and the planet and apply Newtonian mechanics, we can describe the planet’s orbit, which is an ellipse.
A deliberately simplified and idealised representation of this sort, built to isolate certain relevant aspects of a phenomenon and to allow us to draw inferences about the system it represents, is sometimes called a toy model.
This concept brings us to a first question, one that might seem trivial at first sight: how can a representation that leaves out so many of the details of what it depicts (the sketch of the solar system, as opposed to the actual solar system) still provide us with reliable information about it?
There are several possible answers to this question.
We can say that a representation’s effectiveness (that is, for the representation to be successful) is assessed on the basis of the inferences it allows us to draw about the target object. What counts is how far it enables us to draw correct conclusions about the system being represented. From this point of view, overall resemblance to reality becomes secondary, and the focus shifts to the model’s inferential power, that is, to what it allows us to infer about the target.
Another answer is that leaving out details shouldn’t be treated as a weakness of the model. A drawing that ignores most of the solar system is not a poor copy of reality; it is a deliberate idealisation, designed to strip away everything except the features that matter for the question we are asking – that is, in the previous example of the solar system, what is the planet’s orbit?
One could say that machine learning models, with their opacity and computational complexity, share nothing with a simple pen-and-paper drawing of the sun and a planet. They appear to belong to an entirely different world from toy models and from the way toy models represent reality.
Unexpectedly, however, machine learning models also make extensive use of simplification and idealisation.
First of all, the data that the system feeds on, are not directly the objects of reality. They are the result of the measurement, observation, selection and coding: in other words, some aspects of reality are turned into variables or numerical representations (encoding), and others are left out out. The very construction of the data, then, already involves a degree of simplification and approximation.
A further step takes place during training. Starting from the training data, the model adjusts its parameters so as to learn statistical regularities that are useful for the task it has been assigned.
Finally, once training is over, the system encounters new data. These are processed based on the patterns learnt during training. Put simply, the model “assumes” that at least some of the regularities observed in the training data are informative for new cases. The ability to produce appropriate results on these new contexts is what is called generalisation.
It is through these steps (representing phenomena, learning regularities and generalising to new cases) that a machine learning model can produce accurate predictions or inferences about aspects of the world, without reproducing its full complexity.
A striking example is AlphaFold2, a deep learning system developed to predict the three-dimensional structure of proteins from their amino acid sequence, also drawing on evolutionary information derived from homologous sequences. The problem this system is trained to address is challenging as proteins can take millions of different shapes, and identifying them through empirical experiments would take years of work.
In the simplest terms, AlphaFold2 is trained on known protein structures and vast collections of sequences, from which it extracts the statistical, geometric and evolutionary patterns that govern how proteins fold. These patterns reach well beyond the specific examples it was trained on, so when it is given a new sequence, it can put what it has learnt to work and predict the protein’s three-dimensional shape.
The new protein doesn’t have to be one the model has seen before, or even closely resemble one. Instead, AlphaFold2 draws on general principles it has learnt from previous examples.
By generalising from previous data, the system does not capture the physical reality of proteins in its entirety. However, the results obtained are extremely accurate and reveal true properties of proteins.
This is where machine learning and toy models turn out to have something in common. A neural network and a sketch of the sun look nothing alike, but epistemically they work in the same way: both are idealised representations – not including the full complexity of reality – that tell us something true about what they represent.
From this perspective, complex machine learning models can be interpreted as tools that, despite being intricate computational structures, function through selective and idealised representations of reality. By associating the concept of toy model to AI models as tools that – just like toy models – involve processes of representation can help clarify their utility in scientific practice.
Still, this leaves us with an open question: Why is it harder to judge the scientific value of generalisations made by machine learning models than of those made by toy models? And why is AI generalisation process harder to trust?
Answering these questions requires understanding to what degree we can rely on the inferences drawn by an AI model. If, just like toy models, machine learning systems work through processes of generalisation and idealisation rather than by creating a replica of reality as it is, then their opacity does not necessarily mean that they have failed epistemically. The real challenge, rather, is to understand what kinds of idealisations are introduced, when they are justified, and how they might fail.
Virginia Zanetto
Sullivan E. Do Machine Learning Models Represent Their Targets? Philosophy of Science. 2024;91(5):1445-1455. doi:10.1017/psa.2023.151.