All writing
·7 min read

Congratulations, You Predicted It!

The ability to predict something looks very powerful and may indicate knowledge. Does that mean we can trust it to tell us what to change?

predictioncausalityAIengineering

If someone visits your site for the first time, and they spend a little time looking around before they tell you that one of your pumps is likely to fail soon, you will admire that person's knowledge if it actually fails after a few days. Maybe because we put a lot of value on prediction in engineering? At the end of the day, engineering is a very practical endeavor. If the objectives are consistenly achieved, everyone will be very happy. That person may not have explained every detail of what was happening inside the pump. But somehow, they saw something in the current system that contained information about what could happen, and that was probably enough.

Some may expect that science is different, and that scientist care only about explaining why things happen. However, prediction value in science is surprisingly similar to engineering. Even if a theory's goal is to explain why a phenomena happens, being able to predict an event before it happens is often a strong evidence that the theory has captured something real about the world. Einstein’s general relativity is probably the most famous examples, but the idea appears everywhere in science and engineering.

Does this mean that when a model or a person predicts something correctly that they understand the actual mechanism? If yes, then maybe that model can help us simulate "what-if" scenarios and understand the root cause of events.

Prediction and explanation are strangely similar

Philosophers of science asked this question long before machine learning existed. One of them was Carl Hempel, who proposed what became known as the covering-law model of scientific explanation. The basic idea is quite intuitive. Suppose I want to explain why a metal rod expanded. I might say:

  • metals expand when heated,
  • this rod is made of that metal,
  • the rod was heated,
  • therefore, the rod expanded.

We have some general knowledge about how the world behaves, some facts about this particular situation, and from those we derive what happened. That feels like an explanation. But now imagine standing there before heating the rod. I know the same law. I know the same facts. So I say:

The rod is going to expand.

Now it is a prediction.

Hempel noticed that the logical structure can be almost identical. The main difference is whether we perform the reasoning before or after the event. Then explanation and prediction are symmetric (the ability to predict means the ability to explain, and vice versa). However, if I told you: I understand why this pump keeps failing. That is relatively easy to say after looking at everything that happened. I can construct a story by connecting the dots: flow increased, vibration increased, the bearing heated up, and eventually the pump failed. This can be convincing, but now suppose I say: because I understand what is happening, I expect this other pump to fail within the next week under these conditions. Suddenly I have taken a much bigger risk. Reality gets to check my explanation. This may be one reason prediction is so powerful in science. After something happens, there may be many plausible stories that fit the evidence. Prediction removes some of that freedom. You have to commit before you know the answer. And if the world repeatedly behaves as your model expects, then your model has probably captured at least some regularity that extends beyond the observations used to build it. That is not the same thing as complete understanding. But it is certainly something very big.

But does a good prediction explain anything?

This is where the problem starts. Consider a flagpole standing in the sun. If I know the height of the flagpole and the angle of the sun, I can calculate the length of its shadow. That feels both predictive and explanatory: the flagpole has this height, therefore the shadow has this length. But mathematically, I can work backwards. If I know the length of the shadow and the angle of the sun, I can calculate the height of the flagpole very accurately. Yet it would sound strange to say:

The flagpole is three metres tall because its shadow is four metres long.

The shadow helps me infer the height. It does not explain why the flagpole has that height.

This famous counterexample became one of the problems for Hempel’s model. It showed that a relationship can support a perfectly good inference without necessarily providing a satisfying explanation. There are simpler examples too. Cows lying down might correlate with an approaching storm strongly enough to help predict one. But the cows do not explain the storm. Predictive relevance and explanatory relevance are not necessarily the same thing. And I think this distinction matters enormously today.

This is basically the question we face with AI models

Modern machine-learning models can sometimes predict things remarkably well without giving us a clear causal account of why those things happen.

A model might predict:

  • tomorrow’s wastewater ammonia concentration,
  • which pump is likely to fail,
  • whether a customer will leave,
  • how much energy a facility will consume,
  • or whether a patient is at elevated risk.

And the prediction may be extremely accurate. So what exactly have we learned? We have clearly learned something. The model has discovered enough structure in the data to distinguish between possible futures better than chance. That alone can be enormously useful. If knowing that a pump is likely to fail tomorrow allows me to inspect it today, I may not need a complete theory of bearing degradation before acting.

It gives you time to act, or at least get ready....

When and why causality can be important?

Prediction by itself is great. It feels good to be able to say what is going to happen next and then watch reality agree with you. But things become more complicated when we want to intervene.

Suppose my model discovers that whenever X happens, Y usually follows. That may be enough to predict Y.

But then I ask a different question:

If I deliberately change X, will Y change?

That is a much harder question. Maybe X causes Y. Maybe Y causes X. Maybe some third variable causes both. Or maybe the relationship only exists under the particular operating conditions represented in our historical data.

Prediction asks:

What is likely to happen?

Causal reasoning asks:

What would happen if I changed something?

Those two questions can look almost identical. But they support very different decisions.

Imagine a model tells me that low dissolved oxygen today is associated with high ammonia tomorrow. That does not automatically mean increasing dissolved oxygen will solve the problem.

Maybe both are consequences of an unexpected increase in loading. Maybe temperature changed. Maybe the sensor drifted. Maybe the historical relationship reflects the way operators were already responding to some other condition.

The moment we move from predicting the future to intentionally trying to change it, we need to be much more careful about what our model actually knows.

So is prediction still useful?

Very much so. Prediction can serve many purposes, one of them is that Prediction gives us time to act. A forecast of tomorrow’s problem may be far more useful than a perfect explanation delivered the day after.

Predictions enable practicle applications of science, just as what engineering does.

We should never undermine the importance of understanding and explanation. A predictive model does not need to explain the world to be useful. Sometimes its job is simply to tell us that something is coming. The ideal outcome can be achieved if we can both explain and predict, but maybe we should not constraint ourselves to achieving both, and otherwise we reject that model.

“Will ammonia be high tomorrow?” and “What should I change today to prevent it?” are not the same question. The first asks the model to anticipate the world. The second asks it to reason about a world we deliberately alter. And perhaps that is a useful way to decide what kind of model we actually need: warning, diagnosis, or intervention?


Newsletter

Enjoyed this? Get the next one by email.

Occasional writing on water, modelling, and machine learning. No spam, unsubscribe anytime.