CoStudy

HomeCertificationsGCP Professional ML Engineer › Pretrained APIs, Model Garden and Generative AI Tuning

Pretrained APIs, Model Garden and Generative AI Tuning — GCP Professional ML Engineer practice questions

19 multiple-choice questions and 14 flashcards on Pretrained APIs, Model Garden and Generative AI Tuning, about 6% of the GCP Professional ML Engineer bank. Every one carries a written rationale.

Written and maintained by Nick Burton · last updated 2026-08-22 · how we write and review questions

What this chapter covers

Pretrained APIs, Model Garden and Generative AI Tuning is one of 8 chapters in CoStudy's GCP Professional ML Engineer bank, and it holds 19 of the bank's 300 multiple-choice questions — roughly 6% of the total. That proportion is not arbitrary: chapters follow the certifying body's published exam outline, and the number of questions in each is set by that domain's published weight, so the share of your practice time this chapter takes matches the share of the real exam it accounts for.

Studying by chapter is worth doing once you have a diagnostic score. A single overall percentage tells you whether you are close; it does not tell you which domain is dragging. Working a weak chapter in isolation, and re-testing it in isolation, is the fastest way to move a score that has stalled — and it is why the mock exams in CoStudy report by domain rather than as one number.

Free Pretrained APIs, Model Garden and Generative AI Tuning practice questions

10 questions drawn from this chapter, with the full rationale shown — the controlling principle behind the right answer, and why each wrong option tempts and fails.

A startup wants to fine-tune Gemini for a domain task with ~5,000 labeled examples. Best Vertex feature?

  1. Reinforcement learning from human feedback with a reward model
  2. Pre-training a new foundation model from scratch on the data
  3. Prompt engineering with few-shot examples and no tuning
  4. A supervised fine-tuning job on JSONL training examples

Answer: D — A supervised fine-tuning job on JSONL training examples

D) Correct — supervised fine-tuning on a JSONL set of prompt-response pairs is the supported path at this data size and needs no training code. A) Needs a reward model and far more preference data. B) Infeasible for a closed-weights model and vastly over budget. C) Useful first, but often short of domain accuracy once labeled data exists.

Which change to a prompt is LEAST likely to improve output consistency for a structured extraction task?

  1. Raising the sampling temperature so the model explores more phrasings
  2. Stating the required output schema explicitly and demanding it be followed
  3. Supplying two or three worked examples of input and desired output
  4. Moving the task instruction ahead of the long document to be processed

Answer: A — Raising the sampling temperature so the model explores more phrasings

A) Correct — higher temperature increases variability, which is the opposite of what a structured extraction task needs; near-deterministic decoding is the right setting. B) An explicit schema constrains the output shape and is standard practice for extraction. C) Few-shot examples are among the most reliable consistency levers. D) Instruction placement matters on long inputs, and leading with the task reliably improves adherence.

Vertex AI Studio is best described as:

  1. The orchestrator that runs ML pipeline steps
  2. A low-code surface for prompt design and tuning
  3. Managed JupyterLab notebooks for data science
  4. The registry that stores versioned model artifacts

Answer: B — A low-code surface for prompt design and tuning

B) Correct — it is the console surface where you draft prompts, compare parameters, launch tuning jobs and evaluate foundation-model output. A) Describes the pipeline service. C) Describes the managed notebook service. D) Describes the model registry.

A tuned model performs well on held-out examples but degrades badly on production prompts that arrive in a second language. The MOST likely cause is:

  1. The tuning dataset was drawn from a single language and narrowed the model
  2. The serving endpoint applies a different decoding temperature than tuning did
  3. The base model never supported multilingual input before tuning
  4. The evaluation metric weighted fluency above factual accuracy

Answer: A — The tuning dataset was drawn from a single language and narrowed the model

A) Correct — tuning on a narrow distribution can erode capabilities the base model had outside that distribution, so a monolingual tuning set predictably degrades other languages. B) Decoding settings shift style and variability but do not explain a language-specific collapse. C) Current foundation models are multilingual out of the box, so blaming the base model misdiagnoses the regression. D) A fluency-weighted metric would hide accuracy problems generally, not produce a language-shaped failure.

For RAG over private documents on GCP, the recommended stack is:

  1. Prompt Gemini alone with no retrieval step
  2. Embed docs, index them, retrieve, then prompt
  3. Manually paste documents into each prompt
  4. Fine-tune Gemini on the document corpus

Answer: B — Embed docs, index them, retrieve, then prompt

A) Ungrounded generation over private facts invites hallucination. B) Correct — embed the corpus, index the vectors in the managed vector search or enterprise search service, retrieve the top matches, and pass them to the model as context. C) Manual pasting does not scale or stay current. D) Tuning is costly and does not track documents that change.

A product needs a generative feature by the end of a two-week sprint, with fuzzy requirements likely to change. The team should FIRST:

  1. Launch a supervised tuning run so the model matches the target behavior early
  2. Build a labeled dataset large enough to support tuning later in the sprint
  3. Prototype with prompt engineering against a Model Garden model and iterate
  4. Distill a base model to control serving cost before requirements settle

Answer: C — Prototype with prompt engineering against a Model Garden model and iterate

C) Correct — with unstable requirements, prompting gives the fastest iteration loop and costs nothing to change; you tune only once the target behavior stops moving. A) Tuning against requirements that will change wastes the run and the dataset. B) Dataset construction is the expensive step and is premature before the behavior is defined. D) Optimizing serving cost before the feature exists is a classic sequencing error.

A team has 800 curated prompt-and-ideal-response pairs and wants a foundation model to adopt their in-house report style. Latency and cost per call must stay similar to the base model. The BEST approach is:

  1. Reinforcement tuning against a reward model built from the pairs
  2. Distillation from a larger teacher model into a smaller student
  3. Retrieval grounding that injects style exemplars into every prompt
  4. Supervised tuning of the base model on the 800 pairs

Answer: D — Supervised tuning of the base model on the 800 pairs

D) Correct — a modest set of high-quality input-output pairs teaching a consistent style is the textbook supervised tuning case, and the tuned model serves at roughly base-model cost. A) Reinforcement tuning suits preference data where no single ideal response exists; here ideal responses are already written. B) Distillation is for cutting the cost or size of an already-capable large model, not for teaching a style you have labeled examples for. C) Stuffing exemplars into every prompt does shift style, but it inflates token count on every call, which violates the cost constraint.

An assistant must answer from a 90,000-document internal policy corpus that changes weekly, and must cite sources. The MOST appropriate design is:

  1. Supervised tuning on the corpus, retuned weekly as documents change
  2. A retrieval-augmented design using RAG Engine over an indexed corpus
  3. Placing the full corpus in the system prompt of a long-context model
  4. Distilling the corpus into a small model that memorizes policy text

Answer: B — A retrieval-augmented design using RAG Engine over an indexed corpus

B) Correct — RAG Engine indexes the corpus, retrieves the relevant passages per question and supplies the provenance needed for citation, and refreshing the index is far cheaper than retraining. A) Tuning teaches behavior, not facts; weekly retunes are expensive and still cannot cite a source. C) 90,000 documents exceed any practical context window and would make every call ruinously slow. D) Distillation compresses capability, not a changing knowledge base, and memorized policy text cannot be attributed.

A finance team must extract line items, totals and vendor names from scanned supplier invoices in twelve formats. The MOST appropriate service is:

  1. The Vision API's text detection, then regular expressions over the raw strings
  2. A multimodal foundation model prompted to emit JSON for each page image
  3. Document AI, using its invoice processor to return structured entities
  4. A custom object detection model trained on annotated invoice regions

Answer: C — Document AI, using its invoice processor to return structured entities

C) Correct — Document AI ships processors specialized for invoices that return typed, structured entities with confidence scores, which is precisely this task. A) Vision text detection gives you characters with bounding boxes but no structure, so twelve layouts become twelve brittle regex sets. B) Prompting a multimodal model can work and is a reasonable fallback for exotic documents, but for a standard document type the purpose-built processor is more accurate and cheaper. D) Training a detector from scratch reinvents what the managed processor already does.

Vertex AI Model Garden vs Vertex AI Studio — correct distinction?

  1. They are two names for the same product surface
  2. The catalog of models versus the prompt workbench
  3. The studio is used only for training custom models
  4. The catalog is used only for deploying models

Answer: B — The catalog of models versus the prompt workbench

B) Correct — the model catalogue lists foundation, partner and open models you can inspect and deploy, while the studio is the prompt design, tuning and evaluation workbench built on top of them. A) They are distinct surfaces. C) The studio is prompt-centred, not a custom training service. D) The catalogue also supports discovery and comparison.

Pretrained APIs, Model Garden and Generative AI Tuning flashcards

4 cards from the 14 in this chapter.

Fine-tune Gemini?

Supervised fine-tuning (SFT) with JSONL training data. Reinforcement learning (RLHF) via separate workflow.

What problem does Document AI solve that a general OCR call does not?

Document AI combines OCR with document structure understanding, returning typed entities, key-value pairs and tables from forms, invoices and contracts through specialized or custom processors. Plain OCR returns only unstructured text with coordinates, leaving extraction logic to you.

What is Model Garden, and which first-party generative models would you find for text, image and video?

Model Garden is the catalog for discovering, testing and deploying foundation models, including Google first-party, third-party and open models. Gemini covers multimodal text and reasoning, Imagen covers image generation and editing, and Veo covers video generation.

Cost-optimize Gemini API?

Use Flash for high-volume cheap tasks, Pro for complex. Context caching for repeated prompts. Batch mode for non-real-time.

Practise the full chapter

These are a sample. The full Pretrained APIs, Model Garden and Generative AI Tuning chapter runs 33 items with per-chapter progress tracking, on the web and in the iOS app.

Open GCP Professional ML Engineer in CoStudy →

Other GCP Professional ML Engineer chapters

All GCP Professional ML Engineer practice questions →