AIF-C01 Domain 3: Applications of Foundation Models

Part 4 of the series

AWS Certified AI Practitioner (AIF-C01)

AWS Certified AI Practitioner Foundational badge

Part 4 of 6 in the AIF-C01 exam prep series for developers. Previous: Domain 2: Fundamentals of GenAI.

Domain 3 is the biggest domain and the most practical one. It covers how you actually build with foundation models: choosing one and tuning its inference parameters, grounding it in your data with RAG, deciding whether and how to customize it, writing and managing prompts, and measuring whether any of it worked.

If you've built an LLM feature, much of this will feel familiar. The exam's twist is cost: for almost every scenario, it wants the cheapest approach that meets the requirement.

Domain at a glance#

Domain 3 is 28% of scored content, about 14 of the 50 scored questions: the largest single domain on the exam.

TaskWhat it covers
3.1Describe design considerations for applications that use foundation models
3.2Choose effective prompt engineering techniques
3.3Describe the training and fine-tuning process for foundation models
3.4Describe methods to evaluate foundation model performance

Objective checklist#

#ObjectiveSection
3.1.1Selection criteria for foundation models, including prompt cachingChoosing a foundation model
3.1.2Effect of inference parameters on responsesInference parameters
3.1.3RAG and its business applications (Bedrock Knowledge Bases)Retrieval Augmented Generation
3.1.4AWS services that store embeddings in vector databasesVector stores on AWS
3.1.5Cost trade-offs of customization approaches, including distillationThe customization ladder
3.1.6The role of AI agents and their business applicationsOne-liner below; full coverage in Post 5
3.2.1Prompt engineering constructs: context, instruction, negative promptsAnatomy of a prompt
3.2.2Techniques: chain-of-thought, zero-shot, single-shot, few-shot, templatesPrompting techniques
3.2.3Benefits and best practicesBest practices
3.2.4Risks: exposure, poisoning, hijacking, jailbreakingPrompt risks
3.2.5Prompt versioning with Bedrock Prompt ManagementBedrock Prompt Management
3.3.1Key elements of training: pre-training, fine-tuning, continued pre-training, distillationHow foundation models are trained
3.3.2Fine-tuning methodsFine-tuning methods
3.3.3Preparing data for fine-tuning, including RLHFPreparing data
3.4.1Evaluation approaches: human-in-the-loop, benchmarks, Bedrock Model EvaluationEvaluation approaches
3.4.2Metrics: ROUGE, BLEU, BERTScore, LLM-as-a-judgeEvaluation metrics
3.4.3Whether a model meets business objectivesDoes it meet the business objective?
3.4.4Evaluating applications built with foundation models: RAG, agents, workflowsEvaluating whole applications
3.4.5Business alignment metricsBusiness alignment metrics

Design considerations#

Choosing a foundation model#

CriterionWhat to consider
CostPrice per input and output token at your volume
ModalityText, image, audio, video; input only, or generation too?
LatencyIs a user waiting? Smaller models respond faster
Multilingual supportWhich languages must it handle well?
Model size and complexityLarger models reason better but cost more and run slower
CustomizationDoes it support fine-tuning or distillation if you need it later?
Input/output lengthIs the context window big enough for your documents? What's the maximum output?
Prompt cachingDoes it support caching for repeated prompt prefixes? That can change the cost math entirely

Beyond the guide's list, check licensing, compliance requirements, and availability in your Region.

Inference parameters#

ParameterWhat it controlsLow valueHigh value
TemperatureRandomness in token selectionFocused, consistent, repeatableVaried, creative, less predictable
Top-pSample only from tokens whose combined probability reaches pConservative word choiceWider vocabulary
Top-kSample only from the k most likely tokensConservativeMore diverse
Maximum tokensUpper limit on output lengthShort answers; lower output costLonger answers allowed
Stop sequencesStrings that end generation when produced

Here's where these parameters live in a real request, using the Bedrock Converse API:

Python
import boto3

bedrock = boto3.client("bedrock-runtime")

response = bedrock.converse(
    modelId="<model-id>",
    messages=[{"role": "user", "content": [{"text": "Summarize our refund policy in 3 bullets."}]}],
    inferenceConfig={
        "temperature": 0.2,      # low: focused and consistent
        "topP": 0.9,             # sample from the top 90% of probability mass
        "maxTokens": 300,        # caps output length, and output cost
        "stopSequences": ["###"],
    },
)
print(response["output"]["message"]["content"][0]["text"])

Illustrative only; the exam never asks you to read code. Top-k is model-specific, so Converse passes it separately rather than in inferenceConfig.

Retrieval Augmented Generation#

Retrieval Augmented Generation (RAG) retrieves relevant content from your own data at query time and adds it to the prompt, so the model answers from facts it was never trained on. It's the default answer whenever a scenario needs current, proprietary, or citable information. Its advantages:

  • No retraining is needed.
  • Updating the answer is as simple as updating the documents.
  • Responses can cite their sources.
Rendering diagram...

Figure: The RAG flow at query time. Retrieval happens before generation, which makes it a likely ordering question.

Amazon Bedrock Knowledge Bases is AWS's managed RAG capability, and it now comes in two types:

  • Managed Knowledge Base (generally available since June 17, 2026). AWS runs storage, indexing, and retrieval. Native connectors cover Amazon S3, SharePoint, Confluence, Google Drive, OneDrive, and a web crawler. It adds hybrid search, reranking, and agentic multi-hop retrieval.
  • Custom knowledge base. You bring and manage your own vector store (see below) and control the pipeline.

Applications call it in one of two ways:

  • Retrieve: returns the relevant chunks, and you build the prompt yourself.
  • RetrieveAndGenerate: retrieves, builds the prompt, calls the model, and returns an answer with citations.

Typical business applications:

  • Customer support assistants that answer from product documentation.
  • Internal knowledge assistants over HR, IT, and policy documents.
  • Legal and compliance Q&A with citations.
  • Sales enablement over product and pricing material.

Vector stores on AWS#

ServiceWhy you'd choose it
Amazon OpenSearch Service (including Serverless)Purpose-built search engine with vector (k-NN) search and hybrid keyword-plus-semantic search. The default answer for vector search at scale
Amazon Aurora PostgreSQL-CompatibleRelational database with the pgvector extension; keeps vectors next to your relational data
Amazon RDS for PostgreSQLSame pgvector approach on standard RDS
Amazon NeptuneGraph database with vector search (Neptune Analytics); useful when relationships between entities matter (GraphRAG)
Amazon DocumentDBVector search for MongoDB-compatible JSON document workloads

Knowledge Bases also supports Amazon S3 Vectors for low-cost vector storage, and third-party stores such as Pinecone, Redis, and MongoDB Atlas.

The customization ladder#

Every step up this ladder costs more, needs more data, and takes longer. The exam almost always wants the lowest rung that solves the problem.

Rendering diagram...

Figure: Cost, effort, and data requirements rise from left to right. Distillation is a specialized form of fine-tuning whose goal is lower running cost.

ApproachCostData neededChanges model weights?Use when
Prompt engineering / in-context learningLowestA few examples in the promptNoAlways try first
RAGLow to mediumA document collectionNoNeeds current, proprietary, or citable facts
Fine-tuningHighLabeled prompt-response examplesYesNeeds a specific style, format, or task behavior
Model distillationMedium to high up front; lowers ongoing costPrompts, plus outputs from a large "teacher" modelYes (a small "student" model)One narrow, high-volume task where inference cost dominates
Continued pre-trainingHigherLarge unlabeled domain corpusYesThe model doesn't understand the domain's vocabulary at all
Pre-training from scratchHighestMassive corpus and computeBuilds themAlmost never, for a practitioner

In-context learning means giving the model examples or context in the prompt itself, so it "learns" the task without any training. Few-shot prompting is the common case.

Distillation is the only approach on the ladder that reduces ongoing inference cost. A large teacher model generates high-quality outputs, a small student model is trained on them, and you deploy the student for near-teacher quality at a fraction of the price per call.

The role of AI agents#

AI agents (3.1.6) use a foundation model to plan and execute multi-step tasks, calling tools and taking actions rather than only generating text. Business applications include:

  • resolving customer support cases end to end
  • processing claims
  • running IT operations
  • modernizing code

Prompt engineering#

Anatomy of a prompt#

A well-structured prompt has up to four parts, plus optional negative instructions:

PartPurpose
InstructionThe task: what the model should do
ContextBackground, role, or reference material the model needs
Input dataThe specific content to work on
Output indicatorThe format, length, or structure you want back
Negative promptWhat the model should not do or include
Text
You are a support specialist for an online bookstore.        <- context (role)
Answer the customer's question using only the policy below.  <- instruction
Do not promise refunds outside the policy.                   <- negative prompt
Do not mention competitors.

Policy: {{refund_policy}}                                    <- context (reference)
Question: {{customer_question}}                              <- input data

Reply in at most 3 sentences, in a friendly tone.            <- output indicator

The {{placeholders}} make this a prompt template: a reusable structure with variables filled in at runtime.

Prompting techniques#

TechniqueHow it worksBest for
Zero-shotThe instruction alone, with no examplesSimple, common tasks the model already handles well
Single-shot (one-shot)One example of input and desired outputShowing a format
Few-shotSeveral examplesTeaching a pattern, labeling scheme, or style
Chain-of-thoughtAsk the model to reason step by step before answeringMath, logic, multi-step reasoning
Prompt templatesReusable prompt structures with variablesConsistency across many requests and teams

Best practices#

The guide lists these benefits and best practices:

  • Response quality improvement. Better prompts measurably improve output.
  • Experimentation. Iterate and compare variants rather than guessing.
  • Guardrails. Constrain what the model may discuss or reveal.
  • Discovery. Explore what the model can do before committing to an approach.
  • Specificity and concision. Be exact about the task, format, and audience, and cut filler.
  • Using multiple comments. Break complex instructions into several clear statements rather than one long paragraph.

Prompt risks#

RiskWhat happensMitigations
Exposure (prompt leaking)The model reveals its system prompt or sensitive data from its contextKeep secrets out of prompts; Guardrails sensitive-information filters; output filtering
PoisoningMalicious or biased content is planted in training data, RAG sources, or templatesCurate and validate sources; restrict who can change them; version prompts
Hijacking (prompt injection)Input text overrides the original instructions ("ignore previous instructions…")Separate instructions from data; Guardrails prompt-attack filter; least-privilege tools
JailbreakingRole-play or clever framing tricks the model past its safety trainingGuardrails content and prompt-attack filters; monitoring

Bedrock Prompt Management#

Amazon Bedrock Prompt Management, new to the guide as objective 3.2.5, turns prompts from strings buried in code into managed, versioned resources. With it you can:

  • Create prompts with variables, and attach a model and inference configuration.
  • Save immutable versions, and have applications and Bedrock Flows reference a specific version.
  • Compare variants side by side, and test them against different models without redeploying the application.
  • Optimize prompts automatically for a target model.

Training and fine-tuning#

How foundation models are trained#

ElementDataPurpose
Pre-trainingMassive unlabeled data, self-supervisedLearn language and general knowledge; the most expensive step
Fine-tuningSmaller, labeled, task-specific dataAdapt behavior to a task, format, or style
Continued pre-trainingLarge unlabeled domain dataTeach a domain's vocabulary and knowledge (legal, medical, financial). The exam guide calls this continuous pre-training; same thing
DistillationOutputs from a teacher modelTransfer a large model's skill on a task into a smaller, cheaper model

Fine-tuning methods#

MethodWhat it is
Instruction tuningTrain on instruction-and-response pairs so the model follows instructions better
Domain adaptationSpecialize a model for a particular field
Transfer learningReuse a pre-trained model's knowledge as the starting point for a new task. Fine-tuning is a form of transfer learning
Continued pre-trainingKeep pre-training on unlabeled domain text

On Bedrock, fine-tuning uses labeled prompt-and-completion examples stored in S3, and continued pre-training uses unlabeled text. The resulting custom model is private to your account. Serving it can require dedicated capacity, which adds ongoing cost to the one-time training cost.

Preparing data for fine-tuning#

ConsiderationWhy it matters
Data curationRemove errors, duplicates, and low-quality examples. Quality beats quantity
GovernanceTrack where data came from, who can access it, and whether you're allowed to use it
SizeEnough examples to learn the pattern; more isn't always better
LabelingAccurate, consistent labels; bad labels teach bad behavior
RepresentativenessData must reflect the real inputs and users the model will see, or it will be biased
RLHFHumans rank model outputs, a reward model learns their preferences, and the model is tuned toward preferred responses

Evaluating foundation model performance#

Evaluation approaches#

Amazon Bedrock Model Evaluation supports three modes:

ApproachHow it worksCostBest for
Automatic (programmatic)Algorithmic metrics against reference answers, on built-in or custom datasetsLowestTasks with clear reference answers
LLM-as-a-judgeA judge model scores outputs against criteria such as correctness, completeness, and harmfulness, with explanationsMediumOpen-ended quality at scale
Human-in-the-loopYour team or an AWS-managed workforce rates outputsHighestNuance, subjective quality, high-stakes sign-off

Benchmark datasets are standardized test sets for comparing models on the same tasks. Use public benchmarks for general capability and your own curated datasets for your use case.

Evaluation metrics#

MetricMeasuresTypical task
ROUGEOverlap of words and phrases with a reference, recall-orientedSummarization
BLEUOverlap with reference translations, precision-oriented, with a penalty for short outputsMachine translation
BERTScoreSemantic similarity using embeddings, so paraphrases still score wellAny generation where meaning matters more than exact wording
PerplexityHow "surprised" a model is by text; lower is betterLanguage model quality
LLM-as-a-judgeA model grades outputs against a rubricOpen-ended generation at scale

The recall-versus-precision distinction between ROUGE and BLEU is easiest to see in their core ratios:

ROUGE-N=n-grams shared with the referencen-grams in the referenceBLEU precision=n-grams shared with the referencen-grams in the generated output\text{ROUGE-N} = \frac{\text{n-grams shared with the reference}}{\text{n-grams in the reference}} \qquad \text{BLEU precision} = \frac{\text{n-grams shared with the reference}}{\text{n-grams in the generated output}}

ROUGE asks how much of the reference you covered, which suits summaries. BLEU asks how much of your output was correct, which suits translations.

Does it meet the business objective?#

A model can score well and still fail the business. Objective 3.4.3 names productivity (time saved per task), user engagement (do people use it and come back?), and task engineering (does it reliably complete the defined task?).

Evaluating whole applications#

A good model inside a bad pipeline still gives bad answers. So objective 3.4.4 asks you to evaluate the application, not just the model.

RAG applications fail in one of two places:

StageMetricsIf it's bad
RetrievalContext relevance, context coverageFix chunking, embeddings, or reranking
GenerationCorrectness, completeness, faithfulness (is the answer supported by the retrieved context?), citation precision and coverageFix the prompt or the model; add grounding checks

Bedrock Evaluations can evaluate Knowledge Bases directly, either retrieval only or retrieve-and-generate.

Workflows are evaluated step by step and end to end: did each step produce valid output, and did the whole flow reach the right result?

Agents are evaluated on their trajectory: did they pick the right tools, in the right order, and finish the task? Post 5 covers this.

To evaluate…Use
A model's responsesBedrock Model Evaluation
A RAG applicationBedrock Knowledge Base (RAG) evaluation
An agent's tool use and task completionAgentCore Evaluations (Post 5)

Business alignment metrics#

Objective 3.4.5 is new, and it names three metrics:

MetricWhat it tells you
Task completion rateShare of interactions where the user's goal was achieved
User satisfactionHow users rate the experience (surveys, thumbs up/down, CSAT)
Cost per interactionTotal cost (tokens, infrastructure, human escalation) divided by interactions

The exam distinguishes three tiers of metrics, and the right tier depends on who's asking:

TierExamplesAnswers the question
ModelAccuracy, F1, ROUGE, BLEU, BERTScoreIs the model good?
ApplicationTask completion rate, latency, cost per interaction, deflection rateDoes the system work?
BusinessROI, conversion rate, ARPU, customer lifetime valueIs it worth it?

Service cheat sheet#

Service or featureOne line
Bedrock Knowledge BasesManaged RAG: ingest, embed, store, retrieve, and generate with citations
Bedrock Managed Knowledge BaseKnowledge Base type where AWS runs storage and retrieval, with native connectors
Bedrock Prompt ManagementVersioned, reusable prompts with variables and model configuration
Bedrock FlowsDeterministic workflows linking prompts, knowledge bases, and functions
Bedrock Model EvaluationAutomatic, LLM-as-a-judge, and human evaluation of models and RAG
Bedrock model customizationFine-tuning, continued pre-training, and distillation
Bedrock GuardrailsFilters for harmful content, PII, denied topics, prompt attacks, and ungrounded answers
OpenSearch ServiceDefault vector and hybrid search store
Aurora / RDS for PostgreSQLRelational databases with pgvector
NeptuneGraph database with vector search

Commonly confused#

If the scenario says…AnswerNot…Because
Answers must reflect documents updated dailyRAGFine-tuningFine-tuning freezes knowledge at training time
Responses must always follow our brand voice and formatFine-tuningRAGRAG adds facts, not behavior
Model doesn't understand clinical terminology; we have lots of unlabeled notesContinued pre-trainingFine-tuningUnlabeled domain text, vocabulary gap
One high-volume task, inference bill too high, quality must holdDistillationSmaller base modelThe student learns the task from the teacher
Model gives inconsistent answersLower temperatureHigher top-kLess randomness means more consistency
Track and roll back prompt changesPrompt ManagementPrompt templates aloneTemplates are structure; Prompt Management adds versioning
Fixed, predictable sequence of prompt stepsBedrock FlowsAgentsDeterministic, not model-directed
Evaluate summaries against referencesROUGEBLEUROUGE is recall-oriented, for summarization
Evaluate translations against referencesBLEUROUGEBLEU is precision-oriented, for translation
Wording differs but meaning matchesBERTScoreBLEUEmbedding-based similarity handles paraphrases
RAG answers include facts that aren't in the retrieved contextFaithfulness is low (generation problem)Context relevanceRetrieval was fine; the model added things

Practice questions#

Q1. A support team wants an assistant that answers questions from 5,000 internal PDF documents, which change weekly. Answers must cite the source document, and cost should be kept low. What should they use?

  • A. Fine-tune a foundation model on the PDFs every week
  • B. Amazon Bedrock Knowledge Bases
  • C. Continued pre-training on the PDFs
  • D. Amazon Bedrock Guardrails
Show answer

Answer: B. RAG grounds responses in the documents, returns citations, and updating the documents updates the answers, with no training.

  • A and C bake knowledge into model weights. That's expensive, stale within a week, and gives no citations.
  • D filters inputs and outputs; it doesn't retrieve anything.

Q2 (ordering). Order these customization approaches from lowest to highest cost and effort.

  • A. Fine-tuning
  • B. Pre-training from scratch
  • C. Prompt engineering
  • D. Continued pre-training
  • E. Retrieval Augmented Generation
Show answer

C → E → A → D → B.

Prompting needs no infrastructure. RAG adds retrieval but no training. Fine-tuning trains on labeled data. Continued pre-training needs large domain corpora. Pre-training from scratch needs massive data and compute.

Q3. A financial services company uses a foundation model to answer questions about account policies. Answers should be consistent and factual, with minimal creative variation. Which inference parameter change helps most?

  • A. Increase temperature
  • B. Decrease temperature
  • C. Increase maximum tokens
  • D. Remove stop sequences
Show answer

Answer: B. Lower temperature makes token selection more deterministic.

  • A increases randomness.
  • C only allows longer outputs.
  • D affects where generation stops, not consistency.

Q4 (matching). Match each metric to the task it's best suited to evaluate.

Metric
1. ROUGE
2. BLEU
3. BERTScore
4. LLM-as-a-judge

Tasks:

  • A. Machine translation against reference translations
  • B. Open-ended responses scored against a quality rubric at scale
  • C. Summaries compared to reference summaries
  • D. Generated text where paraphrased meaning should count as correct
Show answer

1 → C, 2 → A, 3 → D, 4 → B.

Q5. Several teams edit the prompt used by a production GenAI application. After a recent change, answer quality dropped, and no one can identify what changed or restore the previous prompt. What should the company adopt?

  • A. Amazon Bedrock Prompt Management with prompt versions
  • B. Fine-tuning to remove the dependency on prompts
  • C. A larger foundation model
  • D. Amazon Bedrock Guardrails
Show answer

Answer: A. Versioned, managed prompts let teams compare changes, test variants, and roll back to a known-good version.

  • B and C don't address the governance problem.
  • D filters content but doesn't track prompt changes.

Q6. A healthcare company's model struggles with clinical terminology. The company has millions of unlabeled clinical notes and few labeled examples. Which approach fits?

  • A. Few-shot prompting
  • B. Instruction fine-tuning
  • C. Continued pre-training
  • D. Model distillation
Show answer

Answer: C. Continued pre-training uses large amounts of unlabeled domain text to teach vocabulary and domain knowledge.

  • A can't close a vocabulary gap this large through a few examples.
  • B needs labeled examples.
  • D transfers an existing skill to a smaller model; it doesn't add domain knowledge.

Q7 (multiple response). A team is choosing a vector database for a Bedrock Knowledge Base. Which TWO AWS services from the exam guide's list can store and search embeddings?

  • A. Amazon OpenSearch Service
  • B. Amazon Redshift
  • C. Amazon Aurora PostgreSQL-Compatible Edition
  • D. AWS Lake Formation
  • E. Amazon CloudFront
Show answer

Answer: A and C. OpenSearch provides vector search. Aurora PostgreSQL supports vectors with pgvector.

  • B is a data warehouse.
  • D governs data lakes.
  • E is a CDN.

Q8. A RAG application's evaluation shows high context relevance but low faithfulness: the retrieved passages are on-topic, but answers include claims not found in them. Where is the problem, and what's a good fix?

  • A. Retrieval; change the chunking strategy
  • B. Generation; instruct the model to answer only from the provided context and add a contextual grounding check
  • C. Retrieval; switch vector databases
  • D. Neither; fine-tune the model on the documents
Show answer

Answer: B. Good context relevance means retrieval worked. Low faithfulness means the model added unsupported claims during generation. Tighten the prompt and add grounding checks, such as the Bedrock Guardrails contextual grounding check.

  • A and C fix a retrieval problem that doesn't exist.
  • D doesn't reliably stop the model from inventing claims.

Q9. A company runs a single high-volume classification task on a large foundation model. Quality is excellent, but inference cost is too high. They want to keep quality close to current levels. Which approach fits best?

  • A. Continued pre-training
  • B. Model distillation
  • C. RAG
  • D. Increase temperature
Show answer

Answer: B. Distillation trains a smaller student model on the large model's outputs for this specific task, keeping near-teacher quality at much lower cost per call.

  • A adds domain knowledge; it doesn't reduce cost.
  • C adds retrieval cost.
  • D changes randomness, not cost.

Key takeaways#

  • Pick the smallest model that meets the requirement, and check context window, modality, latency, and prompt caching support.
  • Inference parameters shape content, not speed. Lower temperature means more consistency. Maximum tokens caps length and cost.
  • RAG is the answer for current, proprietary, or citable facts. Bedrock Knowledge Bases is the managed way to do it. Kendra is legacy.
  • Vector stores: OpenSearch by default, Aurora or RDS for PostgreSQL with pgvector, Neptune for graphs.
  • Climb the customization ladder only as far as needed: prompting → RAG → fine-tuning → continued pre-training → pre-training. Distillation cuts inference cost.
  • Prompt structure: instruction, context, input data, output indicator, negative prompts. Hijacking takes over the task; jailbreaking breaks the safety rules.
  • Prompt Management versions prompts; Flows sequences them deterministically.
  • Evaluate at every level:
    • Models: ROUGE, BLEU, BERTScore, LLM-as-a-judge.
    • RAG: relevance for retrieval, faithfulness for generation.
    • Business: task completion rate, user satisfaction, cost per interaction.

Next: Agentic AI on AWS.

Sources#

Share:

Related Articles