All posts
15 min read

RAG vs. Fine-Tuning vs. Continued Pre-Training: The AIF-C01's Hardest Three-Way Choice

Three ways to customize a foundation model for your use case — and the AWS AI Practitioner exam tests whether you know which one fits when. Here's the complete guide to getting every RAG, fine-tuning, and continued pre-training question right.

Here is the scenario you will see on the AIF-C01:

A pharmaceutical company stores thousands of internal drug interaction research papers in an S3 bucket. They want a chatbot that answers employee questions using only this internal knowledge base. The model should cite sources, and the knowledge base is updated weekly. What is the most appropriate approach?

Four options appear. One says fine-tune a Bedrock foundation model on the research papers. One says use Continued Pre-Training with the document corpus. One says implement RAG using Amazon Bedrock Knowledge Bases. One says use prompt engineering to include excerpts in the system prompt.

The answer is RAG — but if you can't explain why fine-tuning is wrong for this scenario, or what continued pre-training even does differently, you're guessing. And on the AIF-C01, this type of three-way question appears in several forms across Domain 2 (Generative AI and Foundation Models) and Domain 3 (Applications of Foundation Models).

This post gives you the conceptual clarity to nail every variant. No implementation depth needed — the AIF-C01 is a Foundational exam that tests when to use each approach, not how to build it.


Why This Trips People Up

The confusion starts with a misleading mental model: "more training = better model." Under that assumption, continued pre-training sounds like the premium option, fine-tuning sounds like the mid-tier, and RAG sounds like the quick-and-dirty hack. The exam is designed to punish exactly that reasoning.

The truth is that these three techniques solve fundamentally different problems, and matching the right technique to the right problem is the entire test. None of them is universally superior. The question is always: what constraint is the business actually trying to overcome?

  • Knowledge gap? The model doesn't know about your specific domain or internal data.
  • Behavior gap? The model knows the domain but responds in the wrong style, format, or tone.
  • Factual drift gap? The model's knowledge is outdated and needs to stay current.

Each technique closes a different gap. Let's go through them one by one.


Retrieval-Augmented Generation (RAG): Real-Time Knowledge, No Re-Training

RAG does not change the model at all. It adds a retrieval step before inference: when a user asks a question, the system fetches relevant documents from an external knowledge base and injects them into the prompt as context. The model then answers using both its pre-trained knowledge and the retrieved content.

What it solves: The knowledge gap — specifically when that knowledge is dynamic, needs to stay fresh, must be attributable to sources, or is stored in documents you don't want to bake permanently into a model.

On AWS: Amazon Bedrock Knowledge Bases implements RAG out of the box. You store your documents in S3, let Bedrock chunk and embed them, and the Knowledge Base handles retrieval at inference time. Bedrock Agents can also use Knowledge Bases to answer questions mid-workflow.

When RAG is the right answer:

  • The knowledge base is updated frequently (weekly, daily, per-deployment)
  • You need to cite sources or show which document the answer came from
  • The data is confidential and should not be baked into a shared model
  • The corpus is large and diverse (unlikely to fit in a prompt directly)
  • You want to isolate model updates from knowledge updates — swap documents without touching the model

When RAG is not the answer:

  • The goal is to teach the model a new communication style, persona, or output format
  • You need the model to perform a new task it doesn't know how to do structurally
  • The knowledge is static and foundational to the domain (medical imaging patterns, legal code structures), making re-retrieval at runtime wasteful

The most important thing to internalize: RAG changes what the model knows at runtime. It does not change the model itself.


Fine-Tuning: Teaching New Behaviors, Not New Facts

Fine-tuning takes an existing foundation model and continues training it on a curated dataset of examples. The examples typically take the form of input-output pairs: here's the question, here's the ideal answer in exactly the style and format we want. The model's weights are updated — but only incrementally, on top of the foundation model's existing weights.

What it solves: The behavior gap. Fine-tuning teaches the model how to respond — its tone, its persona, its output structure, its adherence to a specific format. It can also instill moderate domain knowledge, but that's not its primary strength.

On AWS: Amazon Bedrock supports fine-tuning for several foundation models (including Amazon Titan and select third-party models via Bedrock). You provide a training dataset in JSONL format, stored in S3, and Bedrock handles the training job.

When fine-tuning is the right answer:

  • You need the model to adopt a consistent style, format, or persona (always responding as a structured JSON API, always matching your company's brand voice, always using a specific clinical template)
  • You want to teach the model task-specific reasoning it doesn't do well with prompting alone (e.g., classifying your company's proprietary support ticket categories)
  • Your labeled example dataset is relatively small (hundreds to thousands of examples) and carefully curated
  • The underlying knowledge is stable — you're not trying to keep up with weekly document updates

When fine-tuning is not the answer:

  • The knowledge base changes frequently — you'd need to re-fine-tune constantly, which is expensive
  • You need source attribution — fine-tuning bakes answers into weights; there's no paper trail
  • You're trying to get the model to know about domain fundamentals it has never encountered — that requires more training data than fine-tuning typically uses

The mental model: Fine-tuning shows the model how to talk. It doesn't fundamentally expand what it knows at a deep level.


Continued Pre-Training: Building Deep Domain Expertise from Scratch

Continued pre-training (sometimes called domain-adaptive pre-training) takes a foundation model and trains it further on a large, unlabeled corpus of domain text — the same self-supervised learning approach used to train the original model, just on your specialized data. No labels, no input-output pairs. Just raw text the model learns to predict and internalize.

What it solves: Deep domain knowledge gaps where the model has essentially no grounding in the field. Medical research literature, legal codes, scientific papers, a highly specialized technical domain with its own vocabulary, concepts, and reasoning patterns that differ fundamentally from the web text the foundation model was trained on.

On AWS: Amazon Bedrock supports continued pre-training for Amazon Titan models. You provide large unlabeled text corpora in S3.

When continued pre-training is the right answer:

  • The domain is highly specialized with its own vocabulary, acronyms, and concept relationships the base model barely understands (e.g., genomics, maritime law, semiconductor process engineering)
  • You have a very large unlabeled text corpus available — we're talking millions of documents, not thousands
  • The downstream tasks will be diverse and unpredictable — you're building a general-purpose expert in the domain, not optimizing for one specific task
  • You expect to then fine-tune on top of the continued pre-training result to add specific behaviors

When continued pre-training is not the answer:

  • Your knowledge base is updated frequently — continued pre-training takes substantial time and compute; it's not a "refresh weekly" solution
  • You already have a well-curated set of labeled examples — that's fine-tuning territory
  • The model already handles the domain reasonably well and you just need to steer its outputs — that's fine-tuning or prompt engineering

The mental model: Continued pre-training expands what the model fundamentally knows and understands. It's like sending someone back to school, not handing them a manual.


The Comparison Table

DimensionRAGFine-TuningContinued Pre-Training
What changesNothing in the model; context at inference timeModel weights, incrementallyModel weights, substantially
Training data neededNone (just a knowledge base)Hundreds–thousands of labeled examplesMillions of unlabeled documents
Compute costLow (inference only + retrieval)MediumHigh
Time to deployFast (index documents, done)Hours to daysDays to weeks
Knowledge freshnessReal-time (update the knowledge base)Stale until you re-trainVery stale; not suitable for updates
Source attributionYes (retrieval returns source docs)NoNo
Best forDynamic, citable internal knowledgeOutput style, format, persona, task behaviorDeep domain expertise in a specialized field
AWS serviceBedrock Knowledge BasesBedrock Fine-TuningBedrock Continued Pre-Training (Titan)
Primary gap solvedFactual currency + proprietary data accessBehavioral alignmentDomain conceptual grounding

Three Exam Scenario Walkthroughs

Scenario 1: The Legal Research Assistant

A law firm wants a chatbot that can answer questions about case law from their private case management system, which contains 50,000 client-matter documents updated daily. Associates should be able to see which specific documents were used to answer each question. Which approach should the company use?

The right answer is RAG. Two signals lock this in: the knowledge base is updated daily, and the firm needs source attribution (which document was used). Fine-tuning cannot satisfy either requirement. Continued pre-training is even further off — the firm's case management documents aren't a static domain corpus; they're live, client-specific records.

Why the distractors fail:

  • Fine-tuning on the case documents: Bakes knowledge into weights, loses source traceability, requires re-training every day as new matters are added. Expensive and architecturally wrong.
  • Continued pre-training: Even less suited — designed for massive static corpora, not daily-updated operational records.
  • Prompt engineering with excerpts: Can work at small scale, but 50,000 documents exceed any prompt window. Not a scalable production approach.

Scenario 2: The Customer Support Classifier

A SaaS company's support team receives 10,000 tickets per month. They want an AI model to automatically classify tickets into 15 proprietary categories that are specific to their product (e.g., "Billing — Duplicate Charge", "Feature Request — API Rate Limits"). The category definitions are stable. They have 8,000 historical tickets with correct labels. Which approach is most appropriate?

The right answer is fine-tuning. The task is behavioral: take a support ticket, output a structured category label. The 15 categories are proprietary and specific — no foundation model knows them out of the box. The company has thousands of labeled examples. The categories are stable (no frequent updates).

Why the distractors fail:

  • RAG: RAG is for retrieving and citing information, not for instilling consistent classification behavior. You could try to retrieve similar tickets, but that's fragile for a tight 15-class classifier.
  • Continued pre-training on support tickets: The model doesn't need to understand support ticket language more deeply; it needs to output a specific label from examples. That's a fine-tuning task, not pre-training.
  • Prompt engineering: Can work for general classification with broad categories, but proprietary 15-class schemes with subtle distinctions between categories benefit significantly from fine-tuning on labeled data.

Scenario 3: The Genomics Research Tool

A biotech company wants to build an AI assistant for researchers working on CRISPR gene-editing applications. The base foundation model struggles to understand the technical literature — it confuses gene terminology, misuses domain acronyms, and can't reason about sequence analysis concepts. The company has access to 10 million unlabeled research papers from PubMed and internal archives. Which approach should they start with?

The right answer is continued pre-training. The model has a fundamental comprehension gap in a highly specialized domain. 10 million unlabeled papers is exactly the kind of large, static, domain-dense corpus continued pre-training is designed for. Fine-tuning won't fix a model that doesn't understand the vocabulary — you can't label your way out of conceptual illiteracy.

Why the distractors fail:

  • RAG: Retrieval can surface papers, but if the model can't reason about the content it retrieves — can't correctly interpret gene notation, can't follow the logic of a sequence analysis — retrieved context is only marginally useful. RAG adds knowledge but doesn't build understanding.
  • Fine-tuning on labeled Q&A pairs: Before fine-tuning makes sense, the model needs to understand the domain well enough that labeled examples can steer it. Fine-tuning on a shallow base would require enormous volumes of labeled data to compensate. Continued pre-training first, then fine-tune.
  • Prompt engineering: A prompt can carry some domain context but can't overcome the model's fundamental unfamiliarity with genomics concepts.

The Mental Model That Makes This Stick

Think of a new employee joining your company:

RAG is like giving them a company wiki they can look things up in during a conversation. They don't memorize the wiki — they check it when needed. If the wiki is updated, they immediately use the new version. They can tell you exactly which page they referenced. This is fast to set up and keeps information fresh.

Fine-tuning is like sending them through a company onboarding program. They practice specific tasks, learn your company's communication style, and internalize how to handle your particular processes. They're not memorizing facts — they're developing behavioral habits. The onboarding ends; after that, you'd need to run another onboarding if procedures change significantly.

Continued pre-training is like sending them to graduate school in the domain. They spend months immersed in the deep literature and emerge with genuine expertise and vocabulary. This is expensive and slow, but now they can handle any task in that domain, not just the ones you specifically trained them for. You'd then follow up with onboarding (fine-tuning) to apply their expertise to your specific workflows.

This maps directly to exam scenarios: when you see a scenario about current, citable information, think RAG. When you see style or task behavior, think fine-tuning. When you see deep domain illiteracy in a specialized field with massive static text, think continued pre-training.


Common Traps the AIF-C01 Uses

Trap 1: "Large document corpus" as a fine-tuning signal. The exam sometimes describes a large set of documents and expects you to recognize that unlabeled corpora → continued pre-training, while labeled input-output pairs → fine-tuning. A "corpus of 5 million medical research papers" isn't fine-tuning data unless it comes with labels.

Trap 2: Treating RAG and fine-tuning as equivalent for "teaching the model about our products." If the scenario says "our product catalog changes frequently" or "employees need to query the latest documentation," that's RAG. If it says "the model should always respond in our brand voice" or "output exactly this JSON schema," that's fine-tuning. The exam will use both framings around "teaching about our products."

Trap 3: Continued pre-training as the answer for niche-but-stable knowledge. If the domain is specialized but the model already handles it acceptably and what you really need is format alignment, continued pre-training is overkill. Only reach for it when the model genuinely can't function in the domain — doesn't understand the vocabulary or concepts at all.

Trap 4: Assuming fine-tuning provides source attribution. Fine-tuning bakes knowledge into weights. There is no way to trace which training example produced a given response. If a scenario explicitly requires auditability or source citation, that requirement alone rules out both fine-tuning and continued pre-training.

Trap 5: Overlooking update frequency as a decisive factor. Any scenario that mentions frequent updates (daily, weekly, monthly with business-critical recency) is almost always pointing at RAG. Fine-tuning and continued pre-training require re-running an expensive training job for every meaningful update. The exam will mention update frequency for a reason.


Exam-Day Checklist

Read this before your AIF-C01 and before every practice session until it's automatic:

  • Update frequency? If knowledge changes frequently, lean toward RAG.
  • Source attribution required? Only RAG can cite documents. Eliminate fine-tuning and continued pre-training.
  • Behavioral alignment (style, format, persona)? Fine-tuning is the answer, not RAG.
  • Proprietary task classification with labeled examples? Fine-tuning.
  • Unlabeled corpus, massive, domain-foundational? Continued pre-training — especially if the model can't understand domain terminology.
  • Fine-tuning vs. continued pre-training? Check for labels. Labels → fine-tuning. No labels, large static corpus, deep conceptual gap → continued pre-training.
  • Is cost a factor? RAG is cheapest to set up. Continued pre-training is most expensive. Fine-tuning is in between.
  • Does the model need to change at all? If the answer is "give it better runtime context," that's RAG — no model change required.

What's Next

The RAG vs. fine-tuning vs. continued pre-training decision sits inside a broader question the AIF-C01 loves: choosing the right AWS AI service for the job. That same reasoning discipline — match the tool to the constraint, not to the surface-level description — applies when choosing between Amazon Comprehend, Rekognition, Textract, and Transcribe, or when picking foundation model parameters like temperature and top-p to control output behavior.

Take the free AIF-C01 diagnostic to see where you stand across all four exam domains. It takes 10 minutes and will immediately show you whether RAG/fine-tuning questions are a gap or a strength.

When you're ready to go deeper, the Sprint Pass gives you adaptive mocks, detailed answer explanations, and the AI tutor for every question — so when you see a new variant of this scenario, you can talk through it. One pass covers all three CertCoach certifications (AIF-C01, SAA-C03, and DVA-C02). Use code LAUNCH50 for 50% off.