AIF-C01 notes
Responsible AI practices

Transparent and Explainable Models

To promote trust and accountability in an AI system, there should be transparency and explainability in the model.

Models need to be transparent and explainable

Transparency and explainability

AI systems are now commonplace in many fields that impact business and society. Some of these fields include healthcare, security, and financial institutions. There must be trust and accountability in these AI systems. Therefore, including transparent and explainable models is fundamental for developing these AI systems.

Transparency answers the question HOW, and explainability answers the question WHY. Both aspects are needed to build responsible AI systems.

Transparency

Transparency helps to understand HOW a model makes decisions.

This helps to provide accountability and builds trust in the AI system. Transparency also makes auditing a system easier.

Explainability

Explainability helps to understand WHY the model made the decision that it made. It gives insight into the limitations of a model.

This helps developers with debugging and troubleshooting the model. It also allows users to make informed decisions on how to use the model.

Transparent and explainable models compared to black box models

Models that lack transparency and explainability are often referred to as black box models. These models use complex algorithms and numerous layers of neural networks to make predictions, but they do not provide insight into their internal workings.

Transparent and explainable models have several advantages over black box models.

Increased trust

Transparent and explainable models can increase trust in the models and help users understand why the models are making certain predictions. This can be particularly important in high-stakes applications, such as healthcare, financial services, and transportation, where it is crucial to understand the reasoning behind the models' decisions.

Easier to debug and optimize for improvements

Transparent and explainable models can be easier to debug and improve than black box models. By providing insight into the models' internal workings, developers can identify issues and make targeted improvements to optimize the models' performance.

In contrast, black box models can be more difficult to debug and improve because the internal workings of these models are not transparent. Developers might struggle to identify issues and make targeted improvements. This can lead to a longer development cycle and less optimal models.

Better understanding of the data and the model's decision-making process

In terms of performance, transparent and explainable models might not always outperform black box models.

However, they can provide a more comprehensive understanding of the data and the model's decision-making process. This can be particularly important in applications where explainability is a key consideration, such as in healthcare, where patients need to understand why a particular treatment was recommended.

Solutions for transparent and explainable models

There is no standard solution for creating transparent and explainable models. Depending on the use case of the model, you might use different techniques.

Here are some potential solutions for increasing transparency and explainability in AI systems to help ensure responsible AI development.

Explainability frameworks

There are several explainability frameworks available, such as SHapley Value Added (SHAP), Layout-Independent Matrix Factorization (LIME), and Counterfactual Explanations, that can help summarize and interpret the decisions made by AI systems. These frameworks can provide insights into the factors that influenced a particular decision and help assess the fairness and consistency of the AI system.

Transparent documentation

Maintain clear and comprehensive documentation of the AI system's architecture, data sources, training processes, and underlying assumptions, which can be made available to relevant stakeholders and auditors.

This can include user guides, technical documentation, and visualizations that help users understand the underlying algorithms and their inputs and outputs.

Monitoring and auditing

AI systems should be monitored and audited to ensure that they are functioning as intended and not exhibiting bias or discriminatory behavior. This can include regular testing and oversight by humans and automated tools to identify unusual patterns or decisions.

Human oversight and involvement

Incorporate human oversight and involvement in critical decision-making processes where humans can review and validate the AI system's outputs and decisions, especially in high-stakes situations.

Counterfactual explanations

Provide counterfactual explanations that show how the output would change if certain input features were different to help users understand the model's behavior and reasoning.

User interface explanations

Design user interfaces that provide clear and understandable explanations of the AI system's outputs, rationale, and limitations to end-users, so they can make informed decisions.

Risks of transparent and explainable models

Just as transparent and explainable models provide many advantages, they also come with some risks. Some of those risks include the following:

  • Increasing the complexity of the development and maintenance of the model can increase the costs.
  • Creating vulnerabilities of the model, data, and algorithms can be exploited by bad actors.
  • Presenting unrealistic expectations that the model is perfectly transparent and explainable. In some situations, this may not be achievable or even intended.
  • Providing too much information that can create privacy and security concerns. It could also lead to compromising the competitive edge of the model.

AWS tools for transparency and explainability

AWS tools for transparency

To help with transparency, Amazon offers AWS AI Service Cards and Amazon SageMaker Model Cards. The difference between them is that with AI Service Cards, Amazon provides transparent documentation on Amazon services that help you build your AI services. With SageMaker Model Cards, you can catalog and provide documentation on models that you create or develop yourself.

AWS AI Service Cards

AI Service Cards are a resource to increase transparency and help customers better understand AWS AI services, including how to use them in a responsible way. AI service cards are a form of responsible AI documentation that provides customers with a single place to find information on the intended use cases and limitations, responsible AI design choices, and the deployment and operation best practices for our AI services.

Amazon SageMaker Model Cards

Use SageMaker Model Cards to document critical details about your ML models in a single place for streamlined governance and reporting.

Catalog details include information such as the intended use and risk rating of a model, training details and metrics, evaluation results and observations, and additional callouts such as considerations, recommendations, and custom information.

AWS tools for explainability

SageMaker AI Clarify

SageMaker AI Clarify is integrated with SageMaker AI Experiments to provide scores detailing which features contributed the most to your model prediction on a particular input for tabular, NLP, and computer vision models. For tabular datasets, SageMaker AI Clarify can also output an aggregated feature importance chart which provides insights into the overall prediction process of the model. These details can help determine if a particular model input has more influence than expected on overall model behavior.

SageMaker Autopilot

Amazon SageMaker Autopilot uses tools provided by SageMaker AI Clarify to help provide insights into how ML models make predictions. These tools can help ML engineers, product managers, and other internal stakeholders understand model characteristics. To trust and interpret decisions made on model predictions, both consumers and regulators rely on transparency in machine learning.

The SageMaker Autopilot explanatory functionality determines the contribution of individual features or inputs to the model's output and provides insights into the relevance of different features. You can use it to understand why a model made a prediction after training or use it to provide per-instance explanation during inference.

In the next lesson, you will learn about the trade-off between safety and transparency in AI models.

On this page