Courseiva

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

A company notices that their AI chatbot occasionally generates incorrect information. Which technique can best reduce hallucinations without retraining?

⚠ Common exam trap

Google often tests the misconception that adjusting sampling parameters (like top_p or temperature) can fix hallucinations, when in reality these parameters control randomness, not factual grounding, and the correct solution is to constrain the model's output to a trusted context.

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

✓

Use system instructions to constrain the model to only answer from provided context

Constraining the model to answer only from provided context directly addresses the root cause of hallucinations—the model generating information not grounded in verified sources. This technique, often implemented via system instructions or retrieval-augmented generation (RAG) pipelines, forces the model to rely on a trusted knowledge base rather than its parametric memory, effectively eliminating unsupported fabrications without requiring retraining.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Use a longer system prompt without examples

    Why it's wrong here

    A longer prompt without examples adds instructions but no grounding evidence, so the model still fabricates when its parametric knowledge is absent or stale. Few-shot examples or retrieval-augmented generation supply that evidence; prompt length alone does not anchor factual claims.

  • ✓

    Use system instructions to constrain the model to only answer from provided context

    Why this is correct

    System instructions steer generation by restricting the model to answer solely from supplied context, so unsupported claims are refused rather than invented. This constrains decoding behaviour at inference time, reducing hallucinations without any retraining, fine-tuning or modification of model weights.

  • ✗

    Set top_p to 0.1

    Why it's wrong here

    Nucleus sampling at top_p 0.1 restricts token choice to a narrow high-probability set, which reduces diversity but does not supply missing facts, so the model can still assert wrong information confidently. Retrieval-augmented generation grounds answers in source documents, which is what prevents fabrication.

  • ✗

    Increase temperature to 0.9

    Why it's wrong here

    Raising temperature to 0.9 increases sampling randomness, producing more varied and less factual output, so hallucinations typically worsen. Temperature controls creativity for brainstorming or marketing copy; reducing it toward zero is what constrains the model to likely tokens.

About these practice questions

One of 1,008 original Generative AI Leader practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.