Study guide

6.2 Responsible AI, Explainable AI, Fairness Metrics and Model Governance

Google Cloud Professional Machine Learning Engineer Exam

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

0.1 Exam Overview, Blueprint & Certification Logistics 0.2 Study Strategy, Scenario Mechanics & 8-Week Roadmap

2 Section 1: Architecting Low-Code AI Solutions (~13%)

1.1 BigQuery ML: Model Types, SQL Syntax and In-Database Evaluation 1.2 Feature Engineering and Feature Selection in BigQuery ML 1.3 Generating Predictions with BigQuery ML 1.4 AutoML on Agent Platform: Tabular, Image, Text and Video Training 1.5 Fine-Tuning Gemini Models from BigQuery 1.6 Model Garden: Evaluating and Selecting the Right Model 1.7 Industry-Specific AI APIs: Document AI, Vision, Translate and Speech 1.8 Generative Media and Models as a Service: Gemini, Imagen and Veo 1.9 Optimizing Gemini Applications for Cost, Latency and Availability

3 Section 2: Collaborating Within and Across Teams to Manage Data and Models (~16%)

2.1 Organizing and Exploring Tabular, Text, Image and Video Data 2.2 Choosing the Preprocessing Tool: BigQuery, Dataflow, Spark and In-Memory Python 2.3 Creating and Consolidating Features in Agent Platform Feature Store 2.4 Data Privacy, PII Handling and Sensitive Information 2.5 Notebook Environments: Collaboration and Security Best Practices 2.6 Prototyping in Workbench and Colab Enterprise with PyTorch, scikit-learn and JAX 2.7 Prototyping with Model Garden Foundational and Open Models in Notebooks 2.8 Choosing the Development and Experimentation Environment 2.9 Evaluating Generative Solutions: LLM-as-a-Judge and RAG Evaluation 2.10 Experiment Tracking, Artifact Lineage and Model Registry Governance

4 Section 3: Scaling Prototypes into ML Models (~21%)

3.1 Choosing the Model Type: ARIMA, DNN, LLM and Classical Baselines 3.2 Choosing the Product: AutoML, BigQuery ML, Custom Training and Pipelines 3.3 Choosing the Deployment Strategy at Design Time 3.4 Modeling Techniques for Interpretability Requirements 3.5 Organizing Training Data on Cloud Storage and BigQuery 3.6 Ingesting Structured and Unstructured Data into Training Pipelines 3.7 Training SDKs and Services: Custom Training, Kubeflow on GKE, AutoML and Tabular Workflows 3.8 Troubleshooting ML Model Training Failures 3.9 Hyperparameter Tuning, Bayesian Optimization and Vizier 3.10 Model Evaluation Metrics, Transfer Learning and Fine-Tuning 3.11 Evaluating Compute and Accelerator Options: CPU, GPU and TPU 3.12 Distributed Training Strategies, Hardware Acceleration and Performance Optimization

5 Section 4: Serving and Scaling Models (~20%)

4.1 Batch and Online Inference: Agent Platform, Model Garden, Cloud Run and GKE 4.2 Rollout Strategies: Canary, Traffic Splitting, Shadow and Blue-Green 4.3 Tuning Models for Production: Vector Search and Model Compression 4.4 Deploying Models to Public and Private Endpoints 4.5 Choosing Serving Hardware: CPU, GPU, TPU and Edge 4.6 Scaling the Serving Backend for Throughput

6 Section 5: Automating and Orchestrating ML Pipelines (~18%)

5.1 Validating Data and Models Inside Pipelines 5.2 Agent Platform Pipelines: Kubeflow Pipelines (KFP) and TFX Architecture 5.3 Reusable Pipeline Components, Artifacts and ML Metadata Lineage 5.4 Ray on Agent Platform for Distributed Python Workloads 5.5 MLOps CI/CD Automation, Retraining Triggers and Skew Prevention

7 Section 6: Monitoring AI Solutions (~13%)

6.1 Securing AI Systems: Exfiltration, Malicious Prompting and Model Armor 6.2 Responsible AI, Explainable AI, Fairness Metrics and Model Governance 6.3 Model Monitoring: Feature Skew and Drift Detection 6.4 Operational Troubleshooting, Performance Profiling and Cost Optimization 6.5 Monitoring, Testing and Evaluating Generative AI in Production

6.2 Responsible AI, Explainable AI, Fairness Metrics and Model Governance

Key Takeaways Explain This Topic AI

Vertex Explainable AI provides feature attributions using three core algorithms: Sampled Shapley (game-theoretic attribution for tabular/tree models), Integrated Gradients (path integral of gradients for differentiable deep neural networks, image, and text), and XRAI (region-based segmentation attributions for computer vision).

Local Feature Attribution explains the specific feature contributions for an individual prediction (essential for adverse action notices and regulatory audits), whereas Global Feature Attribution aggregates attributions across a dataset to reveal overall model behavior.

Algorithmic fairness criteria evaluate distinct parity definitions: Demographic Parity enforces equal positive selection rates across protected groups, Equal Opportunity requires equal True Positive Rates (Recall), and Equalized Odds enforces equal True Positive and False Positive Rates.

Model Cards in Vertex AI Model Registry provide structured, standardized enterprise documentation detailing intended use cases, training dataset demographics, evaluation performance across protected demographic slices, and known operational limitations.

Enterprise ML governance and security on Google Cloud enforce perimeter security via VPC Service Controls (VPC-SC), data-at-rest encryption via Customer-Managed Encryption Keys (CMEK), and least-privilege access control via Cloud IAM role segregation.

Last updated: September 2026

6.2 Responsible AI, Explainable AI, Fairness Metrics and Model Governance

As artificial intelligence and machine learning systems increasingly influence critical decisions in healthcare, financial lending, criminal justice, hiring, and automated operations, technical performance metrics (such as high ROC-AUC or low RMSE) are no longer sufficient on their own. Machine learning engineers must design systems that are fair , interpretable , transparent , secure , and compliant with global regulatory frameworks (such as the EU AI Act, GDPR, and the US Equal Credit Opportunity Act).

Google Cloud provides a comprehensive suite of Responsible AI and Explainable AI (XAI) tools integrated directly into Vertex AI to help practitioners audit model behavior, mitigate algorithmic bias, generate human-interpretable feature attributions, document system capabilities via Model Cards, and enforce robust data governance perimeters.

1. Vertex Explainable AI: Feature Attribution Methods

Feature Attribution quantifies the relative positive or negative contribution of each input feature toward a model's final prediction score. Vertex Explainable AI natively supports three foundational attribution methods: +---------------------------------------------------------------------------------------------------------+

  • | VERTEX EXPLAINABLE AI METHODS |
  • +------------------------------------+------------------------------------+-------------------------------+
  • | SAMPLED SHAPLEY | INTEGRATED GRADIENTS | XRAI |
  • +------------------------------------+------------------------------------+-------------------------------+
  • | * Model Type: Tabular, Tree-based | * Model Type: Differentiable Deep | * Model Type: Computer Vision |
  • | (XGBoost, Scikit-learn, BQML) | Neural Networks (TF, PyTorch) | (Deep CNNs, Vision Transf.) |
  • | * Mechanism: Game-theoretic | * Mechanism: Path integral of | * Mechanism: Combines Integ- |
  • | marginal contributions | gradients along baseline path | rated Gradients with region |
  • | * Data Modality: Tabular / Numeric | * Data Modality: Tabular, Text, Img| segmentation (superpixels) |
  • +------------------------------------+------------------------------------+-------------------------------+
  • 1. Sampled Shapley

Rooted in cooperative game theory (Shapley values), Sampled Shapley treats each feature as a player in a collaborative game where the prediction is the total payout. It computes the marginal contribution of feature i i i across all possible feature subsets (coalitions): ϕ i ( v ) = ∑ S ⊆ N ∖ { i } ∣ S ∣ ! ( ∣ N ∣ − ∣ S ∣ − 1 ) ! ∣ N ∣ ! ( v ( S ∪ { i } ) − v ( S ) ) \phi_i(v) = \sum_{S \subseteq N \setminus \{i\}} \frac{|S|!(|N| - |S| - 1)!}{|N|!} \left( v(S \cup \{i\}) - v(S) \right) ϕ i ​ ( v ) = S ⊆ N ∖ { i } ∑ ​ ∣ N ∣ ! ∣ S ∣ ! ( ∣ N ∣ − ∣ S ∣ − 1 )! ​ ( v ( S ∪ { i }) − v ( S ) )

Strengths : Model-agnostic; works seamlessly on non-differentiable models such as Gradient Boosted Decision Trees, Random Forests, and ensemble pipelines.

Operational Consideration : Exact Shapley computation is exponential in the number of features ( O ( 2 ∣ N ∣ ) O(2^{|N|}) O ( 2 ∣ N ∣ ) ). Vertex Explainable AI uses Monte Carlo sampling to approximate Shapley values efficiently.

2. Integrated Gradients

Integrated Gradients (IG) is an axiomatic feature attribution method designed for differentiable neural networks (TensorFlow, Keras, PyTorch, JAX). It calculates the integral of the model's gradients along a straight linear interpolation path from a specified baseline x ′ x' x ′ to the input instance x x x : Attribution i ( x ) = ( x i − x i ′ ) × ∫ 0 1 ∂ F ( x ′ + α ( x − x ′ ) ) ∂ x i d α \text{Attribution}_i(x) = (x_i - x'_i) \times \int_{0}^{1} \frac{\partial F(x' + \alpha(x - x'))}{\partial x_i} d\alpha Attribution i ​ ( x ) = ( x i ​ − x i ′ ​ ) × ∫ 0 1 ​ ∂ x i ​ ∂ F ( x ′ + α ( x − x ′ )) ​ d α

Axiomatic Guarantees :

Completeness : The sum of attributions across all features equals the difference between the model output F ( x ) F(x) F ( x ) and the baseline output F ( x ′ ) F(x') F ( x ′ ) : ∑ i Attribution i ( x ) = F ( x ) − F ( x ′ ) \sum_i \text{Attribution}_i(x) = F(x) - F(x') ∑ i ​ Attribution i ​ ( x ) = F ( x ) − F ( x ′ ) .

Implementation Invariance : Two functionally identical neural networks produce identical attributions.

Operational Consideration : Highly scalable and accelerated by GPUs/TPUs. It requires setting the number of Riemann approximation steps (e.g., step_count=50 ).

3. XRAI (eXplanation with Ranked Area Integrals)

Standard pixel-level Integrated Gradients on images often produce noisy, speckled attribution maps that are difficult for human reviewers to interpret. XRAI resolves this by combining Integrated Gradients with graph-based image segmentation (e.g., Felzenszwalb's algorithm):

It over-segments the input image into contiguous, semantically meaningful regions (superpixels).

It integrates gradient attributions across these geometric regions and iteratively ranks the patches that contribute most significantly to the predicted class label.

Best Suited For : Computer vision models, medical radiology imaging, satellite imagery analysis.

Baseline Selection: The Critical Anchor

All feature attribution methods require comparing the input instance against a baseline (reference point) representing the absence of information:

Tabular Data : Median or mode values of the training dataset, or domain-specific neutral baselines (e.g., zero account balance).

Image Data : A solid black image, solid white image, or blurred/uniform noise image.

Text / NLP Data : A sequence of unk tokens, padding tokens, or an empty string.

Important

Baseline Selection Rule : The choice of baseline directly alters feature attribution scores. A poorly chosen baseline (e.g., an unrealistic all-zero vector for positive-only features) creates misleading attributions. Baselines should always represent a neutral, non-informative reference state.

2. Local vs. Global Feature Attribution +---------------------------------------------------------------------------------------------------------+

  • | LOCAL VS. GLOBAL FEATURE EXPLANATIONS |
  • +------------------------------------+--------------------------------------------------------------------+
  • | LOCAL FEATURE ATTRIBUTION | GLOBAL FEATURE ATTRIBUTION |
  • +------------------------------------+--------------------------------------------------------------------+
  • | * Explains an INDIVIDUAL inference | * Explains OVERALL model behavior across the entire dataset |
  • | * "Why was Applicant A denied a | * "Across all 100,000 customers, which features drive predictions |
  • | mortgage loan?" | most heavily?" |
  • | * Primary Use Case: Adverse action | * Primary Use Case: Model auditing, detecting proxy bias, |
  • | notices, customer recourse, | regulatory compliance reports, feature selection sanity checks |
  • | clinical diagnostic reasoning | |
  • +------------------------------------+--------------------------------------------------------------------+

Local Explanations in Production : When deploying an endpoint with Explainable AI enabled, invoking the :explain API endpoint returns both the predicted probability and the local feature attribution dictionary for that specific transaction: {

  • "predictions": [{"churn_probability": 0.82}],
  • "explanations": [{
  • "attributions": [{
  • "baselineOutputValue": 0.15,
  • "instanceOutputValue": 0.82,
  • "featureAttributions": {
  • "monthly_charges": 0.42,
  • "contract_type_month_to_month": 0.21,
  • "customer_tenure_months": -0.15,
  • "support_tickets_count": 0.19
  • }
  • }]
  • }]
  • }
  • 3. Algorithmic Fairness Metrics & Bias Mitigation

Machine learning models trained on historical data can inadvertently learn, amplify, and perpetuate systemic societal biases against protected demographic groups (defined by attributes such as gender, race, age, religion, disability status, or geographic zip code). +---------------------------------------------------------------------------------------------------------+

  • | CORE ALGORITHMIC FAIRNESS METRICS |
  • +------------------------------------+------------------------------------+-------------------------------+
  • | FAIRNESS CRITERION | MATHEMATICAL FORMULATION | OPERATIONAL MEANING |
  • +------------------------------------+------------------------------------+-------------------------------+
  • | Demographic Parity | P(Y_hat=1 | A=0) = P(Y_hat=1 | A=1)| Equal acceptance rate across |
  • | (Statistical Parity) | | groups regardless of base rate|
  • +------------------------------------+------------------------------------+-------------------------------+
  • | Equal Opportunity | P(Y_hat=1 | Y=1, A=0) = | Equal True Positive Rate (TPR)|
  • | (True Positive Rate Parity) | P(Y_hat=1 | Y=1, A=1) | / Recall for qualified cohort |
  • +------------------------------------+------------------------------------+-------------------------------+
  • | Equalized Odds | P(Y_hat=1 | Y=y, A=0) = | Equal TPR AND equal False |
  • | (Separation) | P(Y_hat=1 | Y=y, A=1) for y in {0,1}| Positive Rate (FPR) |
  • +------------------------------------+------------------------------------+-------------------------------+
  • | Disparate Impact (4/5ths Rule) | P(Y_hat=1 | A=0) / P(Y_hat=1 | A=1)| Ratio of selection rates must |
  • | | >= 0.80 | exceed 80% under US EEOC law |
  • +------------------------------------+------------------------------------+-------------------------------+
  • Fairness Metric Decision Guide

Demographic Parity : Assumes historical base rate differences are entirely due to systemic historical bias and demands equal positive outcomes across all demographic slices. (Trade-off: May penalize overall model accuracy if underlying true label rates differ legitimately).

Equal Opportunity : Preferred when the primary goal is ensuring that qualified individuals (where true label Y = 1 Y=1 Y = 1 , such as loan applicants who will repay) have an equal probability of being approved regardless of demographic group A A A .

What-If Tool & Fairness Indicators : Integrated into Vertex AI and TensorFlow Extended (TFX) to visualize sliced performance, test counterfactual scenarios (e.g., "What if this applicant's zip code changed?"), and adjust decision thresholds per demographic group to enforce selected fairness criteria.

4. Model Governance: Model Cards in Vertex AI

To establish transparent organizational governance and comply with AI audit regulations, the Vertex AI Model Registry supports structured Model Cards based on Google's published Model Card framework. +---------------------------------------------------------------------------------------------------------+

  • | VERTEX AI MODEL CARD STRUCTURE |
  • +------------------------------------+--------------------------------------------------------------------+
  • | SECTION | CORE CONTENTS |
  • +------------------------------------+--------------------------------------------------------------------+
  • | 1. Model Details | Model name, version, architecture, owner, date, license |
  • | 2. Intended Use & Limitations | Intended primary use cases, out-of-scope tasks, known failure modes|
  • | 3. Training & Evaluation Data | Demographics, data sources, preprocessing, slice distributions |
  • | 4. Sliced Quantitative Analyses | Metrics (F1, AUC, PR) broken down across sensitive demographic subgroups|
  • | 5. Ethical Considerations & Safety | Mitigations applied, fairness criteria evaluated, privacy controls |
  • +------------------------------------+--------------------------------------------------------------------+

Model Cards transform models from "black boxes" into auditable enterprise assets, ensuring compliance teams and external regulators can verify model limitations before production deployment.

5. Enterprise Security, Privacy & Data Governance on GCP

Production ML systems must operate within strict enterprise security and data privacy boundaries: +---------------------------------------------------------------------------------------------------------+

  • | GCP ML SECURITY & GOVERNANCE PERIMETER |
  • +---------------------------------------------------------------------------------------------------------+
  • | |
  • | +-------------------------------------------------------------------------------------------------+ |
  • | | VPC Service Controls (VPC-SC) Perimeter | |
  • | | | |
  • | | +-----------------------+ Private Google Access +----------------------------------+ | |
  • | | | Cloud Storage Data | ===========================> | Vertex AI Custom Training / | | |
  • | | | & BigQuery Warehouse | (Zero Public Internet) | Online Prediction Endpoints | | |
  • | | +-----------------------+ +----------------------------------+ | |
  • | | | | | |
  • | | +-----------------------------+------------------------------+ | |
  • | | | | |
  • | | v | |
  • | | +---------------------------------------------+ | |
  • | | | Cloud KMS (Customer-Managed Encryption Keys)| | |
  • | | | - Encrypts training data, pipeline artifacts| | |
  • | | | - Encrypts model weights at rest | | |
  • | | +---------------------------------------------+ | |
  • | +-------------------------------------------------------------------------------------------------+ |
  • | |
  • | +-------------------------------------------------------------------------------------------------+ |
  • | | Cloud IAM Role Segregation: Least-Privilege Access | |
  • | | - `roles/aiplatform.viewer`: Read-only inspection of Model Registry and Experiments | |
  • | | - `roles/aiplatform.user`: Submit custom jobs and run batch predictions | |
  • | | - `roles/aiplatform.admin`: Full administrative control over endpoints, models, and metadata | |
  • | +-------------------------------------------------------------------------------------------------+ |
  • +---------------------------------------------------------------------------------------------------------+

VPC Service Controls (VPC-SC) : Establishes a security perimeter around Vertex AI, Cloud Storage, and BigQuery to prevent data exfiltration by malicious insiders or compromised service accounts.

Customer-Managed Encryption Keys (CMEK) : Integrates Cloud Key Management Service (Cloud KMS) to ensure that all training datasets, pipeline intermediate artifacts, and exported model binaries are encrypted with enterprise-managed cryptographic keys.

Cloud IAM Role Segregation : Adheres to the principle of least privilege, preventing unauthorized model deployment or metadata tampering.

Loading diagram... Responsible AI, Explainability, Fairness & Governance Architecture