PMLE · LESSON 3
Section 3: Scaling prototypes into ML models約21% · 3 topics
Learn building models with cost, complexity and latency in mind, model training, and training hardware and distributed training.
3.1Building models with requirements in mind
Building models with cost, complexity, latency and scalability in mind (ARIMA, DNN, LLM; AutoML, BigQuery ML, Pipelines; deployment strategy; interpretability requirements)
Concept
Choose models from requirements (accuracy, latency, cost, interpretability, scalability). Candidates are statistical models such as ARIMA for time series, DNNs for complex unstructured data, and LLMs for diverse language tasks. In order of least effort, the development options are BigQuery ML and AutoML, flexible custom training, and automation with Pipelines. If decisions must be explained, for example due to regulation, use interpretable models or Explainable AI.
How it works / steps
- Set priorities among requirements (accuracy, speed, cost, explanation)
- First set a baseline with a simple model or BigQuery ML/AutoML
- Move to custom DNNs or LLMs as needed
- If there are interpretability requirements, check model type and explanation methods
Workplace example
Because credit screening requires explanations, first build an interpretable boosted tree model and confirm Explainable AI can show feature contributions.
Common confusions and exam tips
- Starting with a complex model brings large cost and maintenance burdens
- LLMs are highly versatile but have high latency and cost
- Treat interpretability as an initial requirement rather than adding it later
Mini quiz
Q1. For a credit model where regulation strongly demands interpretability, which approach is most appropriate to consider first?
- Skip explanations and notify customers of predictions only
- Choose an interpretable model and show reasons with Explainable AI
- Have an LLM freely write reasons and send them to customers as is
- Choose the most accurate deep network and skip explaining reasons
Show answer and explanation
Answer: B Choose an interpretable model and show reasons with Explainable AI
Linear models and decision trees, or feature attributions.
Q2. In which situation should fine-tuning NOT be considered?
- Prompts have grown too long, and you want lower cost and latency
- You want answers to reflect inventory information that changes daily
- You want the model to consistently adopt your company's specialized style
- You want higher accuracy on a specialized classification task with many examples
Show answer and explanation
Answer: B You want answers to reflect inventory information that changes daily
Handle frequently changing facts with RAG or tools.
Reference links
3.2Model training
Model training (organizing data in Cloud Storage and BigQuery, ingestion, custom training, Kubeflow on GKE, AutoML, Tabular Workflows, handling training failures, hyperparameter tuning, fine-tuning foundation models)
Concept
Organize training data in Cloud Storage (files: TFRecord, images, etc.) or BigQuery (tables). Training methods include custom training with your own containers or scripts, Kubeflow on GKE, AutoML, and Tabular Workflows for tabular data. Search for the best settings with hyperparameter tuning (such as Bayesian optimization with Vizier), and investigate the causes of training failures (out of memory, data mismatches, divergence) in logs. Foundation models can be adjusted with supervised tuning and similar methods.
How it works / steps
- Match data format and storage location to the training method
- Use a custom container if prebuilt containers aren't enough
- Search with a hyperparameter tuning job
- Save checkpoints so you can resume after failures or interruptions
Workplace example
Custom-train image classification with a prebuilt PyTorch container, and search learning rate and batch size with a tuning job.
Common confusions and exam tips
- Prebuilt containers are standard framework environments; use custom containers for special dependencies
- Tuning jobs run training trials in parallel
- Most training failures are data or memory problems
Mini quiz
Q1. What is the most appropriate advantage of using Vizier for hyperparameter tuning?
- It automatically adds training data and relabels it
- It sets model parameters (weights) one by one by hand
- It finds good combinations in few trials with Bayesian optimization and the like
- It always brute-forces every combination, maximizing computation
Show answer and explanation
Answer: C It finds good combinations in few trials with Bayesian optimization and the like
Agent Platform hyperparameter tuning uses Vizier.
Q2. You will run a custom training job on hundreds of millions of rows in BigQuery. Which loading approach is best?
- Read directly and efficiently from the job, for example with the BigQuery Storage Read API
- Export results to Cloud Storage as a single CSV and read that file
- Move the data to Cloud SQL and read it over JDBC
- Page through rows with the BigQuery REST tabledata.list call inside the job
Show answer and explanation
Answer: A Read directly and efficiently from the job, for example with the BigQuery Storage Read API
You can also specify BigQuery as the dataset. [Other options] A single CSV is too large to read in parallel. tabledata.list is slow for bulk reads. Moving to Cloud SQL adds effort and cost.
Reference links
3.3Training hardware and distributed training
Training hardware (CPU, GPU, TPU; data-parallel and model-parallel distributed training)
Concept
CPUs are general-purpose for small models, GPUs do parallel computation for deep learning in general, and TPUs are accelerators developed by Google specialized for matrix operations, suited to models with many large matrix operations (TensorFlow, JAX, PyTorch/XLA). Distributed training includes data parallelism, which splits data to train the same model on several devices, and model parallelism, which splits a large model that doesn't fit on one device.
How it works / steps
- Choose hardware from model size and framework
- Use data parallelism when data is large and you want faster training
- Use model parallelism when the model doesn't fit in one device's memory
- Monitor utilization and avoid oversized hardware
Workplace example
When fine-tuning a large language model that doesn't fit on one GPU, split it across several GPUs with model parallelism.
Common confusions and exam tips
- Data parallelism replicates the whole model on each device
- TPUs may not suit models with many custom operations
- Adding GPUs doesn't speed things up if data loading is slow
Mini quiz
Q1. Which best describes data-parallel distributed training?
- Each worker processes different data, and gradients are aggregated
- Training runs on one machine, and only inference is distributed
- Each worker trains a different model on the same data and the best is chosen
- Model layers are split and placed on different devices
Show answer and explanation
Answer: A Each worker processes different data, and gradients are aggregated
If the model fits on one device, data parallelism is the default.
Q2. You want to adapt a large language model to internal terminology on a limited GPU budget. Which is the main benefit of parameter-efficient tuning such as LoRA?
- It retrains all weights, so accuracy improves more easily
- The tuned model no longer needs the base weights at inference
- It specializes the model even without training data
- It trains a few added parameters, saving compute and storage
Show answer and explanation
Answer: D It trains a few added parameters, saving compute and storage
Only adapters (small weights) are trained. [Other options] Training still needs data. LoRA adapters are used together with the base weights. Retraining all weights is full fine-tuning.
Reference links
Lessons are written by this site based on public information and do not guarantee exam content. Product specifications change, so check the latest information at the reference links.
Notes (unofficial, original questions, no pass guarantee)
- The questions on this site are original practice questions written by this site based on publicly available skills outlines and exam guides. They are not actual exam questions.
- Google Cloud, Gemini, Vertex AI and Google Workspace are trademarks of Google LLC. This site is not affiliated with or endorsed by Google.
- This content is a study aid and does not guarantee a pass. Exam content, format and prerequisites may change without notice; always check the latest information on the official page before taking the exam.
- Your accuracy on the mock exam cannot be converted to the official (scaled) score and does not predict a pass or fail.
- Progress is saved only in this browser (localStorage) unless you sign in with Google to sync it. You can delete it from the Cookie & storage settings page (Japanese).