12. Model Monitoring, Tracking, and Auditing Metadata Flashcards

1
Q

What are two types of drifts?

A

Concept drift
Data drift

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is concept drift?

A

The relationship between input variables and predicted variables change.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you prevent model deterioration?

A

Model monitoring, i.e., monitor input data and evaluate the model with the same metrics during the training phase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is data drift?

A

Input data change, e.g., statistical distribution, schema, feature definition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What can Vertex AI model monitoring monitor?

A

Training-serving skew: Feature distribution differences between production and training.
Prediction drift: Input’s statistical distribution changes in production over time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two types of data that can be monitored?

A

Categorical features and numerical values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you calculate baselines?

A

Baseline for skew detection: The statistical distribution of the feature’s values in the training data
Baseline for drift detection: The statistical distribution of the feature’s values in the production data (recent past)
Distribution calculations for categorical and numerical features (bin): The count or percentage of instances of each possible value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How does Vertex AI monitor drift and skew?

A

It compares the baselines and the equivalent latest values in the production.
Categorical features: L-infinity distance
Numerical features: Jensen-Shannon divergence
Vertex AI takes as an anomaly if the distance score hits a pre-defined threshold.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the factors for effective monitoring?

A

Sampling rate
Monitoring frequency
Alerting thresholds
Number of models in an endpoint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you monitor input schemas?

A

The input values are part of the payload of the prediction requests. You can specify a schema when you configure model monitoring.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the two types of schema?

A

Automatic schema: Model monitoring will analyze and detect the schema.
Custom schema: User specified in Open API format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the three types of schema formats?

A

Object: key/value pairs
Array: array-like format
String: csv-string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the reason for logging?

A

Monitor input trends
Auditing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the models supported by Vertex AI logging?

A

AutoML models (tabular & image)
Custom-trained models
Logging can be enabled during model deployment or endpoint creation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the three types of logging?

A

Container Logging: stdout and stderr for debugging
Access Logging: Time stamp and latency for each request to Cloud Logging
Request-Response Logging: sample of the online prediction requests and responses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where can you change log settings?

A

Create an endpoint
deploy a model to an endpoint

10
Q

What is parameters, artifacts and metrics of an ML experiment called?

A

Metadata

11
Q

What are the limitations for model monitoring and logging?

A

Both services use BigQuery table
Model monitoring is enabled, you can’t enable request-response logging.
Request-response logging is enabled first, then model monitoring. The request-response logging can’t be modified.

12
Q

What are the uses of metadata?

A

Detect model degradation
Compare different sets of hyperparameters
Track the lineage of the ML artifacts
Rerun an ML workflow with the same parameters
Track downstream usage of artifacts for audit purposes

Hints: Whales Dive, Humpbacks Love Abyss.

13
Q

What is Metadata store?

A

It is the top-level container for all the metadata resources, i.e., one by organization

14
Q

How do you manage ML Metadataschema?

A

Most common types of resources stored have predefined schemas called system schemas.

14
Q

What are Metadata resources?

A

Artifacts: Pieces of data created by or consumed by an ML workflow, e.g., datasets, models, input files, training logs, metrics
Context: A group of artifacts and executions that can be queried for identifying the best model.
Execution: A step in a ML workflow.
Events: An event connects artifacts and executions.
Metadataschema: Specifies the schema to be used by the particular types of data like artifact or execution.

Hints: Apples Can Entertain Every Monkey.

15
Q

What are the functions of Vertex AI Experiments?

A

Track the steps for an experiment run (preprocessing, embedding, training)
Track input like algorithms, hyperparameters, dataset, etc.
Track output of these steps like models, metrics, checkpoints, etc

15
Q

What are automatically generated when you use Vertex AI Pipelines?

A

The model metadata and artifacts are automatically stored in the metadata store for lineage tracking, e.g., dataset summary, model evaluation metrics, metadata on certain executions.

16
Q

How do you use Vertex AI Debugging?

A

Install interactive Bash shell in the training container
Run the custom training
Make sure the user having right permissions
Enable enableWebAccess API
You can use interactive shell to do the followings:
Check permission
Visualize Python execution with profiling tools
Analyze performance of training node using Perf
Check CPU or GPU usage