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

    awsAIF-C01AI Practitioner

    Switch exam

    Microsoft Azure

    aws Amazon Web Services

    Google Cloud

    ServiceNow

    Databricks

    Cisco

    Salesforce

    All exams and search
    Free exam

    Exams / AIF-C01 / D3 Fundamentals of GenAI

    D3.3

    Fundamentals of GenAI (part 3 of 3)

    • 2 min read
    • 4 sections
    • 26 questions
    • Exam domain: Fundamentals of GenAI

    Inference parameters: diversity and length

    Parameter Effect
    Temperature A lower temperature leads to more deterministic responses; a higher temperature flattens the distribution and leads to more random, diverse output.
    Top K Number of most-likely candidates considered for the next token (lower = more focused).
    Response length Minimum or maximum number of tokens to return.

    Temperature and response length

    • Creative and brief: raise temperature, lower response length.
    • "Outputs less diverse" for an LLM: change temperature. Batch size, learning rate and optimizer type are training settings, not inference settings.
    • Because tokens are sampled, the same prompt can give different answers: this is nondeterminism, not a bug or a security flaw.

    Prompt engineering techniques

    Technique Signature
    Zero-shot Instruction only, no examples (e.g. "Classify the following text as sports, politics or entertainment").
    Few-shot Examples included in the prompt; for intent detection the examples are user message → correct intent pairs.
    Chain-of-thought "Think step by step"; the model reasons through intermediate steps before the final answer.
    Persona and tone Role/tone context shapes vocabulary and style, so answers represent the brand.
    Negative prompt Image models (Amazon Nova Canvas): negativeText excludes objects or styles. Inpainting/outpainting/mask prompts edit regions, they do not exclude traits.
    Prompt caching Cache checkpoints reuse a static prompt prefix (e.g. a system prompt) to cut latency and input-token cost, without changing the model.

    Training stages and customization

    Customization choices

    Term Meaning
    Pre-training Building a foundation model from scratch (random weights, language-modeling objective, huge web corpus).
    Continued pre-training Extends pre-training with additional unlabeled domain text (legal, medical...).
    Supervised fine-tuning Needs labeled input-output examples for specific tasks.
    RAG Not a fine-tuning method: retrieves context at inference time.

    Embeddings, hallucination and grounding

    • Embeddings: vector representations of text that capture meaning; used for semantic similarity, clustering and retrieval. (Storing vectors is the vector store's job; lower-precision weights is quantization.)
    • Hallucination: plausible-sounding but incorrect or unrelated output. Not overfitting, not data leakage.
    • Mitigation: contextual grounding checks in Bedrock Guardrails filter responses not grounded in a reference source. Knowledge Bases evaluation metric Faithfulness measures how well responses avoid hallucination with respect to retrieved texts.
    • Multimodal: image input → text output requires a multimodal model.
    • Typical GenAI use: summarizing text. Classification, segmentation and forecasting are classic ML.

    Exam traps

    • "Same input, different outputs": nondeterminism (sampling), not guardrails.
    • "Plausible but wrong": hallucination; if both varying output and false info appear, pick nondeterminism + hallucination.
    • Unlabeled data: continued pre-training; labeled pairs → fine-tuning / few-shot examples.
    • "Prevent hallucination": contextual grounding (not "relevance grounding").
    • Caching a system prompt: prompt caching, not fine-tuning, guardrails or knowledge bases.

    Docs

    The rest of this chapter is part of the AIF-C01 premium course

    Unlock every chapter, all 555 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