GCP GenAI Leader study materials
GCP GenAI Leader study resources

GCP GenAI Leader practice questions

One question at a time. Build your GCP GenAI Leader understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Generative AI fundamentals

Which statement best describes a foundation model?

  1. A small model trained on one narrow labeled dataset
  2. A statistical model limited to tabular numeric prediction
  3. A rules-based engine that follows hand-written decision logic
  4. A large pretrained model adapted to many downstream tasks Correct answer.

Explanation

Foundation models are pretrained on broad data at scale and then adapted to many tasks through prompting, retrieval, or tuning. They are not purpose-built for a single labeled dataset, and they are learned rather than hand-coded.

Question 2Generative AI fundamentals

In a large language model, what is a token?

  1. A billing unit equal to one API request
  2. A subword unit the model reads and generates Correct answer.
  3. A hardware thread used to parallelize inference
  4. A single character of text, in every model family

Explanation

Models operate on tokens, which are subword pieces produced by a tokenizer and are usually smaller than words but larger than single characters. Both input and output are counted in tokens, which is why token count drives limits and cost.

Question 3Generative AI fundamentals

A marketing team wants more varied and creative wording from an LLM. Which parameter change supports that goal?

  1. Reduce the maximum output token limit
  2. Decrease the number of few-shot examples
  3. Raise the temperature to a higher value Correct answer.
  4. Lower the top-p value toward zero

Explanation

Temperature scales the randomness of token selection, so higher values make less predictable word choices and more varied output. Parameters that constrain length or narrow the sampling pool push in the opposite direction.

Question 4Generative AI fundamentals

A model returns a fluent, confident answer about a company policy that is factually wrong. What is this behavior called?

  1. Prompt injection
  2. Data leakage
  3. Hallucination Correct answer.
  4. Overfitting on the prompt

Explanation

A hallucination is a generated statement that is plausible in form but unsupported or incorrect in content. Mitigations include grounding in retrieved sources and evaluating outputs against reference material.

Question 5Generative AI fundamentals

Including three worked input-output examples in a prompt to demonstrate the desired format is known as:

  1. Parameter-efficient tuning
  2. Chain-of-thought distillation
  3. Reinforcement learning from feedback
  4. Few-shot prompting Correct answer.

Explanation

Few-shot prompting demonstrates the task with a small number of examples placed directly in the prompt, without changing model weights. It is a prompting technique, so no training step is involved.

Question 6Generative AI fundamentals

A model that accepts both images and text as input is described as:

  1. Deterministic
  2. Quantized
  3. Autoregressive
  4. Multimodal Correct answer.

Explanation

Multimodal models handle more than one data modality, such as text together with images, audio, or video. Support for multiple input types is the defining property, independent of size or serving configuration.

Question 7Generative AI fundamentals

Which task is the best fit for a generative model rather than a classic predictive classifier?

  1. Segmenting customers into fixed loyalty tiers
  2. Flagging each card transaction as fraudulent or legitimate
  3. Drafting a product description from a spec sheet Correct answer.
  4. Scoring loan applicants by their probability of default

Explanation

Generative models are suited to producing new open-ended content, such as narrative text derived from source material. Choosing between fixed labels or scores is the classic predictive setting, where a classifier is usually cheaper and easier to validate.

Question 8Generative AI fundamentals

What is the main purpose of grounding a model's response in retrieved documents?

  1. To anchor answers to authoritative, current sources Correct answer.
  2. To reduce the model's context window usage
  3. To eliminate the need for any human evaluation
  4. To increase the creativity of the generated output text

Explanation

Grounding supplies relevant source material at inference time so the answer can be tied to verifiable, up-to-date content. It reduces unsupported claims but does not remove the need for evaluation.

Question 9Generative AI fundamentals

A request contains more text than the model's context window can hold. What is the most direct consequence?

  1. The model summarizes the excess automatically before answering
  2. Output tokens are billed at a lower rate
  3. The model retrains on the missing content during inference
  4. Content is truncated or the request is rejected Correct answer.

Explanation

The context window is a fixed budget of tokens covering both prompt and response, so text beyond it cannot be attended to. Applications must manage this by trimming, summarizing, or retrieving only the most relevant passages.

Question 10Generative AI fundamentals

Why are embeddings used in retrieval-augmented generation?

  1. They compress each document so it fits verbatim in the prompt
  2. They encrypt sensitive content before it is stored
  3. They translate queries into the training language
  4. They place semantically similar texts near each other Correct answer.

Explanation

Embeddings map text to vectors whose distances reflect meaning, so a query can retrieve passages that are conceptually related even without shared keywords. This semantic matching is what makes vector search useful for grounding.

Question 11Generative AI fundamentals

A RAG system retrieves irrelevant passages from long policy documents. Which change most directly improves retrieval quality?

  1. Increasing the temperature of the generation call
  2. Splitting documents into smaller overlapping chunks Correct answer.
  3. Shortening the system instruction to one sentence
  4. Reducing the number of documents in the corpus

Explanation

Chunk size controls retrieval granularity, and large chunks dilute their own relevance signals because they mix several topics. Smaller chunks with overlap let a query match the specific passage that answers it.

Question 12Generative AI fundamentals

A company needs answers based on a price list that changes every day. Which approach fits best?

  1. Increase the top-k sampling value
  2. Retrieve current prices at inference time Correct answer.
  3. Distill a smaller model from the price list
  4. Fine-tune the model on the price list every week

Explanation

Frequently changing facts belong in a retrieval layer, because retrieval reflects the current source at query time. Tuning bakes knowledge into weights and quickly goes stale for fast-moving data.

Question 13Generative AI fundamentals

What does the top-p (nucleus) sampling parameter control?

  1. The number of candidate responses generated per request
  2. The penalty applied to tokens already in the output
  3. The maximum number of output tokens the model may return
  4. The probability mass the next token is sampled from Correct answer.

Explanation

Top-p keeps the smallest set of tokens whose cumulative probability reaches the threshold and samples only from that set. Lowering it narrows the candidate pool, making output more focused and predictable.

Question 14Generative AI fundamentals

Which practice best validates that a generative feature meets quality expectations before launch?

  1. Testing against a task-specific evaluation set Correct answer.
  2. Checking that response latency stays under one second
  3. Relying on the vendor's published benchmark scores alone
  4. Reviewing the model card for the training data cutoff date

Explanation

Quality must be measured on representative examples of the actual task, judged by human raters or a defined automated rubric. Public benchmarks and metadata inform model choice but cannot confirm performance on your data.

Question 15Generative AI fundamentals

A customer-facing assistant must avoid generating harmful content. Which control addresses this most directly?

  1. Reducing the maximum output tokens per call
  2. Lowering the temperature to zero
  3. Enabling request logging for audit purposes
  4. Configuring safety filters on the API request Correct answer.

Explanation

Safety filters evaluate prompts and responses against harm categories and block or suppress disallowed content. Logging supports investigation after the fact but does not prevent an unsafe response from reaching a user.

Question 16Generative AI fundamentals

Before sending customer support transcripts to a hosted generative API, what should be done with personally identifiable information?

  1. Convert it into embeddings before sending
  2. Nothing, because the API encrypts all traffic in transit
  3. Move it to the end of the prompt
  4. Detect and redact or mask it before the request Correct answer.

Explanation

Data minimization calls for removing or masking direct identifiers before content leaves the organization's control. Transport encryption protects data in transit but does not change what the model or provider receives.

Question 17Generative AI fundamentals

Which factor most directly determines whether a smaller model is suitable for a document summarization workload?

  1. Whether the vendor offers a free trial tier
  2. Whether the model card lists more than one language
  3. Whether it was trained more recently than the base model
  4. Whether your evaluation set shows acceptable quality Correct answer.

Explanation

Suitability is an empirical question answered by measuring the candidate model on representative examples against agreed criteria. Training recency, language coverage, and commercial terms are secondary considerations once quality is confirmed.

Question 18Generative AI fundamentals

An application inserts untrusted user text directly into a prompt. What risk does this create?

  1. Loss of model version pinning
  2. Excessive token usage on each request
  3. Prompt injection that overrides developer instructions Correct answer.
  4. Quantization error in the output layer

Explanation

Untrusted input can contain instructions that compete with the developer's system instruction, causing the model to follow attacker-supplied directions. Defenses include delimiting user content, validating outputs, and limiting what tools the model can invoke.

Question 19Generative AI fundamentals

A team needs an exact, auditable calculation of payroll deductions. Why is a generative model a poor primary component for this step?

  1. It always requires fine-tuning before use
  2. It may return plausible but unverifiable numbers Correct answer.
  3. It cannot be called from a web application
  4. It cannot process numeric input of any kind

Explanation

Arithmetic with audit requirements calls for deterministic code, because a language model predicts text and can emit a convincing but wrong figure. A common pattern is to let the model interpret the request while a function performs and logs the calculation.

Question 20Generative AI fundamentals

A team sets temperature to zero to obtain identical outputs for compliance review. Why might responses still differ between calls?

  1. Nondeterminism in serving infrastructure and model updates Correct answer.
  2. Safety filters rewrite the response text
  3. Token billing changes the sampling seed
  4. Temperature only affects the input encoding step

Explanation

Zero temperature makes greedy selection the default, but batching, hardware scheduling, and silent model revisions can still produce variation. Guarantees therefore usually rely on logging outputs and pinning model versions rather than on sampling settings alone.

Question 21Generative AI fundamentals

A corpus of 40,000 policy pages must be searchable by a chatbot. Why is retrieval usually preferred over placing the full corpus in the prompt?

  1. Context windows are finite and input costs scale Correct answer.
  2. Long prompts violate every provider's terms of service
  3. Retrieval makes the underlying model smaller and faster
  4. Retrieval removes the need for prompt engineering

Explanation

A fixed token budget cannot hold a large corpus, and cost and latency both grow with the number of input tokens. Retrieval sends only the passages likely to answer the query, keeping requests within limits and cheaper.

Question 22Generative AI fundamentals

For an abstractive summarization feature, why is exact-match accuracy a poor evaluation metric?

  1. It rewards the model for copying the source verbatim
  2. It requires human labels for every possible summary
  3. It only works on inputs shorter than the context window
  4. Many different wordings can be equally valid summaries Correct answer.

Explanation

Abstractive summaries are judged on faithfulness and coverage, and a correct summary can be phrased in countless ways. Metrics such as similarity scoring or rubric-based human review capture quality better than string equality.

Question 23Generative AI fundamentals

A legal research assistant must let reviewers verify every claim in an answer. Which design element matters most?

  1. A smaller model to reduce per-query cost
  2. A higher temperature to surface alternative readings
  3. Caching identical queries for a fixed period
  4. Returning retrieved source passages with each answer Correct answer.

Explanation

Verification requires a traceable link from each statement back to the source that supports it. Returning the cited passages gives reviewers the evidence to confirm or reject the claim without re-running the search.

Question 24Generative AI fundamentals

Where should a persistent behavioral rule such as 'always respond in French' be placed?

  1. In the last user message of each turn
  2. In the model's training configuration
  3. In the system instruction of the request Correct answer.
  4. In the retrieval index metadata

Explanation

The system instruction sets durable behavior for the whole interaction and is applied alongside each request. User messages are the right place for per-turn content, not for standing application rules.

Question 25Generative AI fundamentals

Why might a team select a smaller, task-tuned model over the largest available model for a high-volume routing task?

  1. Smaller models need no evaluation before launch
  2. Smaller models never produce hallucinations
  3. Smaller models have unlimited context windows
  4. Lower latency and cost with sufficient accuracy Correct answer.

Explanation

Model choice is a tradeoff between quality, latency, and price per token, and a narrow task often needs far less capability than the largest model provides. Confirming accuracy on an evaluation set justifies the cheaper option.

Question 26Generative AI fundamentals

Which description best characterizes a foundation model?

  1. A search index that is optimized for exact keyword matching
  2. A rules-based system that follows hand-written decision tables
  3. A model trained from scratch for a single narrow prediction task
  4. A large pretrained model that can be adapted to many tasks Correct answer.

Explanation

Foundation models are trained on broad, general data and then adapted to specific jobs through prompting or tuning. This reuse is what lets one base model serve many different applications.

Question 27Generative AI fundamentals

What does the temperature parameter influence in a generative model's output?

  1. The language the model replies in
  2. The degree of randomness in the model's token selection Correct answer.
  3. The number of documents retrieved for a prompt
  4. The maximum number of tokens the model can return

Explanation

Temperature scales the randomness of the next-token distribution, so lower values concentrate on likely tokens and higher values diversify output. It does not control length, retrieval, or language.

Question 28Generative AI fundamentals

What is a hallucination in the context of a generative model?

  1. Fluent output that is not supported by the source facts Correct answer.
  2. A response that omits punctuation marks
  3. A failure of the model to reach its output token limit
  4. A cached response returned from an earlier request

Explanation

A hallucination is content that reads plausibly but is fabricated or unsupported by evidence. Grounding and verification steps are used to reduce it.

Question 29Generative AI fundamentals

A prompt includes three example input-output pairs before the actual request. What is this technique called?

  1. Distillation
  2. Retrieval augmentation
  3. Fine-tuning
  4. Few-shot prompting Correct answer.

Explanation

Supplying a small number of worked examples inside the prompt demonstrates the desired pattern at inference time, which is few-shot prompting. No model weights are changed.

Question 30Generative AI fundamentals

What is prompt engineering?

  1. Encrypting prompts while they are in transit
  2. Measuring the throughput of a deployed model endpoint
  3. Compiling model weights into a container image
  4. Designing and refining the instructions and context given to a model Correct answer.

Explanation

Prompt engineering is the practice of shaping instructions, examples, and context so the model reliably produces the desired result. It is an iterative design activity rather than a deployment or security task.

Question 31Generative AI fundamentals

What is the role of Vertex AI Model Garden?

  1. It stores customer training data in Cloud Storage buckets
  2. It provides a catalog of foundation models that can be tried, tuned, and deployed Correct answer.
  3. It converts user prompts into embeddings for search
  4. It monitors deployed endpoints for latency and error rates

Explanation

Model Garden is a catalog where teams can discover foundation models, evaluate them, customize them, and deploy endpoints. Data storage, monitoring, and embedding generation are handled by other services.

Question 32Generative AI fundamentals

A chat interface feels slow because users wait several seconds before any text appears. Which change most directly improves perceived responsiveness?

  1. Increase the maximum number of output tokens
  2. Increase the temperature of the model
  3. Add more few-shot examples to the prompt
  4. Stream response tokens back as they are generated Correct answer.

Explanation

Streaming returns partial output as soon as tokens are produced, so users see progress immediately even if total generation time is unchanged. Perceived latency improves without altering model quality.

Question 33Generative AI fundamentals

Before embedding a long document for retrieval, why is it split into smaller chunks?

  1. So that the model is guaranteed never to produce unsupported claims
  2. So that the total number of stored vectors is reduced before indexing
  3. So each embedding represents a focused passage that matches short queries Correct answer.
  4. So that a separate vector database is no longer required for search

Explanation

Embeddings summarize a span of text, so a very long document produces a diluted vector that matches poorly. Focused chunks produce vectors closer to the granularity of typical queries and fit inside the prompt.

Question 34Generative AI fundamentals

A retrieval pipeline returns many passages quickly, but the top results are often only loosely relevant. Which addition most improves the ordering of the final passages?

  1. Adding a reranker that scores each retrieved passage against the query Correct answer.
  2. Raising the temperature during answer generation
  3. Using a higher embedding dimension for the query only
  4. Adding a longer system instruction before the question

Explanation

A reranker applies a more precise relevance model to a small candidate set and reorders it, which improves what ends up in the prompt. It complements fast first-stage retrieval rather than replacing it.

Question 35Generative AI fundamentals

Users search for exact product codes that dense retrieval frequently misses. Which retrieval approach best addresses this?

  1. Lowering the temperature of the answering model
  2. Increasing the chunk size to whole documents
  3. Pure semantic vector search over a larger index
  4. Hybrid search that combines keyword matching with vector similarity Correct answer.

Explanation

Keyword matching captures literal strings such as codes and identifiers, while vector similarity captures meaning; combining both covers each method's blind spot. Dense-only retrieval tends to lose exact-token signals.

Question 36Generative AI fundamentals

A company wants every response to consistently follow a distinctive brand voice and output format, regardless of the question. Which approach is most appropriate?

  1. Supervised fine-tuning on many examples written in that voice and format Correct answer.
  2. Increase the temperature so the style varies naturally
  3. Reduce the context window so the model focuses
  4. Retrieve style examples at query time and hope they dominate

Explanation

A consistent, always-on style is a behavioural trait of the model, which supervised tuning on representative examples teaches well. Instruction plus examples can help, but weight-level tuning gives the most durable adherence across varied inputs.

Question 37Generative AI fundamentals

A model gives wrong answers on multi-step arithmetic word problems. Which prompt change is most likely to improve accuracy?

  1. Ask the model to work through the steps before stating the final answer Correct answer.
  2. Shorten the prompt by removing the question text
  3. Request several answers and keep the longest one
  4. Raise the temperature to explore more possible answers

Explanation

Eliciting intermediate reasoning steps gives the model room to compute partial results before committing to an answer. This is the basis of chain-of-thought style prompting for multi-step tasks.

Question 38Generative AI fundamentals

An application must parse model responses into fields for a downstream system. Which approach most reliably produces machine-readable output?

  1. Requesting JSON that conforms to a defined schema Correct answer.
  2. Requesting a friendly paragraph and extracting fields with regular expressions
  3. Setting temperature to its maximum value
  4. Adding open-ended questions to the prompt

Explanation

Constraining the response to a declared schema, ideally enforced by the API's structured output support, makes parsing deterministic and failures detectable. Free-form text invites format drift.

Question 39Generative AI fundamentals

An assistant must be able to create a support ticket in an external system. Which mechanism enables this?

  1. Function calling, so the model requests a declared tool that performs the action Correct answer.
  2. Increasing top-p so the model explores more options
  3. Embedding the entire ticket table into every prompt
  4. Pretraining the model on the ticketing database

Explanation

Function calling lets the model emit a structured request for a declared tool, and the application executes that call against the real system. This keeps the action external, auditable, and current.

Question 40Generative AI fundamentals

Generated answers are being cut off mid-sentence. Which setting should be adjusted?

  1. The top-p value, lowered to reduce randomness
  2. The language specified in the system instruction
  3. The maximum output tokens, raised to allow longer responses Correct answer.
  4. The number of retrieved chunks included in the prompt

Explanation

Truncation occurs when generation stops at the configured output token ceiling. Raising that ceiling allows the model to finish, provided the context window has room.

Question 41Generative AI fundamentals

A team pastes a 20-page policy document into every request. What is the most direct effect on cost and latency?

  1. Repeated input tokens raise cost and latency on every call Correct answer.
  2. The model's training data is updated with the document
  3. Input token counts fall and answer quality rises automatically
  4. Output tokens are billed at a lower rate than before

Explanation

Every call re-sends and re-processes the full document, and input tokens are billed per request. Unless the prefix is cached, this repeatedly adds both spend and processing time.

Question 42Generative AI fundamentals

A team must judge whether model-written marketing copy is on-brand and persuasive. Which evaluation approach is most suitable?

  1. Exact string match against one reference sentence
  2. Measuring endpoint latency percentiles
  3. Counting the tokens in each response
  4. Human raters scoring responses against a written rubric Correct answer.

Explanation

Persuasiveness and brand fit are subjective qualities with many acceptable phrasings, so structured human judgement against explicit criteria is the appropriate measure. Automated string comparison cannot capture them.

Question 43Generative AI fundamentals

Thousands of candidate answers must be compared for helpfulness at low cost. Which evaluation method scales best?

  1. A model-based judge scoring answers against explicit criteria Correct answer.
  2. Exact match against a single golden answer
  3. Manual review of every answer by two subject-matter experts
  4. Counting the number of characters in each answer

Explanation

A model-based evaluator applies consistent criteria to large volumes quickly and cheaply, and can be validated against a smaller human-labelled sample. Human review does not scale to thousands of items.

Question 44Generative AI fundamentals

A team has only 150 labelled examples for a tuning task. How can generative AI help most directly?

  1. By generating additional varied training examples for human review Correct answer.
  2. By removing the evaluation set to save time
  3. By deleting the labelled examples to avoid bias
  4. By raising the temperature used at inference time

Explanation

A generative model can draft new, varied examples that follow the observed pattern, expanding a small labelled set after review. Human vetting keeps quality and coverage under control.

Question 45Generative AI fundamentals

A high-traffic assistant always sends the same 50,000-token instruction manual before each short user question. Which optimization targets this pattern most directly?

  1. Lowering top-p for each request
  2. Context caching so the repeated prefix is not reprocessed each call Correct answer.
  3. Increasing the maximum output tokens
  4. Shortening the user's question further

Explanation

Context caching stores the processed form of a stable, repeated prefix so subsequent requests reuse it instead of reprocessing and rebilling the same tokens. This directly targets large, unchanging preambles.

Question 46Generative AI fundamentals

A large model delivers strong quality, but its per-call cost is too high for millions of simple requests. Which approach addresses this most directly?

  1. Training a smaller model on high-quality outputs from the larger model Correct answer.
  2. Adding more few-shot examples to every request
  3. Raising the temperature to obtain cheaper answers
  4. Increasing the context window of the large model

Explanation

Distillation transfers the large model's behaviour into a smaller, cheaper model by training on its outputs for the target task. The smaller model then serves high-volume traffic at lower cost.

Question 47Generative AI fundamentals

A model scores highly on an offline benchmark but performs poorly after launch on real traffic. Which explanation is most likely?

  1. The temperature was set below one
  2. The benchmark examples do not resemble production inputs Correct answer.
  3. The model was deployed to too many regions
  4. The evaluation set contained too many examples

Explanation

Benchmark results only predict production quality when the benchmark distribution matches real inputs. A mismatch means measured accuracy does not transfer to live traffic.

Question 48Generative AI fundamentals

A single prompt asks a model to extract fields, translate, summarize, and format output, and the results are inconsistent. Which redesign is most effective?

  1. Move all instructions into the system instruction and keep one call
  2. Split the work into a chain of focused prompts with checkable outputs Correct answer.
  3. Give the whole task to a smaller model without other changes
  4. Raise the temperature so the model chooses a path

Explanation

Decomposing an overloaded task into stages lets each step carry a narrow instruction and a verifiable result, which reduces conflicting requirements. Prompt chaining also makes failures easy to localize.

Question 49Generative AI fundamentals

An agent can issue customer refunds through an API. Which safeguard is most important before the action is executed?

  1. A validation check of the proposed action against business rules and limits Correct answer.
  2. A larger context window for the conversation
  3. A longer system instruction describing the company brand
  4. A higher temperature so the model considers more options

Explanation

When a model can trigger real-world side effects, the application must validate the proposed action against deterministic business rules and limits before executing it. The model should never be the sole authority for an irreversible action.

Question 50Generative AI fundamentals

Which property best characterizes a foundation model?

  1. It relies on hand-written rules from domain experts.
  2. It needs a separate architecture for each task.
  3. It is pretrained broadly and adapts to many tasks. Correct answer.
  4. It is trained only on one organization's private records.

Explanation

Foundation models learn general patterns from large, diverse datasets during pretraining, which lets them be adapted to many downstream tasks. They are not defined by private data, expert rules, or one architecture per task.