Skip to content

Professional Machine Learning Engineer · Domain 5: Automating and orchestrating ML pipelines · 18% of the exam

Task 5.2: Automating model retraining.

Choosing a retraining policy and deploying models through CI/CD/CT pipelines with Cloud Build.

Study it

  • Retraining policies: schedules, triggers and performance thresholds

    Partly covered by: From Pilot to Production

  • CI/CD/CT for models with Cloud Build

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.

Question 1 · choose 1

A demand model should be retrained only when production inputs drift past the thresholds set in Model Monitoring, not on a fixed calendar, and nobody should have to start the run by hand. The retraining pipeline already exists as a template. What should the ML engineer build?

  1. AA Pub/Sub channel on the monitoring job and a Cloud Run function that starts the pipeline
  2. BModel Monitoring set to retrain the model itself when a drift threshold is crossed
  3. CAn email alert from Model Monitoring to the on-call engineer, who reviews it and starts the pipeline run by hand
  4. DA BigQuery scheduled query that retrains a BigQuery ML copy of the model every night
Show the answer and why
  • AA Pub/Sub channel on the monitoring job and a Cloud Run function that starts the pipeline

    Correct

    Model Monitoring can notify a Pub/Sub channel, and a function subscribed to the topic can submit the pipeline run.

  • BModel Monitoring set to retrain the model itself when a drift threshold is crossed

    Incorrect

    Model Monitoring detects skew and drift and sends alerts; it has no setting that starts a training run.

  • CAn email alert from Model Monitoring to the on-call engineer, who reviews it and starts the pipeline run by hand

    Incorrect

    Email alerts need a person to act, which the requirement rules out.

  • DA BigQuery scheduled query that retrains a BigQuery ML copy of the model every night

    Incorrect

    A nightly query retrains on the calendar, not on drift, and produces a different model from the pipeline's.

Model Monitoring sends alerts by email or through Cloud Monitoring notification channels such as Pub/Sub. A Pub/Sub message can trigger a Cloud Run function that submits a pipeline run from the template, which gives retraining on drift without manual steps.

Question 2 · choose 1

Pipeline code, custom component images and training code live in one Git repository. On every merge to main the team wants tests to run, new component images to be built, and an updated pipeline definition to be stored as a versioned template that the production schedule uses. Nothing should run from an engineer's laptop. What should the ML engineer set up?

  1. AA nightly Agent Platform pipeline run that pulls the repository, rebuilds its own images, runs tests and compiles itself
  2. BA Cloud Build trigger on main that tests, builds and pushes images, compiles the pipeline and uploads the template
  3. CA Colab Enterprise notebook that the lead engineer runs after each merge to build images and upload the template
  4. DA Cloud Scheduler job that uploads the latest compiled file from a bucket every hour
Show the answer and why
  • AA nightly Agent Platform pipeline run that pulls the repository, rebuilds its own images, runs tests and compiles itself

    Incorrect

    A pipeline cannot rebuild its own components and definition before it runs; this skips the tests and versioned templates.

  • BA Cloud Build trigger on main that tests, builds and pushes images, compiles the pipeline and uploads the template

    Correct

    A build trigger automates the CI steps on each merge, and a pipeline template in Artifact Registry is versioned and reused by schedules.

  • CA Colab Enterprise notebook that the lead engineer runs after each merge to build images and upload the template

    Incorrect

    A manually run notebook is the laptop-style process the team wants to remove.

  • DA Cloud Scheduler job that uploads the latest compiled file from a bucket every hour

    Incorrect

    A timer does not run tests or build images, and nothing compiles the file after a merge.

In CI/CD for ML, a Cloud Build trigger on the repository can run unit tests, build container images for components, compile the pipeline and upload the compiled definition as a pipeline template to Artifact Registry, where it is versioned and can be run by schedules.

Question 3 · choose 1

New labeled data lands every Sunday night, and the forecasting model should be retrained from the latest pipeline template every Monday at 2 a.m. with no external services to maintain. What should the ML engineer use?

  1. AA crontab entry on a Compute Engine VM
  2. BModel Monitoring with a weekly monitoring window
  3. CAn Eventarc trigger that starts training when files land in the bucket
  4. DA schedule created with the Agent Platform Pipelines scheduler API and a cron expression
Show the answer and why
  • AA crontab entry on a Compute Engine VM

    Incorrect

    A VM is an external service to patch and keep running.

  • BModel Monitoring with a weekly monitoring window

    Incorrect

    A monitoring window controls how often inputs are analyzed; it does not start training.

  • CAn Eventarc trigger that starts training when files land in the bucket

    Incorrect

    The trigger fires as each file arrives, not at the agreed Monday time, and can start a run on a partial upload.

  • DA schedule created with the Agent Platform Pipelines scheduler API and a cron expression

    Correct

    The scheduler API runs a pipeline on a cron schedule from within Agent Platform.

The Agent Platform Pipelines scheduler API creates schedules that run a pipeline, including one from a template, at times given by a cron expression, without another orchestrator.

Question 4 · choose 1

A team tuned a Gemini model with supervised fine-tuning on 10,000 examples. Each month about 1,000 new reviewed examples arrive. The team wants each monthly model to build on the last tuned model rather than repeat the full tuning from the base model every time. What should the ML engineer use?

  1. AA new supervised tuning job on the base model with all 11,000 examples to replace the tuned model
  2. BContinuous tuning that starts from the previously tuned model
  3. CFew-shot examples from the new data added to every prompt
  4. DPreference tuning with the new examples
Show the answer and why
  • AA new supervised tuning job on the base model with all 11,000 examples to replace the tuned model

    Incorrect

    This repeats the full tuning from the base model each month, which the team wants to avoid.

  • BContinuous tuning that starts from the previously tuned model

    Correct

    Continuous tuning lets a new tuning job use an already tuned model as its starting point with the new data.

  • CFew-shot examples from the new data added to every prompt

    Incorrect

    Prompt examples steer each request but leave the tuned model unchanged, so the monthly model does not build on the last one.

  • DPreference tuning with the new examples

    Incorrect

    Preference tuning learns from pairs of preferred and rejected responses, not from more reviewed input-output examples.

Continuous tuning lets you tune an already tuned Gemini model or checkpoint further with new data instead of starting again from the base model. Preference tuning uses pairwise preference data, and supervised tuning from the base model repeats the earlier work.

Question 5 · choose 2

A team is defining the continuous integration stage for its ML pipeline repository. CI runs on every pull request and must finish in minutes. Which TWO checks belong in this stage? (Choose TWO.)

  1. AUnit tests for the feature engineering functions
  2. BFull retraining in the pipeline on the complete production dataset
  3. CDeployment of the trained model to the production endpoint
  4. DA check that the pipeline components build and the pipeline compiles
  5. EA large hyperparameter tuning job on the new code
Show the answer and why
  • AUnit tests for the feature engineering functions

    Correct

    Testing feature engineering logic is a standard CI check that runs quickly on each change.

  • BFull retraining in the pipeline on the complete production dataset

    Incorrect

    Training on production data is the CT pipeline's job and takes far longer than a CI run.

  • CDeployment of the trained model to the production endpoint

    Incorrect

    Deploying to production belongs to CD after validation, not to every pull request.

  • DA check that the pipeline components build and the pipeline compiles

    Correct

    CI verifies that the code produces deployable pipeline components and a valid pipeline definition.

  • EA large hyperparameter tuning job on the new code

    Incorrect

    Tuning is costly and slow and belongs to training runs, not to a minutes-long CI check.

In the MLOps architecture with Cloud Build, CI builds, tests and packages the pipeline components: unit tests for feature engineering and model code, checks that the components build and the pipeline compiles. Model training on real data runs in the CT pipeline, and production deployment in CD.

Question 6 · choose 1

The CD build that deploys a new model version to production must not start until a release manager approves it, while the staging deployment should stay fully automatic. What should the ML engineer configure on the production trigger?

  1. ARequire approval on the Cloud Build trigger for production
  2. BA Slack message that asks the manager to run the build by hand
  3. CA longer timeout on the production build trigger
  4. DA separate service account for the production build
Show the answer and why
  • ARequire approval on the Cloud Build trigger for production

    Correct

    A trigger that requires approval marks the build as pending until a user with permission approves it.

  • BA Slack message that asks the manager to run the build by hand

    Incorrect

    A manual run bypasses the trigger and leaves no gate in the build system.

  • CA longer timeout on the production build trigger

    Incorrect

    A timeout limits how long a build runs; it does not wait for anyone.

  • DA separate service account for the production build

    Incorrect

    A dedicated identity limits permissions but does not hold the build for approval.

Cloud Build can configure triggers that do not run a build immediately but mark it as pending until approved. When a user with permissions approves the build, it starts; if the approval is denied, it does not.

Question 7 · choose 1

A news recommendation model is trained once and then used for months, but readers' interests shift every few days with the news cycle and accuracy drops quickly. Which retraining approach fits this data?

  1. AStatic training on a larger historical dataset
  2. BStatic training with a lower learning rate
  3. CDynamic training that retrains often on recent data
  4. DNo retraining, with a fixed list of trending articles instead
Show the answer and why
  • AStatic training on a larger historical dataset

    Incorrect

    More history does not keep up with interests that change every few days.

  • BStatic training with a lower learning rate

    Incorrect

    A training setting does not address a model that goes stale.

  • CDynamic training that retrains often on recent data

    Correct

    Dynamic training adapts to new data patterns, at the cost of more resources and monitoring.

  • DNo retraining, with a fixed list of trending articles instead

    Incorrect

    A fixed list ignores each reader's interests.

Static training is simpler but can become outdated when data patterns change, which calls for data monitoring. Dynamic training retrains on new data and adapts to changing patterns, giving more accurate predictions in exchange for more resources and monitoring.

Question 8 · choose 1

A team trains and deploys its model by running notebooks by hand a few times a year. It now wants the model retrained automatically on new data through a pipeline, while pipeline code changes can still be released by hand for now. Which MLOps maturity level is the team aiming for?

  1. ALevel 0, a manual process
  2. BLevel 1, ML pipeline automation
  3. CLevel 2, CI/CD pipeline automation
  4. DA level beyond 2 with autonomous model design
Show the answer and why
  • ALevel 0, a manual process

    Incorrect

    Level 0 is where the team is today: every step is manual.

  • BLevel 1, ML pipeline automation

    Correct

    Level 1 automates the ML pipeline to perform continuous training of the model on new data.

  • CLevel 2, CI/CD pipeline automation

    Incorrect

    Level 2 adds automated CI/CD for the pipeline itself, which the team is not asking for yet.

  • DA level beyond 2 with autonomous model design

    Incorrect

    Google's MLOps guide defines levels 0, 1 and 2 only.

Google's MLOps guide describes level 0 (a manual, script-driven process), level 1 (ML pipeline automation for continuous training of the model with new data) and level 2 (CI/CD pipeline automation that also builds, tests and deploys the pipeline itself).

Question 9 · choose 1

A CI build runs unit tests, builds three component images and lints the pipeline definition, all in sequence, and takes 25 minutes. The steps do not depend on each other. How can the ML engineer make the build faster without removing steps?

  1. AIncrease the build's timeout so it is never cut off
  2. BSplit the steps into three separate repositories
  3. CMove the steps into a Colab Enterprise notebook
  4. DSet waitFor on the independent steps so they run in parallel
Show the answer and why
  • AIncrease the build's timeout so it is never cut off

    Incorrect

    A longer timeout lets a slow build finish but does not make it faster.

  • BSplit the steps into three separate repositories

    Incorrect

    Splitting repositories adds overhead and does not change step order inside a build.

  • CMove the steps into a Colab Enterprise notebook

    Incorrect

    A notebook is not a CI system and runs the cells in order anyway.

  • DSet waitFor on the independent steps so they run in parallel

    Correct

    By default a step waits for all earlier steps; waitFor sets which steps must finish first, so independent steps can run in parallel.

In a Cloud Build config file, a step with no waitFor value waits for all prior steps. The waitFor field (with step ids) specifies which steps must finish before a step runs, so steps that do not depend on each other can run in parallel.

Practice domain 5 →Practice all domains →