↑ ↓ to move, Enter to open, Esc to close

    GCP-GAILGenerative AI Leader

    Switch exam

    Microsoft Azure

    aws Amazon Web Services

    Google Cloud

    ServiceNow

    Databricks

    Cisco

    Salesforce

    All exams and search
    Free exam

    Exams / GCP-GAIL / D3 Techniques to improve gen AI model output

    D3.1

    Techniques to improve gen AI model output

    • 1 min read
    • 4 sections
    • 17 questions
    • Exam domain: Techniques to improve gen AI model output

    Prompt engineering

    Prompt engineering is "the iterative process of creating a prompt and accessing" the model's response to steer it toward the desired result. A prompt can hold instructions, context, few-shot examples and partial input.

    Technique What you do Use when
    Zero-shot Plain request, no examples Simple tasks
    Few-shot Add several examples Dictate style, tone, format; show successful interactions
    Role / persona "You are a …" in the system prompt Tone, audience, policy-aware voice
    Context Add audience, keywords, facts Generic or off-brand output
    Prompt chaining Split a task; one output feeds the next prompt Complex, multi-step tasks
    Chain-of-thought Spell out reasoning steps Reasoning tasks

    Multi-turn chat is different: the model "tracks the history of a chat conversation" and uses it as context.

    Grounding and RAG

    Grounding is "the process of connecting a model's output to verifiable sources". It reduces hallucinations. RAG is the common implementation: search finds relevant information and adds it to the prompt, so new or private data needs no retraining and is cheaper than fine-tuning.

    RAG flow

    Parameters

    Setting Effect
    Temperature Randomness of token selection; low = predictable
    Top-P / Top-K Which candidate tokens are considered
    Max output tokens Caps response length (concise summaries)
    Safety settings Filter harmful content

    Other levers

    • Human-in-the-loop review for nuance (sarcasm, satire) and critical decisions.
    • De-identification (mask, delete, obscure PII) before training on sensitive data.

    Which lever fixes what

    Exam traps

    • Hallucination or stale knowledge: grounding/RAG, never higher temperature or safety filters.
    • Missing brand/tone: richer prompt (role, context), not a longer output limit.
    • Private PII in training data: anonymize; access control alone is not enough.
    • "Remember earlier turns" is worded as prompt chaining on the exam although docs call it chat history.
    • New documents, cost-effective: RAG, not fine-tuning.
    • Google Vids = avatar + AI voiceover videos.

    Docs

    The rest of this chapter is part of the GCP-GAIL premium course

    Unlock every chapter, all 99 questions and spaced review with All access or a 90-day exam pass. Every Fundamentals exam stays free, and the first chapter of every exam is open.

    Chapters