[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/architecture/framework/perspectives/ai-ml/performance-optimization [Back]  [Original]

AI and ML perspective: Performance optimization  |  Cloud Architecture Center  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

AI and ML perspective: Performance optimization Stay organized with collections Save and categorize content based on your preferences.

Last reviewed 2026-02-13 UTC

This document in the Google Cloud Well-Architected Framework: AI and ML perspective provides principles and recommendations to help you optimize the performance of your AI and ML workloads on Google Cloud. The recommendations in this document align with the performance optimization pillar of the Well-Architected Framework.

AI and ML systems enable advanced automation and decision-making capabilities for your organization. The performance of these systems can directly affect important business drivers like revenue, costs, and customer satisfaction. To realize the full potential of AI and ML systems, you must optimize their performance based on your business goals and technical requirements. The performance optimization process often involves trade-offs. For example, a design choice that provides the required performance might lead to higher costs. The recommendations in this document prioritize performance over other considerations.

To optimize AI and ML performance, you need to make decisions regarding factors like the model architecture, parameters, and training strategy. When you make these decisions, consider the entire lifecycle of the AI and ML systems and their deployment environment. For example, very large LLMs can be highly performant on massive training infrastructure, but might not perform well in capacity-constrained environments like mobile devices.

The recommendations in this document are mapped to the following core principles:

Establish performance objectives and evaluation methods

Your business strategy and goals are the foundation for leveraging AI and ML technologies. Translate your business goals into measurable key performance indicators (KPIs). Examples of KPIs include total revenue, costs, conversion rate, retention or churn rate, customer satisfaction, and employee satisfaction.

Define realistic objectives

According to site reliability engineering (SRE) best practices, the objectives of a service must reflect a performance level that satisfies the requirements of typical customers. This means that service objectives must be realistic in terms of scale and feature performance.

Unrealistic objectives can lead to wasted resources for minimal performance gains. Models that provide the highest performance might not lead to optimal business outcomes. Such models might require more time and cost to train and run.

When you define objectives, distinguish between and prioritize quality and performance objectives:

ML engineers can improve the performance metrics of a model during the training process. Gemini Enterprise Agent Platform provides an evaluation service that ML engineers can use to implement standardized and repeatable tracking of quality metrics. The prediction efficiency of a model indicates how well a model performs in production or at inference time. To monitor performance, use Cloud Monitoring and Model Monitoring on Gemini Enterprise Agent Platform. To select appropriate models and decide how to train them, you must translate business goals into technical requirements that determine quality and performance metrics.

To understand how to set realistic objectives and identify appropriate performance metrics, consider the following example for an AI-powered fraud detection system:

Monitor performance at all stages of the model lifecycle

During experimentation and training and after model deployment, monitor your KPIs and observe any deviations from the business objectives. A comprehensive monitoring strategy helps you make critical decisions about model quality and resource utilization, such as the following:

Monitoring during experimentation and training

The objective of the experimentation stage is to find the optimal overall approach, model architecture, and hyperparameters for a specific task. Experimentation helps you iteratively determine the configuration that provides optimal performance and how to train the model. Monitoring helps you efficiently identify potential areas of improvement.

To monitor a model's quality and training efficiency, ML engineers must do the following:

To monitor experimentation and training, consider the following recommendations:

Monitoring aspect Recommendation
Model quality

To visualize and track experiment metrics like accuracy and to visualize model architecture or training data, use TensorBoard. TensorBoard is an open-source suite of tools that's compatible with ML frameworks like the following:

Experiment tracking Experiments on Gemini Enterprise Agent Platform integrates with managed enterprise-grade Vertex AI TensorBoard instances to support experiment tracking. This integration enables reliable storage and sharing of logs and metrics. To let multiple teams and individuals track experiments, we recommend that you use the principle of least privilege.
Training and experimentation efficiency Agent Platform exports metrics to Monitoring and collects telemetry data and logs by using an observability agent. You can visualize the metrics in the Google Cloud console. Alternatively, create dashboards or alerts based on these metrics by using Monitoring. For more information, see Monitoring metrics for Agent Platform.
NVIDIA GPUs

The Ops Agent enables GPU monitoring for Compute Engine and for other products that Ops Agent supports.

You can also use the NVIDIA Data Center GPU Manager (DCGM), which is a suite of tools for managing and monitoring NVIDIA GPUs in cluster environments. Monitoring NVIDIA GPUs is particularly useful for training and serving deep learning models.

Deep debugging To debug problems with the training code or the configuration of a Gemini Enterprise Agent Platform Managed Training job, you can inspect the training container by using an interactive shell session.

Monitoring during serving: Streaming prediction

After you train a model and export it to Model Registry on Gemini Enterprise Agent Platform, you can create a Agent Platform endpoint. This endpoint provides an HTTP endpoint for the model.

Model Monitoring on Agent Platform helps you identify large changes in the distribution of input or output features. You can also monitor feature attributions in production when compared to a baseline distribution. The baseline distribution can be the training set or it can be based on past distributions of production traffic. A change in the serving distribution might imply a reduction in predictive performance compared to training.

Monitoring during serving: Batch prediction

To monitor batch prediction, you can run standard evaluation jobs in the Agent Platform evaluation service. Model Monitoring on Agent Platform supports monitoring of batch inferences. If you use Batch to run your serving workload, you can monitor resource consumption by using the metrics in Metrics Explorer.

Automate evaluation for reproducibility and standardization

To transition models from prototypes to reliable production systems, you need a standardized evaluation process. This process helps you track progress across iterations, compare different models, detect and mitigate bias, and ensure that you meet regulatory requirements. To ensure reproducibility and scalability, you must automate the evaluation process.

To standardize and automate the evaluation process for ML performance, complete the following steps:

  1. Define quantitative and qualitative indicators.
  2. Choose appropriate data sources and techniques.
  3. Standardize the evaluation pipeline.

These steps are described in the following sections.

1. Define quantitative and qualitative indicators

Computation-based metrics are calculated by using numeric formulas. Remember that training loss metrics might differ from the evaluation metrics that are relevant to business goals. For example, a model that's used for supervised fraud detection might use cross-entropy loss for training. However, to evaluate inference performance, a more relevant metric might be recall, which indicates the coverage of fraudulent transactions. Agent Platform provides an evaluation service for metrics like recall, precision, and area under the precision-recall curve (AuPRC). For more information, see Model evaluation in Agent Platform.

Qualitative indicators, such as the fluency or entertainment value of generated content, can't be objectively computed. To evaluate these indicators, you can use the LLM-as-a-judge strategy or human labeling services like Labelbox.

2. Choose appropriate data sources and techniques

An evaluation is statistically significant when it runs on a certain minimum volume of varied examples. Choose the datasets and techniques that you use for evaluations by using approaches such as the following:

Depending on the evaluation technique, size and type of evaluation data, and frequency of evaluation, you can use BigQuery or Cloud Storage as data sources, including for the Agent Platform evaluation service.

3. Standardize the evaluation pipeline

To automate the evaluation process, consider the following services and tools:

Run and track frequent experiments

To effectively optimize ML performance, you need a dedicated, powerful, and interactive platform for experimentation. The platform must have the following capabilities:

Treat data as a service

Isolate experimental workloads from production systems and set up appropriate security controls for your data assets by using the following techniques:

Technique Description Benefits
Resource isolation Isolate the resources for different environments in separate Google Cloud projects. For example, provision the resources for development, staging, and production environments in separate projects like ml-dev, ml-staging, and ml-prod. Resource isolation helps to prevent experimental workloads from consuming resources that production systems need. For example, if you use a single project for experiments and production, an experiment might consume all of the available NVIDIA A100 GPUs for Agent Platform Managed Training. This might cause interruptions in the retraining of a critical production model.
Identity and access control Apply the principles of zero trust and least privilege and use workload-specific service accounts. Grant access by using predefined Identity and Access Management (IAM) roles like Agent Platform User (roles/aiplatform.user). This approach helps to prevent accidental or malicious actions that might corrupt experiments.
Network security Isolate network traffic by using Virtual Private Cloud (VPC) networks and enforce security perimeters by using VPC Service Controls. This approach helps to protect sensitive data and prevents experimental traffic from affecting production services.
Data isolation Store experimental data in separate Cloud Storage buckets and BigQuery datasets. Data isolation prevents accidental modification of production data. For example, without data isolation, an experiment might inadvertently alter the feature values in a shared BigQuery table, which might lead to a significant degradation in model accuracy in the production environment.

Equip teams with appropriate tools

To establish a curated set of tools to accelerate the entire experimentation lifecyclefrom data exploration to model training and analysisuse the following techniques:

Standardize for reproducibility and efficiency

To ensure that experiments consume resources efficiently and produce consistent and trustworthy results, standardize and automate experiments by using the following approaches:

Build and automate training and serving infrastructure

To train and serve AI models, set up a robust platform that supports efficient and reliable development, deployment, and serving. This platform lets your teams efficiently improve the quality and performance of training and serving in the long run.

Use specialized components for training

A reliable training platform helps to accelerate performance and provides a standardized approach to automate repeatable tasks in the ML lifecyclefrom data preparation to model validation.

Use specialized infrastructure for prediction

To reduce the toil of managing infrastructure and model deployments, automate the repeatable task flows. A service-oriented approach lets you focus on speed and faster time to value (TTV). Consider the following recommendations:

Recommendation Techniques
Implement automatic deployment.
  • After a model is trained, use automation to deploy the model. Agent Platform Pipelines provides specialized components for deploying models to Agent Platform endpoints. You can manage automatic deployment by using Kubeflow Control Flows.
  • To decide whether to deploy a model based on an evaluation against a validation set, take advantage of the evaluation components of the pipeline. You can automate deployment for batch inference by using specialized batch prediction components in Agent Platform.
Take advantage of managed scaling features.
Optimize latency and throughput on Agent Platform endpoints.
Optimize resource utilization.
Optimize model deployment.
Monitor performance.
  • To improve serving performance in production, observe logs and inference metrics for Agent Platform endpoints. To understand the behavior of models in production, you need tools to monitor quality and performance. Model Monitoring on Agent Platform v2 lets you monitor several versions of a model and iterate rapidly.

Match design choices to performance requirements

When you make design choices to improve performance, assess whether the choices support your business requirements or are wasteful and counterproductive. To choose appropriate infrastructure, models, and configurations, identify performance bottlenecks and assess how they're linked to performance metrics. For example, even on very powerful GPU accelerators, training tasks can experience performance bottlenecks. These bottlenecks can be caused by data I/O issues in the storage layer or by performance limitations of the model.

Focus on holistic performance of the ML flow

As training requirements grow in terms of model size and cluster size, the failure rate and infrastructure costs might increase. Therefore, the cost of failure might increase quadratically. You can't rely solely on conventional resource-efficiency metrics like model FLOPs utilization (MFU). To understand why MFU might not be a sufficient indicator of overall training performance, examine the lifecycle of a typical training job. The lifecycle consists of the following cyclical flow:

  1. Cluster creation: Worker nodes are provisioned.
  2. Initialization: Training is initialized on the worker nodes.
  3. Training execution: Resources are used for forward or backward propagation.
  4. Interruption: The training process is interrupted during model checkpointing or due to worker-node preemptions.

After each interruption, the preceding flow is repeated.

The training execution step constitutes a fraction of the lifecycle of an ML job. Therefore, the utilization of worker nodes for the training execution step doesn't indicate the overall efficiency of the job. For example, even if the training execution step runs at 100% efficiency, the overall efficiency might be low if interruptions occur frequently or if it takes a long time to resume training after interruptions.

Adopt and track goodput metrics

To ensure holistic performance measurement and optimization, shift your focus from conventional resource-efficiency metrics like MFU to goodput. Goodput considers the availability and utilization of your clusters and compute resources and it helps to measure resource efficiency across multiple layers.

The focus of goodput metrics is the overall progress of a job rather than whether the job appears to be busy. Goodput metrics help you optimize training jobs for tangible overall gains in productivity and performance.

Goodput gives you a granular understanding of potential losses in efficiency through the following metrics:

Optimize scheduling goodput

To optimize scheduling goodput for a workload, you must identify the specific infrastructure requirements of the workload. For example, batch inference, streaming inference, and training have different requirements:

Choose appropriate obtainability modes

In cloud computing, obtainability is the ability to provision resources when they're required. Google Cloud provides the following obtainability modes:

The following table summarizes the obtainability modes for Google Cloud services and provides links to relevant documentation:

Product On-demand VMs Spot VMs Reservations Dynamic Workload Scheduler
Compute Engine Create and start a Compute Engine instance About Spot VMs About reservations Create a MIG with GPU VMs
GKE Add and manage node pools About Spot VMs in GKE Consuming reserved zonal resources GPU, TPU, and H4D consumption with flex-start provisioning
Cloud Batch Create and run a job Batch job with Spot VMs Ensure resource availability using VM reservations Use GPUs and flex-start VMs
Agent Platform Managed Training Create a serverless training job Use Spot VMs for training jobs Use reservations for training jobs Schedule training jobs based on resource availability
Agent Platform Get batch inferences and online inferences from custom-trained models. Use Spot VMs for inference Use reservations for online inference Use flex-start VMs for inference
Plan for maintenance events

You can improve scheduling goodput by anticipating and planning for infrastructure maintenance and upgrades.

Optimize runtime goodput

The model training process is frequently interrupted by events like model checkpointing and resource preemption. To optimize runtime goodput, you must ensure that the system resumes training and inference efficiently after the required infrastructure is ready and after any interruption.

During model training, AI researchers use checkpointing to track progress and minimize the learning lost due to resource preemptions. Larger model sizes make checkpointing interruptions longer, which further affects overall efficiency. After interruptions, the training application must be restarted on every node in the cluster. These restarts can take some time because the necessary artifacts must be reloaded.

To optimize runtime goodput, use the following techniques:

Technique Description
Implement automatic checkpointing.

Frequent checkpointing lets you track the progress of training at a granular level. However, the training process is interrupted for each checkpoint, which reduces runtime goodput. To minimize interruptions, you can set up automatic checkpointing, where the host's SIGTERM signal triggers the creation of a checkpoint. This approach limits checkpointing interruptions to when the host needs maintenance. Remember that some hardware failures might not trigger SIGTERM signals; therefore, you must find a suitable balance between automatic checkpointing and SIGTERM events.

You can set up automatic checkpointing by using the following techniques:

Use appropriate container-loading strategies.

In a GKE cluster, before nodes can resume training jobs, it might take some time to complete loading the required artifacts like data or model checkpoints. To reduce the time that's required to reload data and resume training, use the following techniques:

For more information about how to reduce the data reload time, see Tips and tricks to reduce cold-start latency on GKE.

Use the compilation cache. If training requires a compilation-based stack, check whether you can use a compilation cache. When you use a compilation cache, the computation graph isn't recompiled after each training interruption. The resulting reductions in time and cost are particularly beneficial when you use TPUs. JAX lets you store the compilation cache in a Cloud Storage bucket and then use the cached data in the case of interruptions.

Optimize program goodput

Program goodput represents peak resource utilization during training, which is the conventional way to measure training and serving efficiency. To improve program goodput, you need an optimized distribution strategy, efficient compute-communication overlap, optimized memory access, and efficient pipelines.

To optimize program goodput, use the following strategies:

Strategy Description
Use framework-level customization options. Frameworks or compilers like Accelerated Linear Algebra (XLA) provide many key components of program goodput. To further optimize performance, you can customize fundamental components of the computation graph. For example, Pallas supports custom kernels for TPUs and GPUs.
Offload memory to the host DRAM. For large-scale training, which requires significantly high memory from accelerators, you can offload some memory usage to the host DRAM. For example, XLA lets you offload model activations from the forward pass to the host memory instead of using the accelerator's memory. With this strategy, you can improve training performance by increasing the model capacity or the batch size.
Leverage quantization during training.

You can improve training efficiency and program goodput by leveraging model quantization during training. This strategy reduces the precision of the gradients or weights during certain steps of the training; therefore, program goodput improves. However, this strategy might require additional engineering effort during model development.

For more information, see the following resources:

Implement parallelism.

To increase the utilization of the available compute resources, you can use parallelism strategies at the model level during training and when loading data.

For information about model parallelism, see the following:

To achieve data parallelism, you can use tools like the following:

Focus on workload-specific requirements

To ensure that your performance optimization efforts are effective and holistic, you must match optimization decisions to the specific requirements of your training and inference workloads. Choose appropriate AI models and use relevant prompt optimization strategies. Select appropriate frameworks and tools based on the requirements of your workloads.

Identify workload-specific requirements

Evaluate the requirements and constraints of your workloads across the following areas:

Area Description
Task and quality requirements

Define the core task of the workload and the performance baseline. Answer questions like the following:

  • Does the task involve regression, classification, or generation?
  • What is the minimum acceptable quality: for example, accuracy, precision, or recall?
Serving context

Analyze the operational environment where you plan to deploy the model. The serving context often has a significant impact on design decisions. Consider the following factors:

  • Latency: Does the system need real-time, synchronous predictions, or is an asynchronous, batch process acceptable?
  • Connectivity: Do you need to run the model offline or on an edge device?
  • Volume: What are the expected average and peak levels for prediction load? The load levels influence your decisions regarding scaling strategies and infrastructure.
Team skills and economics Assess the business value of buying the solution against the cost and complexity of building and maintaining it. Determine whether your team has the specialized skills that are required for custom model development or whether a managed service might provide faster time to value.

Choose an appropriate model

If an API or an open model can deliver the required performance and quality, use that API or model.

Improve quality through better prompting

To improve the quality of your prompts at scale, use the Agent Platform prompt optimizer. You don't need to manually rewrite system instructions and prompts. The prompt optimizer supports the following approaches:

For more prompt-optimization guidelines, see Overview of prompting strategies.

Improve performance for ML and generative AI endpoints

To improve the latency or throughput (tokens per second) for ML and generative AI endpoints, consider the following recommendations:

Use low-code solutions and tuning

If pre-trained models don't meet your requirements, you can improve their performance for specific domains by using the solutions:

Optimize self-managed training

In some cases, you might decide to retrain a model or fully manage a fine-tuning job. This approach requires advanced skills and additional time depending on the model, framework, and resources that you use.

Take advantage of performance-optimized framework options, such as the following:

Build training architectures and strategies that optimize performance by using the following techniques:

Optimize self-managed serving

For self-managed serving, you need efficient inference operations and a high throughput (number of inferences per unit of time).

To optimize your model for inference, consider the following approaches:

Use inference-optimized frameworks, such as the following:

Optimize resource consumption based on performance goals

Resource optimization helps to accelerate training, iterate efficiently, improve model quality, and increase the serving capacity.

Choose appropriate processor types

Your choice of compute platform can have a significant impact on the training efficiency of a model.

Optimize training and serving on GPUs

To optimize the performance of training and inference workloads that are deployed on GPUs, consider the following recommendations:

Recommendation Description
Select appropriate memory specifications. When you choose GPU machine types, select memory specifications based on the following factors:
  • Model capacity: The total memory size (memory footprint) of the model's trainable parameters and gradients.
  • Workload type: Training requires more memory than serving.
  • Training batch size: For larger batches, more activations are stored and the memory requirement is higher.
  • Data type: Workloads that process high-quality images or that use high-precision arithmetics need machine types with larger memory specifications.
Assess core and memory bandwidth requirements. In addition to memory size, consider other requirements like the number of Tensor cores and memory bandwidth. These factors influence the speed of data access and computations on the chip.
Choose appropriate GPU machine types.

Training and serving might need different GPU machine types.

  • Training jobs need one or more GPUs, or even multiple nodes, with significantly large memory and bandwidth.
  • Inference workloads require relatively less memory and fewer high-performance GPUs.

We recommend that you use large machine types for training and smaller, cost-effective machine types for inference. To detect resource utilization issues, use monitoring tools like the NVIDIA DCGM agent and adjust resources appropriately.

Leverage GPU sharing on GKE.

Dedicating a full GPU to a single container might be an inefficient approach in some cases. To help you overcome this inefficiency, GKE supports the following GPU-sharing strategies:

To maximize resource utilization, we recommend that you use an appropriate combination of these strategies. For example, when you virtualize a large H100 GPU by using the GPU time-sharing and multi-instance GPU strategies, the serving platform can scale up and down based on traffic. GPU resources are repurposed in real time based on the load on the model containers.

Optimize routing and load balancing. When you deploy multiple models on a cluster, you can use GKE Inference Gateway for optimized routing and load balancing. Inference Gateway extends the routing mechanisms of the Kubernetes Gateway API by using the following capabilities:
Share resources for Agent Platform endpoints. You can configure multiple Agent Platform endpoints to use a common pool of resources. For more information about this feature and its limitations, see Share resources across deployments.

Optimize training and serving on TPUs

TPUs are Google chips that help solve massive scale challenges for ML algorithms. These chips provide optimal performance for AI training and inference workloads. When compared to GPUs, TPUs provide higher efficiency for deep learning training and serving. For information about the use cases that are suitable for TPUs, see When to use TPUs. TPUs are compatible with ML frameworks like TensorFlow, PyTorch, and JAX.

To optimize TPU performance, use the following techniques, which are described in the Cloud TPU performance guide:

Optimize training on TPUs and serving on GPUs

TPUs support efficient training. GPUs provide versatility and wider availability for inference workloads. To combine the strengths of TPUs and GPUs, you can train models on TPUs and serve them on GPUs. This approach can help to reduce overall costs and accelerate development, particularly for large models. For information about the locations where TPU and GPU machine types are available, see TPU regions and zones and GPU locations.

Optimize the storage layer

The storage layer of your training and serving infrastructure is critical to performance. Training jobs and inferencing workloads involve the following storage-related activities:

The following factors determine your requirements for storage capacity, bandwidth, and latency:

If your training data is in Cloud Storage, you can reduce the data loading latency by using file caching in Cloud Storage FUSE. Cloud Storage FUSE lets you mount a Cloud Storage bucket on compute nodes that have Local SSD disks. For information about improving the performance of Cloud Storage FUSE, see Performance tuning best practices.

A PyTorch connector to Cloud Storage provides high performance for data reads and writes. This connector is particularly beneficial for training with large datasets and for checkpointing large models.

Compute Engine supports various Persistent Disk types. With Google Cloud Hyperdisk ML, you can provision the required throughput and IOPS based on training needs. To optimize disk performance, start by resizing the disks and then consider changing the machine type. For more information, see Optimize Persistent Disk performance. To load test the read-write performance and latency at the storage layer, you can use tools like Flexible I/O tester (FIO).

For more information about choosing and optimizing storage services for your AI and ML workloads, see Overview of storage services for AI and ML workloads in AI Hypercomputer.

Optimize the network layer

To optimize the performance of AI and ML workloads, configure your VPC networks to provide adequate bandwidth and maximum throughput with minimum latency. Consider the following recommendations:

Recommendation Suggested techniques for implementation
Optimize VPC networks.
Place VMs closer to each other.
Configure VMs to support higher network speeds.

To innovate, troubleshoot, and investigate performance issues, you must establish a clear link between design choices and performance outcomes. You need a reliable record of the lineage of ML assets, deployments, model outputs, and the corresponding configurations and inputs that produced the outputs.

Build a data and model lineage system

To reliably improve performance, you need the ability to trace every model version back to the exact data, code, and configurations that were used to produce the model. As you scale a model, such tracing becomes difficult. You need a lineage system that automates the tracing process and creates a record that's clear and can be queried for every experiment. This system lets your teams efficiently identify and reproduce the choices that lead to the optimally performing models.

To view and analyze the lineage of pipeline artifacts for workloads in Agent Platform, you can use Vertex ML Metadata or Knowledge Catalog. Both options let you register events or artifacts to meet governance requirements and to query the metadata and retrieve information when needed. This section provides an overview of the two options. For detailed information about the differences between Vertex ML Metadata and Knowledge Catalog, see Track the lineage of pipeline artifacts.

Default implementation: Vertex ML Metadata

Your first pipeline run or experiment in Agent Platform creates a default Vertex ML Metadata service. The parameters and artifact metadata that the pipeline consumes and generates are automatically registered to a Vertex ML Metadata store. The data model that's used to organize and connect the stored metadata contains the following elements:

By default, Vertex ML Metadata captures and tracks all input and output artifacts of a pipeline run. It integrates these artifacts with Experiments on Agent Platform, Model Registry, and Agent Platform managed datasets.

Autologging is a built-in feature in Agent Platform Managed Training to automatically log data to Experiments on Agent Platform. To efficiently track experiments for optimizing performance, use the built-in integrations between Experiments on Agent Platform and the associated Vertex ML Metadata service.

Vertex ML Metadata provides a filtering syntax and operators to run queries about artifacts, executions, and contexts. When required, your teams can efficiently retrieve information about a model's registry link and its dataset or evaluation for a specific experiment run. This metadata can help to accelerate the discovery of choices that optimize performance. For example, you can compare pipeline runs, compare models, and compare experiment runs. For more information, including example queries, see Analyze Vertex ML Metadata.

Alternative implementation: Knowledge Catalog

Knowledge Catalog discovers metadata from Google Cloud resources, including Agent Platform artifacts. You can also integrate a custom data source.

Knowledge Catalog can read metadata across multiple regions and organization-wide stores, whereas Vertex ML Metadata is a project-specific resource. When compared to Vertex ML Metadata, Knowledge Catalog involves more setup effort. However, Knowledge Catalog might be appropriate when you need integration with your wider data portfolio in Google Cloud and with organization-wide stores.

Knowledge Catalog discovers and harvests metadata for projects where the Data Lineage API is enabled. The metadata in the catalog is organized by using a data model that consists of projects, entry groups, entries, and aspects. Knowledge Catalog provides a specific syntax that you can use to discover artifacts. If required, you can map Vertex ML Metadata artifacts to Knowledge Catalog.

Use explainability tools

The behavior of an AI model is based on data that was used to train the model. This behavior is encoded as parameters in mathematical functions. Understanding exactly why a model performs in a certain way can be difficult. However, this knowledge is critical for performance optimization.

For example, consider an image classification model where the training data contains images of only red cars. The model might learn to identify the "car" label based on the color of the object rather than the object's spatial and shape attributes. When the model is tested with images that show cars of different colors, the performance of the model might degrade. The following sections describe tools that you can use to identify and diagnose such problems.

Detect data biases

In the exploratory data analysis (EDA) phase of an ML project, you identify issues with the data, such as class-imbalanced datasets and biases.

In production systems, you often retrain models and run experiments with different datasets. To standardize data and compare across experiments, we recommend a systematic approach to EDA that includes the following characteristics:

Many EDA tasks are specific to the data type and the business context. To automate the EDA process, use BigQuery or a managed data processing service like Dataflow. For more information, see Classification on imbalanced data and Data bias metrics for Agent Platform.

Understand model characteristics and behavior

In addition to understanding the distribution of data in the training and validation sets and their biases, you need to understand a model's characteristics and behavior at prediction time. To understand model behavior, use the following tools:

Tool Description Purposes
Example-based explanations You can use example-based explanations in Vertex Explainable AI to understand a prediction by finding the most similar examples from the training data. This approach is based on the principle that similar inputs yield similar outputs.
  • Identify and fix gaps in the training data by finding similar examples for an incorrect prediction.
  • Classify inputs that the model was not originally trained to recognize, by using neighbors from a reference set.
  • Identify anomalies by finding inputs that are significantly different from all of the known training examples.
  • Make data collection more efficient by identifying ambiguous cases, like when neighbors have mixed labels. Prioritize such cases for human review.
Feature-based explanations

For predictions that are based on tabular data or images, feature-based explanations show how much each feature affects a prediction when it's compared to a baseline.

Vertex Explainable AI provides different feature attribution methods depending on the model type and task. The methods typically rely on sampling and sensitivity analysis to measure how much the output changes in response to changes in an input feature.

  • Identify biases that a validation step might miss.
  • Optimize performance by identifying the features that are most important for a prediction. To increase a model's quality and performance, ML engineers can intentionally add, remove, or engineer features.
What-If Tool The What-If Tool was developed by Google's People + AI Research (PAIR) initiative to help you understand and visualize the behavior of image and tabular models. For examples of using the tool, see What-If Tool Web Demos.
  • Debug and find the root cause of incorrect predictions.
  • Investigate how a model performs across different subsets of data by identifying biases through a fairness analysis.
  • Understand a model's behavior, particularly the relationship between a model's predictions and input features.
  • Compare predictions by using a visual comparison tool that requires either two models or a ground truth baseline.

Contributors

Authors:

Other contributors:

Cost optimization
Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-13 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-02-13 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page