↑ ↓ 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.1

    Fundamentals of GenAI (part 1 of 3)

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

    Transformers, tokens and embeddings

    Concept What to remember
    Transformer Uses a self-attention mechanism that weighs the importance of different tokens in the sequence; processes the whole sequence at once (unlike RNNs, which go element by element, and CNNs, which use convolutions).
    Embeddings Numerical vectors representing real-world objects/concepts so models can compare meaning.
    Context window Maximum number of tokens a model can consider in one request; decides how much fits in a prompt.
    Multimodal model Handles several data types (text, images, audio, video).
    Hallucination Fabricated or ungrounded output; mitigated by better prompts, RAG, or another model.

    Inference parameters

    Parameter Effect
    Temperature Low = more deterministic, high = more random.
    Top K / Top P Limit how many (or what share of) candidate tokens are considered; higher = more diversity.
    Response length Minimum or maximum number of tokens to return.

    Default values and ranges depend on the model, and so do token limits: check them before reusing a prompt across models. Determinism is a parameter question, not something you obtain by writing "be deterministic" in the prompt. Real-time apps: evaluate inference speed (latency).

    Prompt engineering

    Technique Idea
    Zero-shot Task without examples.
    Single-/one-shot One example.
    Few-shot Several examples in the prompt (e.g. labeled sentiment samples).
    Chain-of-thought Ask for step-by-step reasoning on complex problems.
    Prompt chaining Several sequential prompts, each subtask feeding the next.
    Negative prompt Image models: say what must not appear (e.g. negativeText in Titan Image Generator).
    System prompt Defines role, instructions and behavioral boundaries.

    Prompt components: task, role (persona), response style (tone/format/structure), success criteria, context and examples. Tone, length and language problems are solved by iterating on the prompt.

    Prompt chaining splits a complex task into sequential prompts

    Prompt engineering is not a security control: prompt injection is an application-level concern, and Bedrock Guardrails (denied topics, prompt-attack detection) provide managed enforcement with the least overhead.

    Customizing a model

    Method Data Use
    Prompt engineering none Cheapest first step.
    Fine-tuning (transfer learning, instruction-based) Labeled input/output (prompt/completion) pairs, JSON Lines (.jsonl) Teach a task, tone or style.
    Continued pre-training Unlabeled domain text Add domain knowledge.
    Pre-training Huge datasets, from scratch Build the base model.

    Ways to adapt a foundation model

    Exam traps

    • "Labeled pairs" means fine-tuning; "unlabeled data" means continued pre-training.
    • Prompt chaining (many prompts) is not chain-of-thought (one prompt, reasoning steps).
    • Temperature 0 for determinism; writing it in the prompt does not work.
    • Hallucination is not nondeterminism or bias.
    • Prompt injection is the classic prompt engineering risk; data poisoning is a training-time risk.
    • Zero-shot has no examples; it is not "retrieval" (that is RAG).

    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