Courseiva

Generative AI Leader Practice Question: Techniques to Improve Generative AI Model Output

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?

⚠ Common 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.

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

✓

Set system instructions to 'You are a friendly and professional assistant.'

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.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Set system instructions to 'You are a friendly and professional assistant.'

    Why this is correct

    System instructions establish persistent behavioural guidance applied across every turn, so the model consistently adopts the friendly, professional tone. This satisfies the requirement for an always-consistent tone, unlike per-message prompting, which must be repeated and can drift between requests.

  • ✗

    Include a few-shot example in every user message.

    Why it's wrong here

    Repeating few-shot examples in every user message consumes context and still does not persist a tone rule across turns, since each message is processed independently. Few-shot prompting is for teaching output format or task pattern within one request, such as classifying tickets into a fixed label set.

  • ✗

    Set the temperature to 0.2.

    Why it's wrong here

    Temperature governs randomness of token selection, not tone; a low value makes replies deterministic and repetitive, not friendly or professional. It is the right control when the task demands consistent, reproducible outputs, such as extracting structured data or generating deterministic code.

  • ✗

    Set max output tokens to 100.

    Why it's wrong here

    Capping max output tokens truncates response length; it exerts no control over tone or word choice, and short replies can read as curt. Token limits are for constraining cost, latency or verbosity — appropriate when a chatbot must return terse machine-readable answers rather than friendly prose.

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.