Courseiva

Generative AI Leader Google Cloud's Generative AI Offerings Practice Question

A data scientist is using the Vertex AI PaLM API for text generation. They notice that the model occasionally generates toxic content. Which parameter should they adjust to reduce the likelihood of toxic outputs?

⚠ Common exam trap

Many candidates confuse parameters that control output randomness (temperature, top_k) with those that enforce content safety, leading them to incorrectly select temperature or top_k instead of the dedicated safety_settings parameter.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

safety_settings

Safety settings in the Vertex AI PaLM API allow you to configure thresholds for filtering harmful content categories (e.g., toxicity, harassment, hate speech). By adjusting these settings, you can block or reduce the likelihood of toxic outputs before they are returned, directly addressing the problem without altering the model's creativity or randomness.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    max_output_tokens

    Why it's wrong here

    max_output_tokens caps response length, so it truncates text rather than preventing harmful content; a short toxic phrase still passes through. It is tempting because it bounds cost and latency, but the stem concerns content safety, which the API's safety settings address.

  • ✗

    temperature

    Why it's wrong here

    Temperature controls sampling randomness, so lowering it makes token selection deterministic but does nothing to filter harmful vocabulary; a confident toxic completion remains likely. It is tempting because temperature tuning is the usual remedy for erratic output, yet safety filtering requires the dedicated safety settings or thresholds.

  • ✗

    top_k

    Why it's wrong here

    top_k limits sampling to the k highest-probability tokens, which constrains diversity but not offensiveness; a toxic token can still rank first. It is tempting because top_k is a standard decoding control, yet reducing toxic outputs requires the API's safety attribute thresholds, which block harmful categories.

  • ✓

    safety_settings

    Why this is correct

    safety_settings configures per-category harm thresholds, such as harassment, hate speech and dangerous content, that filter model output. Raising the blocking sensitivity reduces toxic generations, directly addressing the observed behaviour without altering temperature or token limits.

About these practice questions

This Generative AI Leader question is part of Courseiva's 1,008-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This Generative AI Leader practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Generative AI Leader exam.