AIF-C01: prompt engineering, RAG or fine-tuning? How to pick the right customization in exam questions
Applications of Foundation Models is the biggest domain on AIF-C01, with 28% of the scored content. One objective in it shows up again and again in different forms: "Explain the cost tradeoffs of various approaches to FM
Applications of Foundation Models is the biggest domain on AIF-C01, with 28% of the scored content. One objective in it shows up again and again in different forms: "Explain the cost tradeoffs of various approaches to FM customization (for example, pre-training, fine-tuning, in-context learning, RAG, model distillation)."
The question is usually the same: should the company write better prompts, connect the model to its own data, or train it further? Here is a simple ladder for that decision.
The customization ladder
Think of the options as a ladder ordered by cost, effort and time. The exam usually wants the lowest step that solves the problem.
| Step | What changes | Data needed | Cost and effort | Best for |
|---|---|---|---|---|
| 1. Prompt engineering (in-context learning) | Only the prompt | A few examples, at most | Lowest, no training | Format, tone, simple rules, step-by-step reasoning |
| 2. RAG | The prompt is filled with retrieved documents | Your documents, indexed as embeddings | Low to medium, no training | Private, current or frequently changing facts, answers with sources |
| 3. Fine-tuning | Model weights | Labeled prompt-response examples | Medium to high | Consistent style, domain language, a specific task the model does poorly |
| 4. Continued pre-training | Model weights | Large amounts of unlabeled domain text | High | Teaching a model a whole domain's vocabulary |
| 5. Pre-training from scratch | A new model | Huge datasets and compute | Highest | Almost never the answer on AIF-C01 |
Model distillation sits beside steps 3 and 4: a large "teacher" model generates responses that are used to fine-tune a smaller, faster and cheaper "student" model. It is the answer when the scenario says "keep the accuracy of the large model but lower cost and latency".
Step 1: prompt engineering
Prompt engineering changes nothing in the model. You give it context, clear instructions, examples and constraints. The exam guide names the techniques you should recognize:
- Zero-shot: only the instruction.
- Single-shot / few-shot: one or a few examples of input and desired output in the prompt.
- Chain-of-thought: ask the model to reason step by step before answering.
- Prompt templates: reusable prompts with placeholders. In Amazon Bedrock you can store, version and reuse them with Bedrock Prompt Management.
- Negative prompts: say what the output must not contain.
Keywords that point to prompt engineering: "quickly", "without training", "lowest cost", "change the output format", "follow a consistent structure".
Know the risks too: prompt injection and hijacking (input that overrides your instructions), jailbreaking (getting around safety rules), exposure (leaking the system prompt or data) and poisoning. Amazon Bedrock Guardrails is the usual AWS answer for filtering harmful input and output.
Docs: Prompt engineering concepts in Amazon Bedrock.
Step 2: Retrieval Augmented Generation (RAG)
With RAG, the model's weights stay the same. Your documents are split into chunks, turned into embeddings (vectors) and stored in a vector database. At question time, the most relevant chunks are retrieved and added to the prompt, so the model answers from your data.
On AWS the managed option is Amazon Bedrock Knowledge Bases: it connects to your data source (for example Amazon S3), handles chunking and embeddings, stores the vectors and can return answers with citations. The exam guide lists vector stores you should recognize: Amazon OpenSearch Service, Amazon Aurora, Amazon Neptune and Amazon RDS for PostgreSQL (with pgvector).
Keywords that point to RAG:
- "company documents", "internal knowledge base", "product manuals"
- "information changes daily or weekly"
- "answers must be based on our data" or "cite the source"
- "reduce hallucinations about company facts"
The big advantage the exam likes: updating knowledge is a data sync, not a retraining job. If the policy documents change every week, fine-tuning every week is the wrong answer.
Docs: Amazon Bedrock Knowledge Bases.
Step 3 and 4: fine-tuning and continued pre-training
Fine-tuning changes the model's weights by training it further on labeled examples (pairs of prompts and the responses you want). Use it when the problem is behavior, not missing facts: a consistent brand voice, a specialized output style, or a narrow task the base model handles poorly even with good prompts.
Continued pre-training (the exam guide calls it continuous pre-training) uses large amounts of unlabeled text from a domain, such as legal or medical documents, so the model learns that domain's language. It needs more data and compute than fine-tuning.
Amazon Bedrock supports model customization including supervised fine-tuning, reinforcement fine-tuning and distillation; Amazon SageMaker AI is the option when you need full control over training.
Things the exam checks here:
- Fine-tuning needs curated, representative, well-governed training data. Labeling quality and size matter.
- Fine-tuned knowledge is frozen at training time. New facts mean another training run.
- RLHF (reinforcement learning from human feedback) uses human preference ratings to align a model's responses.
Docs: Customize your model in Amazon Bedrock.
The two-question shortcut
When you read a customization scenario, ask:
- Is the problem missing or changing knowledge? Γ’β β RAG.
- Is the problem how the model behaves or writes, and prompts didn't fix it? Γ’β β Fine-tuning.
If neither is clearly true, or the scenario stresses speed and low cost, think prompt engineering first.
Practice questions
Question 1
A company wants an AI assistant that answers employee questions about HR policies. The policies are stored as PDF files in Amazon S3 and are updated several times a month. Answers must reflect the latest version and show which document they came from. Which approach meets these requirements with the LEAST operational effort?
A. Fine-tune a foundation model on the policy documents every time they change.
B. Use Amazon Bedrock Knowledge Bases with the S3 bucket as the data source.
C. Add all policy documents to a single prompt template.
D. Pre-train a new foundation model on the company's documents.
Answer: B. This is a knowledge problem with frequently changing data and a need for sources, which is exactly what RAG solves. Knowledge Bases syncs from S3 and can return citations. A works but means a new training job after every update, and it doesn't give sources. C hits context window limits and sends every document with every request. D is by far the most expensive option.
Question 2
A retailer uses a foundation model to write product descriptions. The facts in the descriptions are correct, but the tone is inconsistent with the brand even after the team tried detailed prompts and few-shot examples. The company has 5,000 approved descriptions written in the brand voice. What should the company do?
A. Build a RAG solution with the 5,000 descriptions.
B. Increase the temperature inference parameter.
C. Fine-tune the model with the approved descriptions as labeled examples.
D. Use chain-of-thought prompting.
Answer: C. The facts are fine; the problem is behavior (tone), prompting has already been tried, and there is a good labeled dataset. That points to fine-tuning. A adds facts, not a consistent style. B makes output more random, not more on-brand. D helps with reasoning tasks, not writing style.
Question 3
A startup wants a chatbot to always answer in a fixed JSON format with three fields. It wants to launch this week and keep costs as low as possible. Which approach should it use first?
A. Prompt engineering with clear instructions and a few-shot example of the JSON output
B. Continued pre-training on JSON documents
C. Model distillation into a smaller model
D. Fine-tuning on a dataset of JSON responses
Answer: A. Output format is a classic prompt engineering task: no training, no dataset, and it can be done in minutes. B and D need training data and time, and distillation (C) is for reducing cost and latency of a model that already does the job. If prompting turned out not to be reliable enough, fine-tuning would be the next step.
Checklist before exam day
- Pick the lowest step on the ladder that solves the problem.
- Missing, private or changing facts Γ’β β RAG (Bedrock Knowledge Bases + a vector store).
- Behavior or style that prompts can't fix Γ’β β fine-tuning with labeled data.
- Domain language from lots of unlabeled text Γ’β β continued pre-training.
- Big model's quality at lower cost Γ’β β distillation.
- Format, tone, quick wins Γ’β β prompt engineering, managed with Bedrock Prompt Management.
Good luck with AIF-C01.
Disclosure: I wrote 6 AIF-C01 practice exams on Udemy (390 scenario questions with an explanation for every option): https://www.udemy.com/course/aws-ai-practitioner-aif-c01-6-practice-exams/?referralCode=696E243DCAADFAE2DCA7. Not affiliated with or endorsed by AWS.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.