← All articles
BlogAI Ethics and Responsible AI

Explainability in machine learning: why black box models lose marks

AI Ethics and Responsible AIBy Sotiris Spyrou·Published 2026-07-30
Explainability in machine learning: why black box models lose marks

Explainability in machine learning: why black box models lose marks

Black box machine learning models lose marks in exams and fail in production because they cannot explain the internal logic behind their predictions. Without explainability, developers cannot debug algorithmic errors, regulators cannot verify fairness, and end users cannot trust the final decision. University examiners actively penalise students who propose highly accurate but completely opaque models for sensitive, high-stakes problems.

As a practitioner and an examiner, I frequently see students default to deep neural networks for every coursework assignment or exam question. They assume that achieving a 99 percent accuracy score on a test dataset is the sole objective of machine learning. This assumption ignores the reality of deploying artificial intelligence in commercial and public sectors. If a bank uses an algorithm to deny a customer a mortgage, the law strictly requires the bank to explain why that decision was made. A highly accurate model is entirely useless to a business if it violates data protection regulations or hides discriminatory biases. This article breaks down exactly what you need to know about model explainability to score top marks in your university modules and to build systems that survive strict real-world scrutiny.

The difference between interpretability and a black box

A black box model is any machine learning algorithm where the internal decision-making process is hidden from the user. Deep neural networks, random forests, and gradient boosting machines are classic examples. You feed a set of input features into the model, and it outputs a prediction. However, because these models rely on thousands of non-linear transformations and complex mathematical interactions across hidden layers, no human can look at the trained weights and understand exactly how the inputs became the output. The logic is impenetrable.

In contrast, interpretable models are transparent by design. These are often referred to as white box models. Linear regression, logistic regression, and shallow decision trees fall into this category. If you train a linear regression model to predict house prices, you can look directly at the coefficients. A coefficient of 50 for the ‘number of bedrooms’ feature tells you exactly how much that specific variable contributes to the final price. Similarly, if a decision tree splits on the rule “Applicant Age < 18”, the logic for rejecting a loan application is explicit and immediate.

Understanding this distinction is vital for exam success. Examiners want to see you evaluate the trade-off between predictive accuracy and interpretability. A student who blindly throws an advanced gradient boosting machine at a simple linear problem will lose marks for poor judgement. You must learn to justify your model choice based on the stakeholder’s specific need to understand the outputs. If the end user requires absolute transparency, an inherently interpretable model is always the correct starting point.

Real-world consequences: why opacity fails

Explainability is not just an academic exercise confined to a lecture theatre. In regulated industries such as healthcare, finance, and criminal justice, deploying an opaque model introduces unacceptable operational risks. Consider a machine learning system designed to diagnose rare diseases from medical scans. A black box model might offer a 99 percent probability that a patient has a specific condition, but that number means nothing if the clinician cannot verify the reasoning. Doctors need to see the clinical markers the model identified. If the system cannot explain its reasoning, the hospital cannot legally or ethically act on the prediction.

Furthermore, there is a strict legal requirement for explainability. Under regulations like the UK General Data Protection Regulation (GDPR), data subjects have a right to meaningful information about the logic involved in automated decision-making. If your proposed model automatically rejects a candidate for a job, the employer must be able to provide the candidate with the reasons for that rejection. Writing “the neural network decided it based on hidden layer activations” on an exam paper shows a complete lack of commercial awareness and will result in a poor grade. Examiners specifically test your awareness of these legal and ethical constraints.

Finally, consider the engineering challenge of debugging. When a black box model makes a catastrophic error in production, the data science team has no clear path to fix it. Is the training data skewed? Is a specific feature causing data leakage? A famous industry example involves a model trained to detect skin cancer that secretly learned to identify the presence of a medical ruler in the photograph, rather than the actual tumour. Without explainability tools to highlight what the model was looking at, the engineers would have deployed a dangerously flawed system. Highlighting these practical realities in an exam essay shows you think like a senior practitioner.

Techniques for opening the black box: LIME and SHAP

When the complexity of your data demands the predictive power of a black box model, you must apply post-hoc explainability techniques. These are separate algorithms that sit on top of your trained model to generate explanations for its predictions. The two most prominent methods you will need to discuss in university exams are LIME (Local Interpretable Model-agnostic Explanations) and SHAP (SHapley Additive exPlanations).

LIME works by perturbing the input data to see how the black box reacts. It takes a single prediction, tweaks the feature values slightly, and observes how the model’s output changes. It then fits a simple, interpretable model, such as a linear regression, just around that specific local area. This surrogate model tells you which features were most important for that individual decision, even if the underlying global model remains highly complex and non-linear. LIME is computationally fast and relatively easy to implement, making it a popular choice for rapid debugging.

SHAP takes a more rigorous mathematical approach, grounded in cooperative game theory. It treats every feature in your dataset as a player in a game, where the “payout” is the final prediction. SHAP calculates the marginal contribution of each feature to the final prediction by evaluating all possible combinations of features. Because it relies on Shapley values, SHAP provides mathematically consistent explanations where the sum of the feature attributions exactly equals the difference between the prediction and the average model output.

Imagine a short worked example for an exam where you must evaluate a credit scoring algorithm. You could write: “To ensure fairness in the neural network, we will apply SHAP. For an applicant denied a loan, a SHAP waterfall plot will reveal the exact local feature contributions. It might show that a low income reduced the base score by 50 points, while a history of late payments reduced it by 30 points. This provides the precise, legally compliant explanation required by financial regulators.” Mentioning game theory and marginal contributions in this context proves to the examiner that you understand the underlying mathematics of explainable AI.

Global versus local explainability

Exam questions frequently ask you to distinguish between global explainability and local explainability. Students often confuse the two concepts, which is an easy way to drop a grade. Global explainability describes how the machine learning model behaves across the entire dataset. It answers broad questions such as “Which features are generally the most important for predicting customer churn?” A random forest feature importance chart or a Partial Dependence Plot (PDP) are classic examples of global explainability. These tools help data scientists verify that the model aligns with general domain knowledge.

Local explainability focuses entirely on a single instance or prediction. It answers the highly specific question: “Why did the model predict that this specific customer would cancel their subscription?” As we established with LIME and SHAP, local explanations are vital for customer service interactions, upholding individual data rights, and debugging anomalous predictions. A feature that is globally unimportant might be the exact reason a specific edge-case prediction failed.

A top-tier exam answer will explicitly state that a comprehensive AI system requires both approaches. You use global explainability during the development phase to ensure the model makes sense at a macro level, checking for widespread biases or redundant features. You then deploy local explainability in the production environment to justify individual decisions to end users. Showing the examiner that you know when and where to apply these different scopes of explainability demonstrates excellent architectural judgement.

How to answer this in an exam

Mark schemes for university AI modules heavily reward critical evaluation over the simple memorisation of algorithms. If an essay question asks you to design a predictive system for a client, do not just list the highest-performing deep learning frameworks. Start your answer by assessing the domain. If the exam prompt mentions healthcare, finance, policing, or human resources, state immediately that the black box nature of complex models is a significant operational disadvantage.

You should always recommend a hybrid approach to model selection. Suggest training an inherently interpretable baseline model, such as a logistic regression, before moving to a complex ensemble method. If you justify moving to a gradient boosting machine to improve accuracy, explicitly state that you will implement post-hoc explainability techniques like SHAP to maintain transparency. This proves you are balancing performance with ethics. The Full Marks Press AI Ethics and Responsible AI guide covers this with worked exam questions, showing you exactly how to structure these arguments to capture maximum marks.

Finally, ensure you use precise terminology. Using terms like “post-hoc”, “model-agnostic”, “local interpretability”, “feature attribution”, and “surrogate models” shows the examiner you have moved beyond beginner tutorials. It tells them you possess the technical vocabulary required of a professional data scientist. When you combine accurate terminology with a clear understanding of the business and ethical implications of your technical choices, you will consistently secure top grades.

Frequently asked questions

What is the difference between interpretability and explainability? Interpretability means the model is inherently transparent by design, like a simple decision tree where you can read the logic directly. Explainability refers to external techniques applied after training to help humans understand the decisions of a complex, opaque model.

Why is SHAP preferred over LIME in many modern applications? SHAP provides mathematically consistent feature attributions based on game theory, meaning the feature contributions always sum up precisely to the final prediction. LIME is computationally faster but lacks this strict mathematical guarantee, which can sometimes lead to inconsistent or unstable explanations.

Can a model be both highly accurate and fully interpretable? Yes, but it depends heavily on the nature of the data. For structured, tabular data, well-tuned interpretable models often perform just as well as black boxes. For unstructured data like raw images, audio, or text, complex neural networks are currently required to achieve high predictive accuracy.

How does data leakage relate to black box models? Data leakage happens when a model inadvertently learns from information it should not have access to during training. In a black box, this leakage is incredibly hard to spot because you cannot see the internal rules. Explainability tools help reveal leakage by showing that the model is relying heavily on an illogical or restricted feature.


To master these concepts and see exactly how they are tested in university assessments, download your free copy of our exam-revision guides at fullmarkspress.com/free.

Revising this for an exam? The Full Marks Press guides cover it with worked exam questions and mark schemes. Get a free copy.

ShareXLinkedInWhatsApp
Sotiris Spyrou

Practitioner and author at Full Marks Press, a Verity AI imprint.