Certablo
← Knowledge Base

Foundation Model Customization & Fine-Tuning

A decision framework for in-context learning, RAG, supervised fine-tuning, continued pretraining, reinforcement-based tuning, and model distillation—what changes model weights and what does not.

AIF-C01AIP-C01MLA-C01

Visual overview

AI / ML STACKChoose the highest-level capability that still gives the control the workload needs
AI SERVICESReady-made capabilityUse a managed API for an established task
GENERATIVE AIFoundation modelsPrompt · retrieve · guard · evaluate
CUSTOM MLModel lifecyclePrepare · train · deploy · monitor
AI architecture is not only model choice: data, evaluation, security, latency, cost, and governance shape the complete production system.
AWS SERVICE MAPCustom-model workflow

Training and validation datasets can reside in S3 while Amazon Bedrock runs supported customization workflows and KMS protects supported artifacts.

Amazon S3Curated training and validation data
Amazon BedrockSupported customization jobs and custom models
AWS KMSSupported encryption control
EXAM-RELEVANT MECHANICS

Technical reference

Customization features and hyperparameter ranges are model-specific. Use the conceptual choices below, then verify supported models, Regions, formats, and current limits.

EpochsPasses over the training set

More passes increase optimization exposure but can increase overfitting; supported ranges depend on the chosen customization job/model.

Batch sizeExamples per optimization batch

Influences gradient estimation, memory use, and optimization dynamics; Bedrock-supported settings vary by model.

Learning rateParameter-update step size

Too large can destabilize training; too small can make learning slow or ineffective. Use model-specific documented ranges.

Validation dataMeasure generalization during customization

Representative held-out data helps detect whether gains on training examples transfer to unseen cases.

DistillationTeacher outputs → student training

Targets a quality/latency/cost balance; validate the student on the actual workload rather than assuming teacher equivalence.

Service limits and capabilities can change. Values shown here reflect the current AWS documentation; use the linked official sources below as the source of truth.

Use the least invasive adaptation that solves the problem

Foundation-model adaptation exists on a spectrum. Prompt engineering and in-context learning change the request but not the model weights. RAG retrieves external facts and adds them to the request context, also without changing weights. Fine-tuning trains a supported base model on task- or domain-specific examples so the resulting custom model behaves differently without requiring a full pretraining run. The best option depends on whether the gap is missing knowledge, undesired behavior/style, domain adaptation, latency, or cost.

RAG is usually attractive when facts are private or change often because updating the source corpus does not require retraining. Fine-tuning is useful when consistent behavior, format, tone, or task performance is difficult to obtain through prompting alone. These approaches are not mutually exclusive: a fine-tuned model can still retrieve fresh documents, and a RAG system still benefits from careful prompts.

Fine-tuning and continued pretraining change model parameters

Supervised fine-tuning uses curated input-output examples to adapt a supported model toward desired responses. Dataset quality matters more than merely accumulating records: examples should be representative, correctly labeled, consistent with policy, and separated from validation evidence. Amazon Bedrock customization jobs use model-specific dataset formats and hyperparameters; supported models, Regions, dataset requirements, and training parameters differ and evolve.

Continued pretraining, when supported, exposes a pretrained model to additional domain material to extend its statistical familiarity with a corpus or vocabulary. Reinforcement-based fine-tuning uses reward signals to optimize desired response behavior instead of relying only on paired supervised targets. These techniques require more governance than prompt edits because training data can alter model behavior broadly and can introduce memorization, bias, regressions, or unexpected capability changes.

Distillation trades capability for a smaller task-focused model

Model distillation trains a smaller student model using outputs or behavior derived from a stronger teacher model. Amazon Bedrock Model Distillation can generate teacher responses and use them to fine-tune a selected student model for the target use case. The objective is typically to retain enough task performance while reducing inference cost or latency. Distillation does not guarantee that a smaller model matches the teacher on every input, so evaluation against representative cases remains essential.

Customization decisions should include the complete economics: training jobs, data preparation, evaluation, custom-model inference, operational lifecycle, and the cost of retraining when requirements change. A prompt or RAG change can often be iterated faster than new weights. Conversely, high-volume repetitive tasks can justify customization if it materially improves response quality or allows a more efficient model to meet the target.

Key takeaways

  1. 01

    Prompting and RAG adapt model behavior at inference time without modifying model weights.

  2. 02

    Supervised fine-tuning uses curated examples to create a custom version of a supported model.

  3. 03

    Continued pretraining targets broader domain adaptation, while reinforcement-based tuning learns from reward signals where supported.

  4. 04

    Distillation uses a stronger teacher to help train a smaller student for a targeted capability/cost tradeoff.

  5. 05

    Always evaluate customized models for regressions, safety, bias, and real business performance before promotion.

Official AWS sources

Use these primary AWS resources for the source material behind this article and for deeper reference.