Lesson 2 of 2 Adapting Foundation Models to Business Needs

Fine-Tuning and Choosing an Adaptation Approach

Fine-tuning changes how a model behaves rather than what information it can see. This lesson explains fine-tuning and related customisation options, then compares all the adaptation approaches so that the right one can be chosen.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain what fine-tuning changes and its costs and limits.
  • Describe continued pre-training and model distillation.
  • Choose between prompt engineering, RAG and fine-tuning for a requirement.
  • Describe the qualities of a good fine-tuning data set.
  • Correct common misconceptions about what fine-tuning achieves.

What fine-tuning does

Fine-tuning continues the training of a foundation model on a set of examples chosen for a specific purpose, typically hundreds or thousands of pairs of input and ideal output. The result is a customised version of the model that has learned a behaviour: a consistent brand voice, a specialised classification scheme, domain terminology or a particular output structure that prompts alone cannot achieve reliably.

Fine-tuning has costs and limitations. It needs high-quality labelled examples, which take effort to create; training and hosting the custom model cost money; it must be repeated when requirements or the base model change; and it does not give the model up-to-date facts, because knowledge learned in training is fixed. Amazon Bedrock supports fine-tuning of selected models, and Amazon SageMaker AI supports deeper customisation for teams with ML expertise.

What a fine-tuning data set needs

The quality of a fine-tuned model depends on its training examples more than on any other factor. The following points describe a good data set.

  • Representative: the examples cover the full range of inputs the model will receive, including difficult and unusual ones.
  • Correct and consistent: each ideal output has been reviewed, and similar inputs have similar outputs.
  • Quality over quantity: a few hundred carefully reviewed examples often outperform thousands of inconsistent ones.
  • Free of unnecessary sensitive data: personal or confidential details are removed unless they are essential, because a model can reproduce training content.
  • Accompanied by a held-out test set, so that the fine-tuned model can be compared with the base model and with prompting alone.

Misconceptions about fine-tuning

Fine-tuning is often proposed for problems it does not solve. The following list corrects the most frequent misunderstandings.

  • "Fine-tuning teaches the model our documents." It is an unreliable way to add facts: the model may blend or misremember them, cannot cite them and cannot be updated without retraining. RAG is the right tool for knowledge.
  • "Fine-tuning stops hallucination." It can reduce some errors in a narrow task, but a fine-tuned model still generates probabilistically.
  • "Once fine-tuned, the work is done." The custom model must be re-evaluated, and usually fine-tuned again, when the base model is retired or requirements change, and it may carry hosting charges in addition to the cost of training.

Other customisation options

Two related techniques sometimes appear in business discussions. Continued pre-training trains a model on large amounts of unlabelled domain text, such as medical literature, to improve its general understanding of a specialised field. Model distillation uses a large, capable model to teach a smaller one a specific task, so that the smaller model delivers similar quality for that task at lower cost and latency. Both require more effort than prompting or RAG and are justified mainly at high volume or for highly specialised domains.

Match the pairs

Customisation options

Exam skills 1.3.3

Match each customisation option with its purpose.

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

Choosing an adaptation approach

The approaches are not mutually exclusive, and the usual progression is to start with the cheapest and fastest and add complexity only when needed: prompt engineering first, RAG when the model needs company knowledge, and fine-tuning when it needs a behaviour that prompts cannot produce. The following comparison summarises the choice.

Prompt engineering
What it changesThe instructions for each request
Best forTask framing, format, tone
Keeps facts currentOnly if facts are in the prompt
Effort and costLowest
Choose when Start here for every use case.
RAG
What it changesThe information available at answer time
Best forCompany knowledge that changes; citations
Keeps facts currentYes, by updating content
Effort and costModerate: content and retrieval setup
Choose when Answers must come from your documents and stay current.
Fine-tuning
What it changesThe model's learned behaviour
Best forConsistent style, specialised tasks or formats
Keeps facts currentNo; knowledge is fixed at training
Effort and costHighest: labelled data, training, hosting
Choose when Prompts and RAG cannot produce the required behaviour reliably.

The following diagram shows the usual progression between the three approaches.

The three ways to adapt a foundation model, as steps of rising effort. Prompt engineering changes the instructions and suits framing, format and tone. RAG changes the information available at answer time and keeps answers current. Fine-tuning changes the model's learned behaviour, needs labelled data, training and hosting, and fixes its knowledge at training time. Start with prompts and add complexity only when needed.
The approaches can be combined; most use cases are met by prompt engineering and RAG without fine-tuning.
Sort into groups

Prompt, RAG or fine-tune?

Exam skills 1.3.3

Choose the simplest adaptation approach that meets each requirement.

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

Two requirements, two techniques

A travel company wants its booking assistant to answer questions about current fares and booking conditions, which change daily, and to write every response in its distinctive, playful brand voice. Extensive prompting with examples has not produced the voice consistently. What combination is appropriate?

The two requirements need different techniques. Daily-changing fares and conditions need RAG (or live data retrieval), because fine-tuned knowledge would be out of date immediately. The brand voice is a behaviour that prompting has failed to deliver, which justifies fine-tuning on examples of approved responses. Combining a fine-tuned model with RAG gives both the voice and current information.

Worked example

High volume and a narrow task

An online marketplace uses a large foundation model to check five million new product listings a month against its listing rules. Quality is good, but model costs have become one of the platform's largest operating expenses, and the task itself has not changed in a year. What adaptation option should the company evaluate?

The task is narrow, stable and very high volume, which is the situation in which model distillation or fine-tuning a smaller model is justified. The large model's decisions, reviewed for accuracy, can provide the training examples. The smaller model must then be evaluated on a held-out test set against the large model's quality, and the business case should compare the reduction in inference cost with the cost of training, hosting and periodic retraining. Cases on which the smaller model has low confidence can still be sent to the large model.

Check yourself

Why is fine-tuning a poor way to give a model knowledge of prices that change weekly?

Show answer

Knowledge learned in fine-tuning is fixed at training time, so it would be out of date within a week. RAG or live data retrieval keeps prices current.

Exam Tips

Remember for the exam

  • Fine-tuning changes behaviour; RAG supplies knowledge; prompts frame each task.
  • Fine-tuning needs labelled examples and does not keep facts current.
  • Progress from prompting to RAG to fine-tuning, adding complexity only when needed.
  • Distillation makes a smaller model match a larger one on a specific task at lower cost.
  • Fine-tuning data must be representative, reviewed and consistent; quality matters more than quantity.
  • Fine-tuning is not a reliable way to add facts and does not stop hallucination.
  • Fine-tuned models need re-evaluation and often retraining when the base model is retired.