Courseiva

CCNA Improve Gen Ai Output Questions

51 questions · Improve Gen Ai Output topic · All types, answers revealed

1
MCQhard

A healthcare startup uses a generative model fine-tuned on general medical literature to provide preliminary diagnostic suggestions from patient text. The model frequently misses rare diseases and sometimes suggests common conditions that are unlikely given the symptoms. The startup has a curated dataset of rare disease case reports and wants to improve the model’s sensitivity to rare conditions without sacrificing overall accuracy. They cannot afford to retrain the entire model from scratch. The model is deployed on Vertex AI Prediction with low latency requirement. Which approach should they take?

A.Perform continued fine-tuning on the rare disease dataset using a low learning rate.
B.Add a system prompt instructing the model to consider rare diseases more carefully.
C.Reduce top-p sampling to focus on high-probability tokens, assuming rare diseases have lower probability.
D.Implement a human-in-the-loop system: for outputs with low confidence or suspected rare disease, route to a human expert.
AnswerD

Human-in-the-loop catches edge cases without retraining, preserving accuracy for common conditions.

Why this answer

Implementing a human-in-the-loop process for rare disease flags combines AI with expert review, catching misses while maintaining speed for common cases. Option A is wrong because prompt engineering alone may not teach the model about rare diseases. Option B is wrong because increasing top-p restricts vocabulary but doesn't inject knowledge.

Option C is wrong because fine-tuning again might cause catastrophic forgetting of common conditions.

2
Multi-Selecthard

A team is fine-tuning a large language model for medical advice. Which TWO techniques are most effective for improving the safety and reliability of the model's outputs?

Select 2 answers
A.Constitutional AI
B.Lowering the temperature to 0.0
C.Increasing training data size
D.Increasing top_p to 1.0
E.Reinforcement learning from human feedback (RLHF)
AnswersA, E

Constitutional AI uses predefined rules to guide model behavior.

Why this answer

Constitutional AI (A) is correct because it embeds a set of ethical principles directly into the model's training process, allowing the model to self-critique and revise its outputs to avoid harmful or unsafe medical advice. This technique proactively enforces safety constraints without requiring extensive human labeling, making it highly effective for high-stakes domains like healthcare.

Exam trap

Google Cloud often tests the misconception that hyperparameter tuning (temperature, top_p) or data scaling alone can solve safety issues, when in fact alignment techniques like Constitutional AI and RLHF are specifically designed for that purpose.

3
MCQeasy

A team uses a generative model to summarize lengthy legal documents. The summaries are accurate but often exceed the target length of 200 words, varying widely. Which simple adjustment should be applied to ensure consistent output length?

A.Fine-tune the model on summaries that are exactly 200 words.
B.Set the max output tokens parameter to 200.
C.Add a system prompt that says 'Summarize in exactly 200 words.'
D.Lower the temperature to reduce variability in word choices.
AnswerB

Max token limits directly truncate the output, enforcing the length constraint.

Why this answer

Setting the max output tokens parameter to 200 directly caps the number of tokens the model can generate, ensuring the summary cannot exceed the target length. This is a deterministic, model-level constraint that works regardless of prompt phrasing or training data, making it the most reliable adjustment for consistent output length.

Exam trap

Google often tests the misconception that prompt engineering or fine-tuning can enforce precise numerical constraints, when in fact only a hard token limit parameter provides deterministic control over output length.

How to eliminate wrong answers

Option A is wrong because fine-tuning on exactly 200-word summaries does not guarantee the model will always stop at that length; it can still generate longer outputs due to autoregressive decoding and lack of a hard token limit. Option C is wrong because a system prompt is a soft instruction that the model may not reliably follow, especially for precise numerical constraints like word count, leading to inconsistent lengths. Option D is wrong because lowering temperature reduces randomness in token selection but does not enforce a maximum length; it may actually cause the model to produce shorter or repetitive outputs, not consistently 200 words.

4
Multi-Selecthard

Which THREE approaches are effective for reducing bias in generative model outputs? (Choose three.)

Select 3 answers
A.Set temperature to a very high value.
B.Use adversarial training.
C.Use a balanced training dataset.
D.Use prompt engineering to specify neutral tone.
E.Fine-tune on a debiased dataset.
AnswersC, D, E

Balanced data reduces representation bias.

Why this answer

A balanced training dataset reduces the risk of the model learning spurious correlations or skewed distributions that lead to biased outputs. By ensuring that all demographic groups, topics, or perspectives are represented proportionally, the model's learned probability distribution is less likely to favor one group over another, directly mitigating representation bias at the data level.

Exam trap

The trap here is that candidates confuse randomness (high temperature) with fairness, or mistake adversarial training (a robustness technique) for a bias mitigation method, when in fact bias reduction requires data-level or fine-tuning interventions like balanced datasets, debiased fine-tuning, or prompt engineering.

5
Multi-Selectmedium

A developer is tuning a text-generation model for creative writing. They want the outputs to be more diverse and less repetitive. Which THREE parameters/changes can help? (Choose three.)

Select 3 answers
A.Increase temperature to 0.9
B.Reduce top-k to 10
C.Increase presence penalty to 0.5
D.Increase top-p to 0.95
E.Reduce frequency penalty to 0.0
AnswersA, C, D

Higher temperature increases randomness and diversity.

Why this answer

Increasing temperature to 0.9 raises the randomness of the probability distribution over the vocabulary, making the model more likely to sample less probable tokens. This directly increases output diversity and reduces repetitiveness by flattening the softmax curve, which is a standard technique for creative generation.

Exam trap

Google Cloud often tests the misconception that reducing top-k or top-p increases diversity, when in fact narrowing the sampling pool (lower top-k or lower top-p) reduces diversity, and the correct approach is to increase these values or increase temperature/penalties.

6
Multi-Selecteasy

Which TWO methods are most effective for improving factual accuracy in a language model's responses? (Choose two.)

Select 2 answers
A.Use prompt engineering to instruct the model to rely on provided facts.
B.Decrease the temperature to make responses more deterministic.
C.Increase top-k sampling to consider a wider range of tokens.
D.Replace the model with a smaller, more focused model.
E.Implement Retrieval-Augmented Generation (RAG) with a trusted knowledge base.
AnswersA, E

Prompt engineering can explicitly direct the model to verify claims or stick to given knowledge.

Why this answer

Prompt engineering can explicitly instruct the model to base its responses on provided facts, reducing reliance on parametric knowledge that may be outdated or incorrect. By including directives like 'Use only the information in the following text' or 'Answer based solely on the provided context,' the model is guided to prioritize given facts over its internal training data, which improves factual accuracy in the output.

Exam trap

A common misconception is that reducing randomness (temperature) or increasing token diversity (top-k) directly improves factual accuracy, when in fact these parameters affect output style and creativity, not the correctness of the underlying facts.

7
MCQmedium

A data science team is fine-tuning a large language model using Vertex AI to generate marketing copy. They notice that the generated text is often repetitive and lacks creativity. Which technique should they apply to improve output diversity?

A.Increase the temperature parameter to 0.9.
B.Decrease the beam search width to 1.
C.Decrease the top-k sampling threshold.
D.Add more examples of repetitive text to the training dataset.
AnswerA

Higher temperature increases randomness and diversity in generated text.

Why this answer

Increasing the temperature parameter to 0.9 raises the randomness of the probability distribution over tokens, allowing less likely tokens to be selected. This directly counteracts repetitive output by encouraging the model to explore more diverse word choices, which is a standard technique for improving creativity in text generation.

Exam trap

Google Cloud often tests the misconception that decreasing sampling thresholds (like top-k or beam width) increases diversity, when in fact they reduce the candidate pool and make output more deterministic.

How to eliminate wrong answers

Option B is wrong because decreasing beam search width to 1 reduces the number of candidate sequences considered, which actually makes output more deterministic and less diverse, worsening repetitiveness. Option C is wrong because decreasing the top-k sampling threshold restricts the model to only the k most likely tokens, which reduces diversity and can increase repetition. Option D is wrong because adding more examples of repetitive text to the training dataset would reinforce the unwanted behavior, making the model more likely to generate repetitive output, not less.

8
Multi-Selectmedium

A team notices the RAG pipeline sometimes retrieves irrelevant documents. Which THREE improvements should they consider? (Choose three.)

Select 3 answers
A.Add a reranking step
B.Use exact keyword matching instead of embedding similarity
C.Increase chunk size of documents
D.Reduce the number of retrieved documents
E.Use a higher quality embedding model
AnswersA, D, E

Reranks retrieved documents by relevance.

Why this answer

Using a higher quality embedding model improves semantic understanding, adding a reranking step refines results, and reducing the number of retrieved documents reduces noise. Increasing chunk size can dilute relevance, and using exact keyword matching loses semantic context.

9
MCQeasy

To ensure that a generative AI model uses the most current information from the web for answering user queries, which Vertex AI feature should be enabled?

A.Grounding with Google Search
B.Safety filters
C.Context caching
D.Model tuning
AnswerA

Correct: This feature retrieves current web information to ground responses.

Why this answer

Grounding with Google Search is the correct feature because it enables the model to retrieve and reference real-time information from the web, ensuring responses are based on the most current data available. This is achieved by integrating Google Search results directly into the model's generation process, allowing it to cite live sources and reduce hallucinations from outdated training data.

Exam trap

Google Cloud often tests the distinction between features that improve output quality through external data retrieval (Grounding) versus those that modify the model's internal behavior (tuning, caching, filtering), leading candidates to confuse safety or optimization features with live data access.

How to eliminate wrong answers

Option B is wrong because safety filters are designed to block harmful or inappropriate content, not to fetch current web information. Option C is wrong because context caching stores frequently accessed context to reduce latency and cost, but it does not provide live web data. Option D is wrong because model tuning adjusts the model's parameters on a specific dataset to improve performance on a task, but it does not enable real-time web retrieval.

10
MCQeasy

A developer is using Vertex AI Studio to test prompts for a text generation model. They want the model to follow a specific output format (JSON). Which prompt engineering approach is most effective?

A.Set stop sequences to '}'.
B.Include a few-shot example of the exact JSON format in the prompt.
C.Set the system instruction to 'Always output JSON.'
D.Set temperature to 0 to make output deterministic.
AnswerB

Providing an example gives the model a concrete template to follow.

Why this answer

Including a few-shot example of the exact JSON format in the prompt provides the model with a concrete pattern to follow, which is the most reliable method for enforcing structured output in generative models. Few-shot prompting leverages in-context learning, where the model uses the provided example to infer the desired schema and formatting rules, reducing ambiguity and improving adherence to the specified JSON structure.

Exam trap

Google Cloud often tests the misconception that system instructions or hyperparameter tuning alone can enforce output format, when in practice, few-shot examples are the most direct and reliable method for guiding model behavior in structured generation tasks.

How to eliminate wrong answers

Option A is wrong because setting stop sequences to '}' would prematurely terminate generation at the first closing brace, which may cut off nested JSON objects or arrays, and does not guarantee the model outputs valid JSON from the start. Option C is wrong because a system instruction like 'Always output JSON' is a high-level directive that models often fail to follow precisely without explicit formatting examples, as they may still produce markdown, extra text, or malformed JSON. Option D is wrong because setting temperature to 0 makes output deterministic but does not enforce a specific output format; the model could still generate non-JSON text or deviate from the required schema, as temperature controls randomness, not structure.

11
MCQhard

A team is using Vertex AI Pipelines to deploy a generative AI model for real-time inference. The model sometimes generates harmful content. They want to implement a safety filter that checks the output before returning it to the user, but they need to minimize latency. Which approach best balances safety and performance?

A.Use a secondary lightweight classifier to filter outputs in real-time.
B.Retrain the model on every flagged harmful output.
C.Manually review all outputs before delivery.
D.Disable safety checks to improve latency.
AnswerA

A small classifier adds minimal latency while providing effective filtering.

Why this answer

Deploying a secondary lightweight classifier (e.g., a distilled BERT or a small logistic regression model) as a post-processing filter allows real-time inference with minimal latency overhead. This approach decouples safety from the primary generative model, enabling fast rejection of harmful outputs without retraining or blocking the main inference pipeline.

Exam trap

Google Cloud often tests the misconception that safety must be integrated into the generative model itself (e.g., via retraining or fine-tuning), when in practice a separate, lightweight post-processing filter is the standard for low-latency production systems.

How to eliminate wrong answers

Option B is wrong because retraining the model on every flagged harmful output is computationally expensive, introduces significant latency, and can lead to catastrophic forgetting or overfitting to specific examples, making it impractical for real-time inference. Option C is wrong because manual review of all outputs introduces unacceptable latency and does not scale, violating the requirement to minimize latency. Option D is wrong because disabling safety checks entirely eliminates the safety requirement, which is explicitly needed, and would expose users to harmful content, failing the core objective.

12
MCQeasy

A developer is using the Gemini API to generate creative product taglines. The taglines are often bland and uncreative. The developer wants more variety and novelty in the outputs. Which parameter adjustment would most effectively increase the diversity of the generated taglines?

A.Decrease top_p from 1.0 to 0.5.
B.Set frequency_penalty to 2.0.
C.Increase temperature from 0.2 to 0.9.
D.Decrease temperature from 0.7 to 0.2.
AnswerC

Higher temperature increases randomness, leading to more diverse and creative outputs.

Why this answer

Increasing temperature from 0.2 to 0.9 raises the randomness of token sampling, which directly increases the diversity and novelty of generated text. A low temperature (e.g., 0.2) makes the model highly deterministic, always picking the most probable next token, leading to bland outputs. A higher temperature (e.g., 0.9) allows less probable tokens to be selected more often, producing more creative and varied taglines.

Exam trap

The trap here is that candidates often confuse temperature with top_p, incorrectly assuming that lowering top_p increases diversity, when in fact it restricts the token pool and reduces variety.

How to eliminate wrong answers

Option A is wrong because decreasing top_p from 1.0 to 0.5 reduces the nucleus of tokens considered for sampling, which actually decreases diversity by cutting off the long tail of less probable tokens. Option B is wrong because setting frequency_penalty to 2.0 penalizes token repetition too aggressively, which can suppress natural language patterns and may reduce overall output quality without directly increasing novelty. Option D is wrong because decreasing temperature from 0.7 to 0.2 makes the model more deterministic, reducing randomness and thus decreasing diversity, which is the opposite of what the developer wants.

13
MCQhard

A generative AI model for code generation sometimes produces syntactically incorrect code. The team wants to reduce syntax errors without retraining the entire model. Which approach is most effective?

A.Implement constrained decoding with grammar rules
B.Run a syntax checker after generation and regenerate
C.Add a system prompt that instructs the model to produce valid code
D.Increase beam search width
AnswerA

Constrained decoding ensures output respects syntax rules.

Why this answer

Constrained decoding with grammar rules directly enforces the syntax of the target programming language during token generation, preventing the model from producing invalid constructs. This approach modifies the decoding process (e.g., using a context-free grammar or a formal syntax specification) to mask or forbid tokens that would lead to a syntax error, without altering the underlying model weights. It is the most effective method because it guarantees syntactically correct output at generation time, rather than relying on post-hoc fixes or probabilistic adjustments.

Exam trap

The trap here is that candidates often choose a post-hoc correction method (Option B) or a prompt-based approach (Option C) because they seem simpler, but they fail to recognize that only a decoding-time constraint can guarantee syntactic validity without retraining, which is the core requirement of the question.

How to eliminate wrong answers

Option B is wrong because running a syntax checker after generation and regenerating is inefficient and does not prevent errors; it relies on trial-and-error, which can be costly and may still produce invalid code if the model repeatedly generates similar errors. Option C is wrong because adding a system prompt is a soft instruction that the model may not reliably follow, especially for complex or edge-case syntax rules, and it does not enforce constraints at the token level. Option D is wrong because increasing beam search width improves the diversity and likelihood of finding high-probability sequences but does not incorporate any syntactic constraints; it may still produce syntactically incorrect code if the highest-scoring beams violate grammar rules.

14
MCQeasy

A company is using a generative AI model to generate product descriptions. They notice the outputs often include factual inaccuracies about product specifications. Which technique would best address this issue without modifying the model's architecture?

A.Implement a Retrieval-Augmented Generation (RAG) pipeline that retrieves product specs from a database
B.Decrease the temperature parameter to 0.1
C.Increase the max output tokens to 1024
D.Use few-shot prompting with 5 examples of correct descriptions
AnswerA

RAG grounds generation in retrieved relevant documents, improving factual accuracy.

Why this answer

Retrieval-Augmented Generation (RAG) is the correct technique because it grounds the model's output in factual, up-to-date product specifications retrieved from an external database. This directly addresses factual inaccuracies without modifying the model's architecture, as the model generates text based on retrieved context rather than relying solely on its parametric knowledge.

Exam trap

Google Cloud often tests the misconception that adjusting generation parameters (like temperature or token limits) or providing examples can fix factual accuracy, when in fact only retrieval-augmented methods or fine-tuning on verified data can correct hallucinations without changing the model architecture.

How to eliminate wrong answers

Option B is wrong because decreasing the temperature parameter to 0.1 makes the model more deterministic and reduces randomness, but it does not provide any factual grounding; it can still hallucinate incorrect specifications. Option C is wrong because increasing max output tokens only allows longer generations and does not improve factual accuracy; it may even increase the chance of errors. Option D is wrong because few-shot prompting with examples can guide the style and format but cannot supply specific, dynamic product specs; the model may still invent details not present in the examples.

15
MCQmedium

Refer to the exhibit. The endpoint is experiencing high latency during traffic spikes. The team wants to improve response time by reducing queueing. Which change to the configuration would be most effective?

A.Decrease minReplicaCount to 0
B.Change the model version to '2'
C.Decrease the target value in autoscaling metric to 50
D.Increase maxReplicaCount to 10
AnswerD

More replicas handle higher load.

Why this answer

Increasing maxReplicaCount to 10 allows the autoscaler to provision more replicas during traffic spikes, distributing the incoming requests across additional endpoints. This directly reduces queueing at each replica because the load is spread over more instances, lowering per-instance latency. The change targets the root cause—insufficient capacity to handle peak load—rather than adjusting thresholds or model versions.

Exam trap

Google Cloud often tests the misconception that lowering the autoscaling target metric (Option C) is the primary fix for high latency, when in fact the maxReplicaCount ceiling is the bottleneck that must be raised to allow sufficient capacity during spikes.

How to eliminate wrong answers

Option A is wrong because decreasing minReplicaCount to 0 would cause the endpoint to scale down to zero replicas during idle periods, leading to cold starts and increased latency when traffic spikes, which worsens queueing. Option B is wrong because changing the model version to '2' does not affect the number of replicas or queueing behavior; it only changes the model artifact, which may have different inference latency but does not address scaling capacity. Option C is wrong because decreasing the target value in the autoscaling metric (e.g., CPU utilization or requests per replica) would cause the autoscaler to add replicas sooner, but without increasing maxReplicaCount, the endpoint may still hit the upper limit and queue requests; the target value adjustment alone does not provide additional capacity during extreme spikes.

16
MCQhard

Refer to the exhibit. A team's IAM policy for Vertex AI includes the following binding. They can deploy models but cannot create tuning jobs. Which statement is true?

A.The developer needs the aiplatform.admin role
B.The aiplatform.user role overrides the modelUser role
C.The aiplatform.user role lacks permission to create tuning jobs
D.The policy is missing the aiplatform.specialist role
AnswerC

Missing aiplatform.tuningJobs.create permission.

Why this answer

The roles/aiplatform.user role does not include permission to create tuning jobs (aiplatform.tuningJobs.create). The modelUser role does not override the user role, admin role is not needed, and specialist role doesn't exist.

17
MCQhard

You are a Generative AI architect at a large financial services firm. The firm has deployed a custom large language model (LLM) fine-tuned on proprietary financial reports to assist analysts in generating quarterly earnings summaries. The model is hosted on Vertex AI using a dedicated endpoint with autoscaling enabled. Recently, the model's output has exhibited two issues: (1) occasional factual inaccuracies about specific financial figures, and (2) a tendency to produce overly verbose and repetitive text in the summaries, sometimes exceeding the desired length of 200 words. The team has already tried adjusting the temperature parameter from 0.7 to 0.2 and increased the top-k sampling from 40 to 50, but the problems persist. The model's training data includes over 10,000 financial reports, and the fine-tuning process used low-rank adaptation (LoRA) with rank 16. The production environment uses a batch size of 1 for inference. You need to recommend a course of action that most directly addresses both the factual accuracy and verbosity issues without requiring a full retraining of the model. Which approach should you take?

A.Increase the LoRA rank to 32 and fine-tune the model for additional epochs on a curated subset of reports that focus on concise and accurate summaries.
B.Implement a retrieval-augmented generation (RAG) pipeline that queries a vector database of verified financial data, and apply constrained decoding with a maximum token limit and a repetition penalty.
C.Switch to a larger pre-trained model (e.g., PaLM 2 or GPT-4) and use the same fine-tuning data with higher rank LoRA to improve capability, then rely on the larger model's inherent accuracy.
D.Experiment with higher temperature (e.g., 0.9) and lower top-k (e.g., 20) to encourage more diverse and concise outputs, and add a post-processing step to truncate summaries to 200 words.
AnswerB

This directly improves factual accuracy by grounding outputs in retrieved evidence and reduces verbosity through decoding constraints, without retraining.

Why this answer

It directly addresses both issues without retraining. A RAG pipeline grounds the model's outputs in verified financial data, eliminating factual inaccuracies. Constrained decoding with a maximum token limit and repetition penalty directly curbs verbosity and repetition, which temperature and top-k adjustments failed to fix.

Exam trap

Google Cloud often tests the misconception that adjusting hyperparameters like temperature or top-k can fix factual accuracy and verbosity, when in reality these issues stem from the model's lack of external knowledge and lack of output constraints, which require architectural changes like RAG and constrained decoding.

How to eliminate wrong answers

Option A is wrong because increasing LoRA rank and fine-tuning on a curated subset still relies on the model's parametric memory, which is prone to hallucination and does not guarantee factual accuracy; it also requires retraining, contradicting the 'no full retraining' constraint. Option C is wrong because switching to a larger model does not inherently solve factual inaccuracies (larger models can still hallucinate) and requires full retraining or significant adaptation, violating the constraint. Option D is wrong because higher temperature (0.9) increases randomness, likely worsening factual inaccuracies, and lower top-k (20) reduces diversity, which may not fix verbosity; post-processing truncation does not address the root cause of repetition or inaccuracy.

18
MCQmedium

A team is using a pre-trained language model to summarize legal documents. They find that summaries often miss key dates and parties involved. Which technique would most effectively improve factual accuracy?

A.Fine-tune the model on a dataset of legal summaries with annotated key entities.
B.Use top-p sampling with a low p value.
C.Increase the temperature parameter.
D.Use chain-of-thought prompting.
AnswerA

Fine-tuning adapts the model to domain-specific requirements, improving factual accuracy.

Why this answer

Fine-tuning on a dataset of legal summaries with annotated key entities directly teaches the model to recognize and reproduce critical factual elements like dates and parties. This supervised learning approach adjusts the model's weights to prioritize entity extraction and accurate generation, which is the most effective method for improving factual accuracy in domain-specific tasks.

Exam trap

Google Cloud often tests the misconception that inference-time parameters (temperature, top-p) or prompting strategies can substitute for targeted training, when in fact only fine-tuning with domain-specific annotated data reliably improves factual accuracy for structured entities.

How to eliminate wrong answers

Option B is wrong because top-p sampling with a low p value restricts the vocabulary to a small set of high-probability tokens, which can reduce creativity but does not address factual accuracy or entity recall—it may even omit rare but important entities. Option C is wrong because increasing the temperature parameter adds randomness to token selection, which typically reduces factual consistency and can lead to hallucinated or missing details. Option D is wrong because chain-of-thought prompting improves reasoning steps for multi-step tasks but does not inherently enforce factual accuracy for specific entities; it relies on the model's existing knowledge, which may still miss key dates and parties without targeted training.

19
MCQmedium

A team is building a generative AI model for customer support. They notice the model often produces overly polite but unhelpful responses. Which technique would best improve response quality without sacrificing helpfulness?

A.Apply reinforcement learning from human feedback (RLHF)
B.Increase the amount of training data
C.Lower the top_k sampling value
D.Increase the temperature parameter
AnswerA

RLHF tunes the model to align with desired response characteristics.

Why this answer

RLHF directly addresses the misalignment between the model's training objective (e.g., predicting the next token) and the desired outcome (helpful, not just polite). By using human feedback to train a reward model, the system learns to optimize for response quality and helpfulness, reducing sycophantic or overly polite but uninformative outputs.

Exam trap

Google Cloud often tests the misconception that hyperparameter tuning (temperature, top_k) or more data alone can fix alignment issues, when in fact only RLHF directly optimizes for human-judged helpfulness and quality.

How to eliminate wrong answers

Option B is wrong because simply increasing training data does not correct the model's tendency toward polite but unhelpful responses; it may reinforce existing patterns without addressing alignment. Option C is wrong because lowering top_k sampling reduces diversity by restricting token choices to the top k most likely tokens, which can make responses even more generic and less helpful, not more substantive. Option D is wrong because increasing the temperature parameter increases randomness in token selection, which can lead to less coherent or more erratic responses, not more helpful ones.

20
Multi-Selecteasy

Which TWO techniques are commonly used to control the style and tone of a generative model's output?

Select 2 answers
A.Adjusting the temperature
B.Modifying the top_k value
C.Fine-tuning on a dataset with desired style
D.Prompt engineering with style instructions
E.Changing the top_p value
AnswersC, D

Fine-tuning adapts the model to a specific style.

Why this answer

Fine-tuning on a dataset that embodies the desired style directly adjusts the model's weights, making it consistently produce outputs with that specific tone and style. This is a fundamental technique for customizing generative models, as it teaches the model the exact patterns, vocabulary, and stylistic nuances present in the training data.

Exam trap

Google Cloud often tests the distinction between sampling parameters (temperature, top_k, top_p) that control output randomness and diversity versus training or conditioning techniques (fine-tuning, prompt engineering) that directly influence style and tone, leading candidates to incorrectly select sampling parameters as style-control methods.

21
MCQeasy

Refer to the exhibit. A user wants formal translations from a generative AI model, but the model outputs informal style inconsistently. Which prompt engineering technique would best ensure consistent formal translations?

A.Use context caching
B.Provide a few-shot example with formal and informal pairs
C.Use a longer system prompt with detailed rules
D.Set top_k to 1
AnswerB

Correct: Few-shot examples directly show the expected output format.

Why this answer

Providing a few-shot example that explicitly demonstrates the desired formal translation guides the model to follow that pattern. System instructions can help but are less direct.

22
MCQmedium

A company uses a text-to-image model to generate marketing visuals. The results often misinterpret the prompt, e.g., 'a red car' generates a blue car. Which technique should they try first to align the output with the prompt?

A.Use a negative prompt to exclude blue
B.Refine the prompt with more adjectives and context, e.g., 'bright red sports car'
C.Upscale the image resolution to 1024x1024
D.Increase the guidance scale to 20
AnswerB

Clearer, more descriptive prompts help the model understand the desired output.

Why this answer

Refining the prompt with more adjectives and context directly addresses the root cause of misalignment: insufficient specificity in the text description. Text-to-image models rely on the semantic richness of the prompt to guide the latent diffusion process; adding 'bright red sports car' provides stronger conditioning signals that steer the model's cross-attention layers toward the intended color and object attributes. This is the most efficient first step before adjusting hyperparameters like guidance scale.

Exam trap

The trap here is that candidates often jump to hyperparameter tuning (guidance scale) or post-processing (upscaling) as a first fix, when the most fundamental and cost-effective step is to improve the input prompt's specificity, which directly controls the conditioning signal in the diffusion process.

How to eliminate wrong answers

Option A is wrong because using a negative prompt to exclude 'blue' is a reactive band-aid that does not fix the core issue of the model failing to associate 'red' with the car; it also risks suppressing other unintended features and can degrade image quality by over-constraining the latent space. Option C is wrong because upscaling resolution to 1024x1024 only increases pixel density and does not alter the semantic alignment between the prompt and the generated image; the model's misinterpretation of 'red' would persist at any resolution. Option D is wrong because increasing the guidance scale to 20 excessively amplifies the prompt's influence, often leading to image saturation, artifacts, and mode collapse, while still not correcting the fundamental misassociation of the color attribute.

23
MCQhard

An enterprise uses a fine-tuned PaLM 2 model for code generation. They want to ensure the generated code passes security audits. Which combination of techniques would be most effective?

A.Integrate a static analysis tool in the pipeline and add a safety filter to reject code containing dangerous functions.
B.Use a few-shot prompt with examples of secure code and set temperature to 1.0.
C.Fine-tune the model on a dataset of insecure code and use top-p=0.9.
D.Increase the model's context window and use a system instruction to 'be secure'.
AnswerA

Static analysis and safety filters directly block insecure code patterns.

Why this answer

Integrating a static analysis tool (e.g., SonarQube, Checkmarx) into the pipeline provides automated, rule-based scanning for security vulnerabilities like SQL injection or buffer overflows, while a safety filter explicitly blocks generated code containing dangerous functions (e.g., eval(), exec()). This combination creates a defense-in-depth approach that catches both known vulnerability patterns and explicitly prohibited operations, which is essential for passing security audits.

Exam trap

The Generative AI Leader exam often tests the misconception that prompt engineering alone (e.g., system instructions or few-shot examples) is sufficient for security, when in fact deterministic validation and filtering techniques are required to enforce constraints reliably.

How to eliminate wrong answers

Option B is wrong because using a few-shot prompt with secure code examples does not guarantee the model will consistently avoid generating insecure code—temperature=1.0 increases randomness, making the output less deterministic and more likely to deviate from the secure examples. Option C is wrong because fine-tuning on a dataset of insecure code would teach the model to generate vulnerable patterns, which is counterproductive for security; top-p=0.9 does not prevent the model from outputting those learned insecure constructs. Option D is wrong because increasing the context window and using a system instruction to 'be secure' provides no enforcement mechanism—the model can still generate insecure code if the instruction is not followed, and there is no validation step to catch violations.

24
Multi-Selectmedium

Which TWO techniques are most effective for improving factual accuracy in a generative AI model's responses? (Choose two.)

Select 2 answers
A.Retrieval-Augmented Generation (RAG) with curated datasets.
B.Increasing the model's temperature to 1.5.
C.Grounding with a trusted knowledge base.
D.Using longer system prompts with multiple instructions.
E.Fine-tuning on a large corpus of general text.
AnswersA, C

RAG retrieves relevant, up-to-date documents to inform responses.

Why this answer

Grounding and RAG both provide external authoritative sources to enhance factual accuracy. Fine-tuning on general data doesn't guarantee accuracy, and increasing temperature hurts accuracy. Prompt engineering is helpful but not as robust as retrieval-based methods.

25
MCQhard

A healthcare startup has fine-tuned a Vertex AI PaLM 2 model on a dataset of medical records to generate patient summaries. The model produces fluent text but occasionally fabricates diagnoses not present in the input. The team has already tried increasing the training data size by 20% and adjusting the temperature from 0.7 to 0.2, but hallucinations persist. The summaries must be factually accurate for regulatory compliance. What should the team do next?

A.Increase the maximum output tokens to allow the model to generate more detailed summaries.
B.Implement a RAG pipeline using Vertex AI Search to retrieve relevant medical documents before generation.
C.Add more few-shot examples to the prompt for each generation.
D.Switch the base model to Gemini 1.5 Pro without additional changes.
AnswerB

RAG provides grounded, up-to-date context, reducing hallucinations significantly.

Why this answer

Implementing a Retrieval-Augmented Generation (RAG) pipeline with Vertex AI Search grounds the model's output in retrieved, authoritative medical documents. This directly addresses the root cause of hallucination—the model's reliance on its parametric memory—by providing factual context at inference time, which is far more effective for regulatory compliance than adjusting generation parameters or training data size alone.

Exam trap

The trap here is that candidates often assume adjusting model parameters (temperature, tokens) or switching models will fix hallucinations, when in fact the core issue is the lack of external knowledge grounding, which only RAG or similar retrieval-based techniques can reliably address for factual accuracy.

How to eliminate wrong answers

Option A is wrong because increasing maximum output tokens does not improve factual accuracy; it only allows the model to generate longer text, which can actually increase the opportunity for hallucinations. Option C is wrong because adding more few-shot examples to the prompt does not prevent the model from fabricating diagnoses; few-shot learning guides style and format but does not ground the model in external, verifiable facts. Option D is wrong because switching the base model to Gemini 1.5 Pro without additional changes does not solve the hallucination problem; all large language models can fabricate information when relying solely on their training data, and the underlying issue of factual grounding remains unaddressed.

26
MCQhard

The exhibit shows the deployment configuration for a conversational AI model used in a finance application. Users report that responses are creative but often contain factually incorrect financial advice. Which parameter change would most improve factual accuracy?

A.Add grounding sources, such as "EnterpriseSearch" or "Web"
B.Lower temperature to 0.1
C.Increase topP to 1.0
D.Increase maxOutputTokens to 1024
AnswerA

Grounding forces the model to base responses on real data, directly improving factual accuracy.

Why this answer

Adding grounding sources like EnterpriseSearch or Web provides the model with access to authoritative, up-to-date financial data, which directly reduces hallucinations by anchoring responses in verified facts rather than relying solely on the model's parametric knowledge. This is the most effective technique for improving factual accuracy in a domain where correctness is critical.

Exam trap

The Generative AI Leader exam often tests the misconception that adjusting sampling parameters (temperature, topP) can fix factual accuracy issues, when in reality those parameters only control output randomness and diversity, not the truthfulness of the underlying knowledge.

How to eliminate wrong answers

Option B is wrong because lowering temperature to 0.1 makes the model more deterministic and less creative, but it does not introduce new factual information; it only reduces randomness in token selection, which cannot fix incorrect knowledge baked into the model. Option C is wrong because increasing topP to 1.0 includes all possible tokens in the sampling pool, which actually increases the chance of selecting less likely and potentially incorrect tokens, harming factual accuracy. Option D is wrong because increasing maxOutputTokens to 1024 allows longer responses but does not improve the correctness of the content; it may even amplify errors by generating more text based on the same flawed internal knowledge.

27
MCQhard

A team deployed a fine-tuned model for code generation. After training, the model produces syntactically correct but functionally wrong code. What is the most likely cause?

A.Incorrect prompt format
B.Low temperature setting
C.Insufficient training epochs
D.Overfitting to training data
AnswerD

Model memorizes training examples, losing generalization.

Why this answer

Overfitting to training data causes the model to memorize specific code patterns and syntax from the training set without learning the underlying logic or functional requirements. This results in syntactically correct outputs that fail to generalize to new, unseen coding tasks, producing functionally wrong code despite proper syntax.

Exam trap

Google Cloud often tests the misconception that syntactically correct but functionally wrong code is caused by prompt or temperature issues, when in fact it is a classic sign of overfitting where the model memorizes syntax without understanding logic.

How to eliminate wrong answers

Option A is wrong because incorrect prompt format typically leads to malformed or irrelevant outputs, not syntactically correct but functionally wrong code; the model would likely produce gibberish or off-topic responses. Option B is wrong because low temperature setting reduces randomness and makes outputs more deterministic, which would actually improve syntactic correctness and consistency, not cause functional errors. Option C is wrong because insufficient training epochs would result in underfitting, where the model fails to learn even basic syntax and produces incomplete or incoherent code, not syntactically correct but functionally wrong outputs.

28
Multi-Selectmedium

A team wants to reduce hallucinations in a question-answering model. Which THREE techniques should they consider?

Select 3 answers
A.Fine-tune the model on a curated factual dataset
B.Use retrieval-augmented generation (RAG)
C.Apply prompt engineering with specific instructions to cite sources
D.Reduce the number of tokens in output
E.Increase the temperature parameter
AnswersA, B, C

Fine-tuning on factual data improves accuracy.

Why this answer

Fine-tuning on a curated factual dataset directly adjusts the model's weights to prioritize accurate, domain-specific knowledge, reducing the likelihood of generating unsupported or hallucinated content. This technique anchors the model's output in verified data, making it more reliable for question-answering tasks.

Exam trap

Google Cloud often tests the misconception that reducing output length or increasing randomness (temperature) can improve factual accuracy, when in reality these parameters control style and creativity, not truthfulness.

29
MCQmedium

A developer deployed a large language model on Vertex AI for real-time chat. Users report slow response times. The model generates sentences one word at a time. Which optimization should be applied to reduce latency?

A.Batch multiple user queries together.
B.Deploy the model with more accelerators.
C.Enable prompt caching to reuse previous queries.
D.Use streaming responses to start output earlier.
AnswerD

Streaming sends tokens as they are generated, reducing the wait for the full response.

Why this answer

Streaming responses allow the model to send tokens to the client as they are generated, rather than waiting for the full sequence to complete. This reduces perceived latency significantly in real-time chat, as users see the first word appear almost immediately, even though the total generation time remains similar.

Exam trap

The trap here is that candidates often confuse throughput optimization (batching or more accelerators) with latency reduction, failing to recognize that streaming directly minimizes the time users wait for the first visible output in real-time scenarios.

How to eliminate wrong answers

Option A is wrong because batching multiple user queries together increases latency for individual requests, as the system waits to accumulate enough queries before processing, which is counterproductive for real-time chat. Option B is wrong because deploying with more accelerators improves throughput and total generation speed, but does not address the fundamental issue of word-by-word generation latency; the model still outputs one token at a time, and the user must wait for the full response. Option C is wrong because prompt caching reuses previous queries to avoid recomputation, but this optimization targets repeated or similar prompts, not the latency of generating a new response token-by-token.

30
Multi-Selectmedium

Which TWO techniques are effective for reducing bias in generative AI model outputs?

Select 2 answers
A.Increasing model size to learn more patterns
B.Training on diverse and representative datasets
C.Relying solely on post-hoc filters
D.Using adversarial debiasing methods during fine-tuning
E.Limiting the model to only factual prompts
AnswersB, D

Correct: Diverse data helps reduce biased associations.

Why this answer

Training on diverse and representative datasets directly reduces sampling bias and coverage gaps in the training distribution, which are primary sources of stereotypical or skewed outputs. By ensuring the model sees balanced examples across demographics, contexts, and edge cases, it learns more equitable representations and reduces the likelihood of generating biased content.

Exam trap

Google Cloud often tests the misconception that increasing model size or adding post-hoc filters is sufficient to mitigate bias, when in reality these approaches fail to address the root causes of bias in training data and model representations.

31
MCQhard

A research lab is fine-tuning a large language model on a small dataset of medical records. They observe that the model overfits, memorizing specific patient details and producing outputs that violate privacy regulations. Which technique should they apply to improve generalization and reduce memorization?

A.Increase the batch size to 64
B.Increase the number of training epochs
C.Use early stopping based on validation loss
D.Apply differential privacy (DP-SGD) during fine-tuning
AnswerD

DP-SGD bounds the influence of any single example, reducing memorization and improving privacy.

Why this answer

Differential privacy (DP-SGD) is the correct technique because it directly addresses memorization of sensitive patient data by adding calibrated noise to the gradient updates during fine-tuning. This bounds the model's ability to encode any single individual's information, improving generalization and ensuring compliance with privacy regulations like HIPAA.

Exam trap

Google Cloud often tests the misconception that early stopping or batch size adjustments can prevent memorization, when in fact only techniques like differential privacy directly bound the influence of individual training examples.

How to eliminate wrong answers

Option A is wrong because increasing batch size to 64 reduces gradient variance but does not prevent memorization of specific patient details; it may even accelerate overfitting on a small dataset. Option B is wrong because increasing the number of training epochs exacerbates overfitting, causing the model to memorize more training examples and worsen privacy violations. Option C is wrong because early stopping based on validation loss only halts training when validation performance degrades, but it does not impose any privacy guarantee or fundamentally limit memorization of unique patient records.

32
MCQhard

An AI team is building a customer support chatbot for a telecom company using a fine-tuned LLM on Vertex AI. The model performs well on common issues but fails to answer correctly for rare or novel problems, often providing plausible-sounding but incorrect solutions. The team has a large corpus of internal troubleshooting documents. They want to minimize incorrect answers while keeping latency low. Which approach should they take?

A.Switch to a larger base model (e.g., Gemini Ultra) without any retrieval.
B.Implement a retrieval-augmented generation (RAG) pipeline using Vertex AI Search to fetch relevant documents before generating answers.
C.Collect more data on rare issues and continue fine-tuning the model weekly.
D.Use a few-shot prompt with 10 examples of rare problems and solutions.
AnswerB

RAG dynamically retrieves relevant context, enabling accurate answers for rare issues.

Why this answer

Implementing a RAG pipeline with Vertex AI Search allows the chatbot to retrieve relevant troubleshooting documents from the internal corpus in real-time, grounding the LLM's responses in authoritative sources. This approach directly addresses the problem of plausible-sounding but incorrect answers for rare/novel issues without requiring retraining, and it keeps latency low by fetching only the most relevant documents before generation.

Exam trap

Google often tests the misconception that fine-tuning or larger models alone can solve knowledge gaps, when in fact retrieval-augmented generation is the standard approach for grounding LLM outputs in up-to-date, domain-specific documents without retraining.

How to eliminate wrong answers

Option A is wrong because switching to a larger base model without retrieval does not solve the core issue of hallucination on rare/novel problems; larger models can still generate plausible-sounding but incorrect answers when they lack specific knowledge, and they often increase latency and cost. Option C is wrong because collecting more data on rare issues and fine-tuning weekly is resource-intensive, may lead to catastrophic forgetting of common issues, and cannot keep pace with the long tail of novel problems that emerge dynamically. Option D is wrong because a few-shot prompt with 10 examples is insufficient to cover the vast space of rare problems, and the model may still hallucinate when the input does not closely match any example, especially without retrieval grounding.

33
Multi-Selectmedium

A development team is integrating a large language model into a healthcare application. They need to reduce the risk of generating harmful medical advice. Which THREE measures should they implement? (Choose three.)

Select 3 answers
A.Use a safety filter to block outputs containing harmful medical terminology.
B.Implement RAG to retrieve verified medical information from trusted sources.
C.Fine-tune the model on a curated dataset of medical textbooks.
D.Include a disclaimer in the system instruction that the model is not a doctor.
E.Set the temperature to a very high value to ensure diverse outputs.
AnswersA, B, C

Safety filters directly block harmful content at inference time.

Why this answer

Implementing a safety filter that blocks outputs containing harmful medical terminology directly mitigates the risk of generating dangerous advice. This acts as a post-processing guardrail, intercepting model outputs that include terms associated with diagnoses, dosages, or procedures that could lead to patient harm. It is a standard practice in high-stakes domains to layer such filters on top of the generative model.

Exam trap

The Generative AI Leader exam often tests the misconception that disclaimers or system instructions alone are sufficient safety measures, when in fact they do not technically prevent the model from generating harmful content—only post-hoc filtering or architectural controls like RAG and fine-tuning can reduce the risk at the output level.

34
MCQmedium

A developer is building a customer support chatbot using a large language model. The chatbot frequently generates plausible-sounding but incorrect answers to product questions. Which technique should be applied to improve factual accuracy?

A.Provide a few-shot example of correct answers in the prompt.
B.Use a higher temperature setting to encourage more creative responses.
C.Increase the model's context length to include more of the conversation history.
D.Enable Grounding with the company's product knowledge base.
AnswerD

Grounding retrieves live, verified data and injects it into the prompt, directly improving factual accuracy.

Why this answer

Grounding (e.g., using Vertex AI Grounding with Search) retrieves relevant information from a trusted source in real time, reducing hallucination. Option A is wrong because few-shot prompting can help but only if examples are accurate and relevant; it does not dynamically look up facts. Option B is wrong because higher temperature increases randomness, worsening hallucinations.

Option C is wrong because increasing context length may include more irrelevant information and does not guarantee accuracy.

35
MCQmedium

A content generation model for e-commerce product descriptions repeats the same phrases across multiple descriptions (e.g., 'high-quality', 'best-in-class'). The team wants more varied and engaging output. Which parameter adjustment is most appropriate?

A.Increase the frequency penalty parameter to 1.0.
B.Decrease the max output tokens to 50.
C.Increase the temperature parameter to 1.5.
D.Set the top-p value to a very small number like 0.1.
AnswerA

Frequency penalty specifically reduces the model's tendency to repeat tokens, improving lexical diversity.

Why this answer

Increasing the frequency penalty to 1.0 penalizes tokens that have already appeared in the generated text, directly reducing repetition of phrases like 'high-quality' and 'best-in-class'. This encourages the model to use more diverse vocabulary and sentence structures, leading to varied and engaging product descriptions.

Exam trap

The Generative AI Leader exam often tests the distinction between frequency penalty and temperature, where candidates mistakenly increase temperature to add variety, not realizing that temperature increases randomness and can break coherence, while frequency penalty directly targets repetition without sacrificing quality.

How to eliminate wrong answers

Option B is wrong because decreasing max output tokens to 50 limits the length of each description but does not address the root cause of phrase repetition; the model can still repeat phrases within the shorter output. Option C is wrong because increasing temperature to 1.5 makes the output more random and less coherent, which can lead to nonsensical descriptions rather than controlled variation. Option D is wrong because setting top-p to a very small number like 0.1 restricts the model to only the most likely tokens, which actually increases repetition and reduces diversity, the opposite of the desired outcome.

36
Multi-Selecthard

Which TWO techniques can help reduce latency for a real-time generative AI application? (Choose two.)

Select 2 answers
A.Use streaming responses to send tokens as generated.
B.Quantize the model to a lower precision.
C.Deploy more model replicas to handle load.
D.Enable prompt caching for repeated queries.
E.Batch multiple user requests together.
AnswersA, B

Streaming eliminates waiting for the full output, reducing perceived latency.

Why this answer

Streaming and model quantization directly reduce response time. Batching is for offline, and more deploy replicas can increase throughput but not necessarily reduce latency for a single request. Prompt caching can help if prompts repeat, but not generally.

37
MCQhard

A generative AI model for chatbot responses sometimes produces toxic language. The team wants to reduce toxicity without significantly affecting the model's helpfulness. Which approach is best?

A.Increase the temperature parameter
B.Reduce the maximum output tokens
C.Fine-tune with a dataset of non-toxic responses and use RLHF
D.Apply a toxicity classifier as a post-processing filter
AnswerC

Fine-tuning combined with RLHF aligns model behavior effectively.

Why this answer

Fine-tuning with a curated dataset of non-toxic responses directly adjusts the model's weights to reduce the likelihood of generating toxic language, while RLHF (Reinforcement Learning from Human Feedback) further aligns the model with human preferences for helpfulness and safety. This combined approach addresses the root cause of toxicity in the model's behavior without the blunt trade-offs of other methods, preserving the model's utility.

Exam trap

Google Cloud often tests the misconception that post-processing filters (like toxicity classifiers) are sufficient for safety, when in fact they fail to address the model's learned behavior and can degrade helpfulness due to false positives, making fine-tuning with RLHF the superior alignment technique.

How to eliminate wrong answers

Option A is wrong because increasing the temperature parameter increases randomness in token selection, which can actually amplify the probability of generating toxic or nonsensical outputs, not reduce them. Option B is wrong because reducing the maximum output tokens limits response length but does not influence the content or safety of the generated tokens, leaving toxicity unchanged. Option D is wrong because applying a toxicity classifier as a post-processing filter only masks toxic outputs after generation, wasting computational resources and potentially blocking helpful responses that contain false-positive flagged terms, without fixing the underlying model behavior.

38
Multi-Selectmedium

Which TWO techniques can help improve the factual accuracy of a language model's outputs? (Choose two.)

Select 2 answers
A.Decrease the max output tokens.
B.Increase the temperature parameter.
C.Fine-tune on a domain-specific curated dataset.
D.Implement retrieval-augmented generation (RAG).
E.Use top-k random sampling.
AnswersC, D

Fine-tuning adapts the model to domain facts.

Why this answer

Fine-tuning on a domain-specific curated dataset (C) directly adjusts the model's weights using high-quality, verified examples, teaching it to produce factually correct outputs for that domain. This reduces hallucinations by grounding the model in accurate, relevant data rather than relying solely on its pre-training distribution.

Exam trap

Google Cloud often tests the misconception that adjusting decoding parameters (like temperature, top-k, or max tokens) can improve factual accuracy, when in reality these only control output style, length, or randomness, not the correctness of the underlying information.

39
MCQhard

A model generates responses that frequently repeat phrases or words. Which parameter adjustment is most likely to fix this?

A.Increase top_k
B.Increase temperature
C.Increase repetition penalty
D.Increase max output tokens
AnswerC

Correct: Repetition penalty specifically reduces the likelihood of repeating tokens.

Why this answer

Increasing the repetition penalty directly discourages the model from selecting tokens that have already appeared in the generated sequence, thereby reducing repetitive phrases or words. This parameter works by subtracting a fixed penalty from the logits of previously generated tokens before applying the softmax function, making them less likely to be chosen again.

Exam trap

The trap here is that candidates often confuse repetition penalty with diversity-promoting parameters like temperature or top_k, mistakenly believing that increasing randomness or narrowing token selection will fix repetition, when in fact those adjustments can worsen the problem.

How to eliminate wrong answers

Option A is wrong because increasing top_k limits the sampling pool to the k most likely next tokens, which can actually increase repetition by narrowing the diversity of choices. Option B is wrong because increasing temperature flattens the probability distribution, making all tokens more equally likely, which can lead to more random and potentially more repetitive outputs, not less. Option D is wrong because increasing max output tokens only extends the length of the generated response; it does not address the underlying cause of repetition and may even exacerbate it by allowing more opportunities for the model to loop on repeated phrases.

40
MCQmedium

A company uses a generative model to produce product descriptions. The descriptions are factually inconsistent with the product specs. Which technique would best ensure factual accuracy?

A.Enhance the system prompt with product details
B.Implement retrieval-augmented generation (RAG) with product database
C.Lower the temperature to 0.0
D.Fine-tune the model on product descriptions
AnswerB

RAG grounds generation in factual data.

Why this answer

Retrieval-augmented generation (RAG) is the best technique because it dynamically retrieves relevant, up-to-date product specifications from a trusted database at inference time, grounding the model's output in verified facts. This directly addresses factual inconsistency by ensuring the generated description is based on authoritative source data rather than relying solely on the model's parametric memory.

Exam trap

Google Cloud often tests the misconception that prompt engineering alone (Option A) or deterministic sampling (Option C) can solve factual grounding issues, when in reality they do not provide external knowledge retrieval to correct hallucinations.

How to eliminate wrong answers

Option A is wrong because enhancing the system prompt with product details only provides static context that the model may still hallucinate or misinterpret; it does not enforce retrieval of current or specific factual data. Option C is wrong because lowering the temperature to 0.0 makes the output more deterministic but does not prevent the model from generating factually incorrect content that is confidently wrong. Option D is wrong because fine-tuning on product descriptions can improve style and consistency but does not guarantee factual accuracy for new or updated product specs, and it risks overfitting or memorizing inaccuracies from the training data.

41
MCQeasy

A company uses a text generation model for customer support but notices it occasionally provides outdated information. Which technique should they implement to improve output accuracy?

A.Increase max output tokens
B.Implement retrieval-augmented generation (RAG)
C.Fine-tune the model with more historical support data
D.Increase model temperature to 1.0
AnswerB

RAG retrieves current information, making outputs accurate and up-to-date.

Why this answer

Retrieval-augmented generation (RAG) is the correct technique because it grounds the model's output in real-time, external knowledge sources (e.g., a vector database or document index) rather than relying solely on static training data. This directly addresses the problem of outdated information by allowing the model to retrieve and synthesize current facts at inference time, ensuring accuracy without requiring retraining.

Exam trap

The trap here is that candidates often confuse fine-tuning (which adapts the model's weights to a static dataset) with RAG (which dynamically retrieves external knowledge), leading them to choose fine-tuning as a 'deeper' fix when the core issue is stale information, not model capability.

How to eliminate wrong answers

Option A is wrong because increasing max output tokens only extends the length of the generated response, not its factual accuracy or timeliness; it may even introduce more hallucinated content. Option C is wrong because fine-tuning with more historical support data would reinforce outdated patterns and biases, making the model more likely to repeat stale information rather than adapt to current knowledge. Option D is wrong because increasing model temperature to 1.0 increases randomness and creativity in outputs, which degrades factual precision and reliability, the opposite of what is needed for accurate customer support.

42
MCQeasy

Refer to the exhibit. A data scientist sends a prediction request to a text generation model with the following parameters and receives repetitive output. Which parameter should be changed?

A.Decrease topP to 0.5
B.Increase topK to 100
C.Decrease maxOutputTokens
D.Increase temperature to 0.5
AnswerD

Introduces randomness to avoid repetition.

Why this answer

Temperature 0.0 makes the model deterministic, leading to repetitive text. Increasing temperature to 0.5 introduces randomness. Decreasing topP may help but temperature is the direct cause.

Increasing topK adds diversity but less effect, decreasing max tokens doesn't fix repetition.

43
MCQmedium

A team uses Vertex AI Generative AI Studio to tune a model via RLHF. After tuning, the model outputs are bland. What likely went wrong?

A.Insufficient training data
B.Too many training steps
C.Low temperature during evaluation
D.Reward model overfits to generic responses
AnswerD

Penalizes unique outputs, making them bland.

Why this answer

When the reward model overfits to generic responses, it assigns high rewards to safe, non-committal outputs, causing the RLHF-tuned model to converge toward bland, uninformative text. This happens because the reward model learns to prefer patterns that are statistically common in the training data rather than genuinely high-quality or diverse responses, directly leading to the 'bland' output described.

Exam trap

Google often tests the misconception that bland outputs are caused by inference-time parameters like temperature, rather than by the reward model overfitting during the RLHF training phase.

How to eliminate wrong answers

Option A is wrong because insufficient training data typically causes underfitting or poor generalization, not specifically bland outputs; RLHF can still produce diverse responses if the reward model is well-calibrated. Option B is wrong because too many training steps usually lead to overfitting or reward hacking, where the model exploits the reward model for extreme or repetitive outputs, not blandness. Option C is wrong because low temperature during evaluation reduces randomness and can make outputs more deterministic, but it does not inherently cause blandness; the model would still produce coherent, contextually appropriate responses, just with less creativity.

44
MCQmedium

What is the primary purpose of a system instruction in the Gemini API?

A.Set the model's temperature and top_p
B.Define the overall behavior and constraints for the model
C.Provide few-shot examples for each query
D.Set the maximum output length
AnswerB

Correct: System instructions guide the model's persona and rules.

Why this answer

The system instruction in the Gemini API is the primary mechanism to define the overall behavior, persona, constraints, and guardrails for the model across all interactions. Unlike per-query parameters, it sets a persistent context that shapes how the model interprets every user prompt, ensuring consistent adherence to rules such as tone, format, or safety policies.

Exam trap

Google Cloud often tests the distinction between persistent system-level instructions and per-request parameters, so the trap here is confusing the system instruction (which defines the model's role and constraints) with generation controls like temperature, top_p, or max tokens, which only affect the style or length of a single response.

How to eliminate wrong answers

Option A is wrong because temperature and top_p are sampling parameters that control randomness and diversity of output, not the overarching behavioral constraints set by a system instruction. Option C is wrong because few-shot examples are typically provided in the user prompt or as part of a structured conversation, not as the primary purpose of a system instruction, which is for persistent context rather than per-query demonstrations. Option D is wrong because maximum output length is a generation parameter that limits token count, not a behavioral or constraint-setting mechanism like a system instruction.

45
MCQhard

A company is deploying a generative AI model for customer support. They want to reduce hallucinations while maintaining fluency. They have a large dataset of previous support conversations. Which strategy should they prioritize?

A.Increase the beam search width to 10.
B.Implement retrieval-augmented generation (RAG) using the conversation dataset as a knowledge base.
C.Fine-tune the model on the conversation dataset.
D.Set the temperature to 0.1.
AnswerB

RAG retrieves relevant facts from the dataset, reducing hallucinations.

Why this answer

Retrieval-augmented generation (RAG) directly addresses hallucinations by grounding the model's responses in factual, retrieved data from the conversation dataset. This approach allows the model to generate fluent, contextually relevant answers while reducing the risk of inventing information, as it retrieves actual support interactions as evidence before generating a response.

Exam trap

Google Cloud often tests the misconception that tuning generation parameters (like temperature or beam search) can fix hallucinations, when in fact only grounding techniques like RAG or knowledge graph integration address the root cause of factual inaccuracy.

How to eliminate wrong answers

Option A is wrong because increasing beam search width to 10 improves output fluency by exploring more candidate sequences but does not reduce hallucinations; it may even amplify incorrect patterns if the model is prone to hallucination. Option C is wrong because fine-tuning on the conversation dataset can improve domain-specific fluency but risks overfitting to noise or biases in the data, and without retrieval, the model may still hallucinate when faced with novel queries. Option D is wrong because setting temperature to 0.1 makes the model more deterministic and less creative, which can reduce variability but does not prevent hallucinations; it may cause the model to repeat common but incorrect patterns from training data.

46
Multi-Selecteasy

Which THREE strategies should be combined to effectively reduce biased outputs in a generative AI model? (Choose three.)

Select 3 answers
A.Implement safety filters targeting hate speech and stereotypes.
B.Conduct human evaluation and feedback loops.
C.Use diverse few-shot examples that represent different demographics.
D.Raise the temperature to increase output variability.
E.Fine-tune the model on a biased dataset to learn patterns.
AnswersA, B, C

Safety filters block explicitly biased content.

Why this answer

Implementing safety filters targeting hate speech and stereotypes directly blocks the generation of biased or harmful content at the output layer. These filters use predefined rule sets or trained classifiers to detect and suppress language that reflects demographic or cultural biases, reducing the risk of the model producing offensive or stereotypical responses.

Exam trap

Google often tests the misconception that increasing randomness (temperature) or training on biased data can somehow reduce bias, when in fact both actions worsen the problem by either amplifying noise or embedding the bias deeper into the model's weights.

47
MCQmedium

A financial services firm is using a foundation model on Vertex AI to generate investment summaries from quarterly reports. The summaries are accurate but often miss key financial metrics and trends. The team cannot afford to fine-tune the model frequently. Which technique should they use to improve the completeness and relevance of the summaries without modifying the model?

A.Increase temperature to 0.9 to encourage more creative outputs.
B.Provide three few-shot examples in the prompt that highlight the desired metrics.
C.Set stop sequences to [' '] to ensure the model finishes each paragraph.
D.Lower top_p to 0.5 to reduce the sampling pool.
AnswerB

Few-shot examples condition the model to replicate the structure and content of the examples.

Why this answer

Few-shot prompting provides the model with concrete examples of desired output structure and content, guiding it to include key financial metrics and trends without retraining. This technique leverages in-context learning, where the model generalizes from the examples in the prompt to produce more complete and relevant summaries, while avoiding the cost and latency of fine-tuning.

Exam trap

The trap here is that candidates confuse hyperparameter tuning (temperature, top_p) with prompt engineering, assuming that increasing randomness or restricting token selection will improve output quality, when in fact few-shot examples directly teach the model the desired output structure without modifying the model.

How to eliminate wrong answers

Option A is wrong because increasing temperature to 0.9 encourages randomness and creativity, which would likely make summaries less focused and more prone to missing key metrics, not more complete. Option C is wrong because setting stop sequences to ['

'] only controls when the model stops generating text, but does not influence the content or inclusion of specific financial metrics within the output. Option D is wrong because lowering top_p to 0.5 reduces the sampling pool to only the most likely tokens, which can make outputs more repetitive and less likely to include diverse or specific metrics, not improve completeness.

48
MCQhard

A healthcare company is using a fine-tuned version of PaLM 2 on Vertex AI to generate clinical notes from doctor-patient conversations. The model was fine-tuned on a dataset of 10,000 de-identified transcripts and corresponding notes. During testing, the generated notes are grammatically correct and well-structured, but they often contain subtle inaccuracies: for example, they might mention a medication that was not discussed, or omit a key symptom. The team has already tried increasing the training epochs and adjusting learning rates, with minimal improvement. They need a solution that can be implemented quickly to improve factual accuracy without retraining the entire model. The team has access to a large archive of verified clinical notes and a small set of recent conversation-to-note pairs that have been manually reviewed and corrected. The inference pipeline currently uses a single call to the model with the conversation transcript as input. What should the team do?

A.Implement retrieval-augmented generation (RAG) by retrieving similar verified notes from the archive and providing them as context in the prompt.
B.Decrease the temperature to 0.1 to reduce randomness and force the model to stick to the input.
C.Use prompt engineering to instruct the model to only include information explicitly mentioned in the conversation.
D.Add a human-in-the-loop step to review and correct every generated note before use.
AnswerA

RAG grounds the generation in factual examples, directly reducing inaccuracies without retraining.

Why this answer

Retrieval-augmented generation (RAG) directly addresses the core issue of factual inaccuracy without retraining. By retrieving verified clinical notes similar to the current conversation from the archive and injecting them as context in the prompt, the model gains access to ground-truth examples that anchor its output to factual details. This approach leverages the team's existing archive and small set of corrected pairs to provide relevant, accurate context, improving precision without modifying the model's weights.

Exam trap

The trap here is that candidates often assume factual inaccuracy is solely a randomness issue (temperature) or a prompt instruction problem, overlooking that the model's parametric knowledge is insufficient and needs external grounding via retrieval augmentation.

How to eliminate wrong answers

Option B is wrong because decreasing temperature to 0.1 reduces randomness but does not fix factual inaccuracies stemming from the model's training data or lack of context; it may actually cause the model to become overly deterministic and repeat hallucinations from its fine-tuning. Option C is wrong because prompt engineering to instruct the model to only include explicitly mentioned information is a superficial fix that cannot overcome the model's tendency to hallucinate or omit details when the training data or fine-tuning process has embedded those inaccuracies; it lacks the grounding provided by external verified data. Option D is wrong because adding a human-in-the-loop step to review every note is a manual, non-scalable solution that does not improve the model's output quality at inference time and fails to address the root cause of factual inaccuracy; it also contradicts the requirement for a quick implementation without retraining.

49
MCQmedium

A travel company fine-tuned a language model on customer chat logs to provide travel recommendations. After deployment, they receive complaints that the model sometimes generates inappropriate or offensive content. What is the most effective approach to improve output safety while preserving overall performance?

A.Modify the system instruction to request polite responses only
B.Retrain the model on a larger dataset of chat logs
C.Reduce the temperature to 0.0
D.Add a post-processing safety classifier that filters or rewrites unsafe outputs
AnswerD

A safety classifier directly catches and mitigates harmful content without modifying the base model.

Why this answer

A post-processing safety classifier acts as a guardrail that can detect and filter or rewrite unsafe outputs without altering the underlying model's weights or training data. This approach preserves the model's overall performance on safe, relevant recommendations while adding a dedicated safety layer that can be independently tuned and updated as new safety requirements emerge. Unlike prompt engineering or hyperparameter adjustments, a classifier provides a robust, policy-enforced mechanism to catch edge cases that the model might otherwise generate.

Exam trap

Google often tests the misconception that prompt engineering or hyperparameter tuning alone can reliably fix safety issues, when in fact they are insufficient against learned toxic patterns in the model's weights, and a dedicated safety classifier is the standard industry practice for robust output filtering.

How to eliminate wrong answers

Option A is wrong because modifying the system instruction is a form of prompt engineering that can be easily overridden by the model's learned patterns from training data; it does not guarantee the model will never generate offensive content, especially if such patterns exist in the fine-tuning data. Option B is wrong because retraining on a larger dataset of chat logs does not address the root cause of inappropriate outputs—if the original data contains toxic or biased examples, simply adding more data may dilute but not eliminate the problem, and could even introduce new unsafe patterns. Option C is wrong because reducing temperature to 0.0 makes the model deterministic and greedy, which reduces creativity but does not prevent the model from generating the most likely token sequence that could still be offensive; it also harms performance on diverse, nuanced travel recommendations.

50
MCQeasy

A developer is using Vertex AI PaLM 2 to generate product descriptions. The output is often too verbose and includes irrelevant details. Which technique should the developer apply?

A.Set top_p to 0.1
B.Enable safety filters
C.Use few-shot prompting with examples of concise descriptions
D.Increase temperature to 0.9
AnswerC

Guides the model to match the style of provided examples.

Why this answer

The developer needs to constrain the model's output to be concise and relevant. Few-shot prompting provides the model with explicit examples of the desired output format (concise descriptions), guiding it to mimic that style and length. This directly addresses verbosity and irrelevant details without altering the model's fundamental randomness or safety settings.

Exam trap

The trap here is that candidates confuse hyperparameter tuning (top_p, temperature) with prompt engineering techniques, assuming that reducing randomness (top_p) or increasing creativity (temperature) can fix verbosity, when only explicit examples in the prompt can reliably enforce a specific output style.

How to eliminate wrong answers

Option A is wrong because setting top_p to 0.1 reduces the cumulative probability threshold for token sampling, which makes the output less diverse and more deterministic, but it does not teach the model to be concise or omit irrelevant details—it only narrows the pool of possible next tokens. Option B is wrong because safety filters block harmful or sensitive content (e.g., toxicity, violence), not verbose or irrelevant details; they do not control output length or relevance. Option D is wrong because increasing temperature to 0.9 increases randomness and creativity in token selection, which would likely make the output even more verbose and include more irrelevant details, the opposite of what is needed.

51
MCQeasy

A developer is using the Gemini API to build a chatbot. They want the model to always respond in a friendly, professional tone. Which prompt engineering technique should they use?

A.Set system instructions to 'You are a friendly and professional assistant.'
B.Include a few-shot example in every user message.
C.Set the temperature to 0.2.
D.Set max output tokens to 100.
AnswerA

System instructions define the assistant's behavior for the entire session.

Why this answer

Setting system instructions is the most direct and reliable way to define the model's persona and behavioral constraints. In the Gemini API, system instructions act as a persistent, top-level directive that influences every response, ensuring the chatbot consistently adopts a friendly and professional tone without requiring repeated examples or parameter tuning.

Exam trap

Google Cloud often tests the distinction between controlling output style (system instructions) versus controlling output randomness (temperature) or length (max tokens), so the trap here is that candidates may confuse temperature or token limits with persona control, thinking that lowering creativity or capping length will enforce a specific tone.

How to eliminate wrong answers

Option B is wrong because including a few-shot example in every user message is inefficient and not a persistent technique; it would require repeating the example in each turn, increasing token usage and latency, and it does not guarantee consistent tone across all interactions. Option C is wrong because setting the temperature to 0.2 controls randomness and creativity, not tone; a low temperature makes outputs more deterministic but does not enforce a specific persona or style. Option D is wrong because setting max output tokens to 100 limits response length but has no effect on the tone or style of the output; it only truncates the response.

Ready to test yourself?

Try a timed practice session using only Improve Gen Ai Output questions.