Lesson 1 of 4 Foundation Model Customization Lifecycle

Choosing When and How to Customize a Model

This lesson sets out the customisation options and the decision logic for choosing them only when prompt engineering or RAG cannot meet the goal. Model training itself is out of scope, so the focus is on choosing, deploying and managing customised models.

Learning outcomes

After completing this lesson, you will be able to:

  • Order approaches on the customisation ladder.
  • Identify the customisation jobs Amazon Bedrock supports.
  • Decide when SageMaker AI customisation is needed.
  • Decide whether fine-tuning is needed for a requirement.

The customisation ladder

Approaches form a ladder of increasing effort. Prompt engineering changes instructions and examples and costs nothing to deploy. RAG adds knowledge at request time without changing the model. Fine-tuning (supervised) trains the model on labelled prompt and response pairs to change behaviour, style, format or task performance. Distillation uses a large teacher model's responses to train a smaller student model that is faster and cheaper on a specific task. Continued pre-training exposes a model to large amounts of unlabelled domain text to learn vocabulary and concepts. Reinforcement fine-tuning uses feedback or reward functions instead of fixed answers.

Higher rungs need training data, training cost, evaluation, hosting (customised models often need dedicated capacity) and retraining when the base model is retired. They also freeze knowledge at training time. The following table summarises when each approach fits.

ApproachChangesChoose when
Prompt engineeringInstructions and examplesBehaviour can be described in the prompt
RAGKnowledge supplied per requestPrivate, large or changing knowledge; citations
Fine-tuningModel weights (or adapters)Consistent style, format or task skill prompts cannot achieve
DistillationSmaller student modelLarge-model quality needed at lower cost and latency
Continued pre-trainingDomain knowledge in weightsSpecialized vocabulary the model does not understand

The following diagram shows the approaches as rungs of increasing effort.

The customisation ladder. Prompt engineering and RAG change nothing in the model. Supervised fine-tuning, distillation, continued pre-training and reinforcement fine-tuning each change the model, and need training data, training cost, evaluation and hosting, and retraining when the base model is retired.
Start at the lowest rung that meets the requirement.
Sort into groups

Which rung of the ladder?

Exam skills 1.2.4

Choose the lightest approach that meets each requirement.

Log in to try this activity Interactive activities are free with an account.

Customization on Amazon Bedrock

Amazon Bedrock supports model customisation jobs for selected models: fine-tuning, distillation, reinforcement fine-tuning and, for some models, continued pre-training. Training data is supplied as JSON Lines (JSONL) files in S3, the job runs in AWS-managed infrastructure, and the resulting custom model is private to the account and can be encrypted with a customer managed AWS KMS key. Depending on the model, a custom model is served with Provisioned Throughput or through an on-demand custom model deployment.

Custom Model Import brings models fine-tuned elsewhere, such as on SageMaker AI, into Bedrock if they use a supported open-weight architecture. Imported models are invoked through the Bedrock Runtime API like other models, scale automatically (including to zero) and are billed for the active model copies in five-minute windows.

The following diagram maps each requirement of a policy assistant to the approach that serves it, which shows whether fine-tuning is needed.

Deciding whether fine-tuning is needed for a policy assistant. Monthly changes across 5,000 policies and the need for citations point to RAG; the formal style is achieved with a system prompt and examples. Fine-tuning is justified only if evaluation shows prompting cannot achieve the style, and then it complements RAG.
Fine-tuning complements RAG here; it cannot replace it.
Scenario questions

Bedrock or SageMaker AI customisation?

Exam skills 1.2.4 · 2.2.1

Decide where each customisation should be done.

Log in to try this activity Interactive activities are free with an account.

Customization on SageMaker AI

Amazon SageMaker AI gives full control over customisation, at the cost of more operational work than Bedrock's managed fine-tuning. SageMaker JumpStart offers ready-made fine-tuning for many open-weight models, started from the console or a few lines of the SageMaker Python SDK. Training jobs can run any framework and method, including full fine-tuning and parameter-efficient methods such as LoRA and QLoRA, on instance types the team chooses, and SageMaker HyperPod supports large, long-running training clusters.

The customised model is then deployed to a SageMaker AI endpoint, or, for supported architectures, imported into Bedrock with Custom Model Import so that applications can call it through the Bedrock APIs. SageMaker AI is the right choice when the model to customise is not supported by Bedrock customisation, when the method required is not offered by Bedrock, or when the organisation needs control of every training and serving setting, such as the training data pipeline, hyperparameters or inference container.

Worked example

Is fine-tuning needed?

A company wants its assistant to answer questions from 5,000 internal policies that change monthly, in the company's formal style, with citations. A team proposes fine-tuning.

Changing monthly content and citations point to RAG, because a fine-tuned model would need retraining every month and cannot cite sources. The formal style can usually be achieved with a system prompt and examples. Fine-tuning would be justified only if evaluation showed that prompting cannot achieve the style consistently, and even then it would complement RAG rather than replace it.

Check yourself

Which approach gives large-model quality on a narrow task at the cost of a small model?

Show answer

Model distillation, which trains a smaller student model on the outputs of a larger teacher model.

Exam Tips

Remember for the exam

  • Try prompt engineering, then RAG, before customising a model.
  • Fine-tuning changes behaviour and format; it does not keep knowledge current.
  • Distillation gives large-model quality on a narrow task at small-model cost.
  • Custom Model Import serves supported open-weight models fine-tuned elsewhere on Bedrock.