Privacy note: We capture your IP address to provide customised and focused services. See our Privacy Policy.

Machine Learning Foundations — Alpha School

Lesson 18: Explaining Models and Earning Trust

A model that cannot explain itself is a model that cannot be questioned, and a model that cannot be questioned should not be making decisions about people. This is the problem of explainability. A decision tree can be read like a flowchart, and a logistic regression can show which features pushed its answer up or down. A random forest can say which features mattered most. But a deep neural network with millions of weights offers no such story — and when it refuses a loan, misses a disease or flags a student as at risk, 'the model said so' is not an explanation anyone should accept.

The field has developed tools to open the black box a little. One family of methods asks: which features mattered most for this one decision? For an image model, the answer might be a heat map showing which parts of the picture the model looked at. For a loan model, it might be a list: income counted for this much, repayment history for that much. Another family asks what would have to change to flip the decision: if the applicant's income had been higher by a certain amount, the loan would have been approved. That kind of answer — a counterfactual — is often the most useful, because it tells the person what they could actually do differently.

Trust is earned, not claimed

Explanations are not only for the people affected. They are also how builders catch their own mistakes. A model that approves loans might turn out to be looking at the applicant's postcode rather than their finances; a medical model might be looking at the hospital's logo on a scan rather than the disease. These are real failure modes, found only because someone asked the model to show its work. An explanation that reveals the model is using the wrong evidence is not a failure of the explanation — it is the explanation doing its job.

There is an honest limit to all of this. Explanations of complex models are approximations: they describe a simplified version of what the model did, not the full truth. A heat map shows where the model looked, not why it looked there. So explainability should not be treated as a guarantee. It is one part of earning trust, alongside honest testing, measuring performance for each group, keeping humans in charge of important decisions, and being willing to say no — to not deploy a model at all when it cannot be explained well enough for the stakes involved.

When explanations disagree

Explanations have an awkward property: different methods can give different answers about the same decision. One method might say income mattered most for a loan refusal, while another says repayment history did. That does not necessarily mean one of them is wrong — they are answering slightly different questions, in the way that two people describing the same event can emphasise different parts. But it does mean explanations should be treated with care. A good habit is to check more than one method, and to be suspicious of an explanation that changes completely when a tiny detail of the input changes. It also means explanations should be used alongside other evidence — the model's performance for each group, its behaviour on test cases, and a human review of the decision itself — rather than treated as proof on their own. An explanation is a clue, not a verdict, and a careful practitioner treats it as one.

As a student of this field, the habit to build is this: whenever a model makes a decision, ask two questions. First, could I explain this decision to the person it affects, in words they would accept as fair? Second, if the model is wrong, how would anyone find out? If you cannot answer both, the model is not ready — whatever its accuracy score says.

Key Terms

Explainability
How far a model's decisions can be understood and explained in human terms.
Black box
A model whose inner workings cannot be inspected or explained, such as a large neural network.
Feature attribution
An explanation showing how much each feature contributed to one particular decision.
Counterfactual explanation
An explanation showing what would have to change for the model to decide differently, such as a higher income leading to a loan approval.
Heat map
A picture highlighting the parts of an image a model paid most attention to when deciding.
Model audit
A systematic check of a model — its data, its performance for each group, and its explanations — before and after deployment.

Discussion Questions

  1. A loan is refused and the bank says 'the model decided'. What would a fair explanation need to contain?
  2. A medical model turns out to be looking at a hospital logo on scans rather than the disease. How could explanations have caught that earlier?
  3. When is 'we cannot explain this model well enough' a good reason not to deploy it at all?

Practice Questions

  1. What is a black-box model?
  2. What is feature attribution?
  3. What is a counterfactual explanation? Give an example.
  4. Why are explanations useful for the people who build models, not just the people affected?
  5. Why are explanations of complex models only approximations?
Show answers
  1. A model whose inner workings cannot be inspected or explained, such as a large neural network. You can see its inputs and outputs, but not why it decided what it did.
  2. An explanation showing how much each feature contributed to one particular decision. For a loan it might show that income counted most and repayment history second.
  3. It shows what would have to change to flip the decision, such as a higher income leading to a loan approval. It is useful because it tells the person what they could actually do differently.
  4. Because they can reveal the model is using the wrong evidence, such as a postcode instead of finances. Catching that early is the explanation doing its job.
  5. They describe a simplified version of what the model did, not the full truth. A heat map shows where the model looked, not why it looked there.
Keep reading to complete this lesson