Amazon AIF-C01: Generative AI Concepts — Study Guide

Part of the AWS AI Practitioner AIF-C01 — Study Guide. Practice with verified answers in the Amazon exam hub, or take timed practice tests on ExamRoll.io.

Foundation models, tokens, embeddings, and multimodal fundamentals

Foundation models are large pre-trained neural networks that provide powerful, general-purpose capabilities across text, images, and other modalities; examples available through AWS include Amazon Bedrock’s access to Titan and other vendor models, and SageMaker environments for training and hosting custom models. Tokens are the atomic pieces—subwords or characters—that LLMs use for input and output; tokenization determines context window usage, cost, and truncation risk. Embeddings are dense numeric vectors that encode semantic meaning and are the glue for similarity search, clustering, and downstream retrieval; embeddings can be generated by Bedrock models or by models hosted on SageMaker. Multimodal models accept and link text, images, and audio; typical AWS building blocks include Amazon Rekognition for visual feature extraction, Amazon Textract for scanned documents, and Amazon Transcribe for audio-to-text, with Bedrock or SageMaker models used to fuse modalities. Key practitioner tradeoffs include choosing to fine-tune a foundation model (higher cost, longer lead time, better task alignment) versus prompt-engineering and RAG (faster, lower cost, safer for data privacy). Common traps include ignoring token limits during prompt construction, failing to version embeddings or indexes, and underestimating preprocessing needs for image and document inputs.

Prompt engineering, model controls, and reasoning techniques

Prompt engineering structures instructions and context to get reliable outputs; effective prompts separate system instructions (role, guardrails), user content, and optional few-shot examples. Use concise system prompts to define style, constraints, and output format, and store canonical templates to avoid drift. Tuning inference parameters such as temperature, top-p, and max_tokens in Bedrock or SageMaker influences creativity and determinism—lower temperature and narrower top-p yield more consistent answers at the cost of creativity. Reasoning techniques include chain-of-thought (explicit intermediate reasoning to improve multi-step tasks), self-consistency (sample multiple reasoning paths and aggregate), and verification loops (ask the model to check or cite sources). Common traps are prompt injection (untrusted inputs altering system behavior), brittle few-shot examples that overfit style rather than intent, and neglecting to log prompts for auditability. Decision criteria for techniques: use chain-of-thought for complex reasoning when transparency matters, but add verification when outcomes have real-world consequences; prefer deterministic settings for production-facing UIs to ensure repeatability.

Retrieval-Augmented Generation (RAG), vector stores, agents, and architectures

RAG couples a retrieval layer with a generative model: index documents, compute embeddings, perform similarity search to retrieve context, and then condition the LLM on retrieved passages. On AWS, document sources typically live in Amazon S3, extraction uses Textract or custom pipelines, embeddings are generated via Bedrock or SageMaker, and vectors are stored in Amazon OpenSearch Service with k-NN or in specialized vector stores layered on top of DynamoDB or OpenSearch; Amazon Kendra can be used when enterprise semantic search and connectors are required. Agents are LLM-based controllers that decide when to call tools—search, database queries, calculators—and can be implemented by orchestrating model calls with AWS Lambda or Step Functions to execute tools safely. Architecture patterns include synchronous RAG for chatbots and asynchronous batch RAG for summarization jobs (Athena or EMR to preprocess large corpora). Practitioner traps: stale indexes (not refreshing embeddings), over-including long context that exceeds token windows, and failing to include provenance links for retrieved content. Decide between Kendra and OpenSearch based on connectors, security, and need for semantic ranking.

Hallucinations, bias, explainability, monitoring, and governance

Hallucinations occur when models fabricate plausible-sounding but incorrect facts; mitigation strategies focus on grounding responses (RAG), explicit citation of retrieved sources, verification models that fact-check outputs, and human-in-the-loop review for high-risk domains. Bias arises from skewed training data or label distributions; use Amazon SageMaker Clarify to detect dataset bias, examine feature importances, and produce explainability artifacts. For model performance and drift, deploy Amazon SageMaker Model Monitor to detect data and prediction drift, log inference inputs/outputs to CloudWatch and S3 for auditing, and maintain provenance of prompts and retrieval sources. Evaluation should combine technical metrics (precision/recall, F1, mAP for detection, ROUGE for summarization, perplexity where applicable) with human-centered metrics like helpfulness, safety, and latency. Practical governance practices include red-teaming outputs, automated content filters, PII detection and redaction with Amazon Comprehend PII, versioning models and embeddings, and documenting intended use and limitations. Common pitfalls include relying solely on synthetic tests, insufficient logging for compliance, and skipping bias mitigation before deployment in regulated contexts.

Practical Problem: Use-Case Scenario

Scenario: MedData Analytics operates an internal diagnostic assistant using Amazon Bedrock for generation, patient manuals and imaging reports stored in Amazon S3, and a SageMaker training pipeline for model experiments. They must provide transparent, verifiable diagnostic suggestions while minimizing hallucinations and bias for clinicians.

Challenge: Ground model outputs in trusted documents, ensure explainability and bias checks, and create a production RAG pipeline that maintains provenance and human oversight.

Recommended Approach:

  1. Use Amazon Textract to extract structured text from PDFs and Amazon Comprehend PII to redact sensitive fields; store sanitized documents in Amazon S3 and track versions with object tagging.
  2. Generate embeddings with an Amazon Bedrock embedding model (or SageMaker-hosted encoder), index vectors in Amazon OpenSearch Service with k-NN, and store metadata in DynamoDB for provenance links.
  3. Build a RAG orchestration where Lambda (or Step Functions) retrieves top_k passages, assembles a system prompt template, and calls Amazon Bedrock for generation with low temperature and explicit “cite sources” instructions.
  4. Apply SageMaker Clarify on training/label data to detect bias, use SageMaker Model Monitor for drift alerts, log prompts and retrieval IDs to CloudWatch/S3, and route high-risk outputs through Amazon A2I for clinician review.

Rationale: Grounding outputs via RAG and explicit source citation reduces hallucinations; combining Clarify, Model Monitor, and human review provides explainability, bias detection, and safe operational governance consistent with practitioner best practices.


Fundamentals of AI and ML · All domains · AWS AI

Practice these questions → · Timed practice on ExamRoll.io →

Pass the whole exam — not just this question

You found this answer. Get every verified question and explanation in one place, and save hours of prep. Free to start.

Pass your exam →

Browse Amazon →

Related guides

All-in-one access

One subscription. Every exam.

Every plan unlocks unlimited answer search, practice tests, AI explanations, and the full resource library — in 20+ languages.

Monthly
24.87
Just €0.83/day
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

Best value
12 months
179.87
Just €0.49/daySave 40%
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

✓ Free plan included · ✓ Cancel anytime · ✓ All plans unlock the full product