Concept 4 of 5

Customising a foundation model

3 questions test this

There are four ways to close the gap between a general model and your problem. The exam expects you to order them by cost and pick the cheapest one that works.

In context learning

Put instructions and examples in the prompt. Nothing about the model changes, and the effect lasts exactly one call.

Cheapest to set up, fastest to iterate, and the right first attempt for almost everything. Its costs are ongoing rather than upfront, since those tokens are paid for on every request, and it is bounded by the context window.

Retrieval Augmented Generation

Fetch relevant documents at question time and put them in the prompt. Still no change to the model.

This is the answer when the gap is knowledge. Current facts, private documents, anything needing a citation. Moderate cost to build a pipeline, cheap to keep current, and the only one of the four where fixing a wrong answer can mean editing a document.

Fine tuning

Train the model further on your own labelled examples so its weights change. The gap it closes is behaviour, not knowledge.

The syllabus names the variants. Instruction tuning teaches the model to follow instructions in a particular way. Domain adaptation teaches the vocabulary and conventions of a field. Transfer learning is the general principle underneath, where a model trained for one thing is adapted to another. Reinforcement learning from human feedback uses human rankings to train a reward model that shapes output towards what people prefer.

Reach for it when a consistent format, tone or style is needed on every call, when prompts have grown long and repetitive, or when a smaller fine tuned model could replace an expensive general one. That last case is the strongest commercial argument, because the training cost is paid once and the inference saving recurs.

Data preparation is most of the work. The syllabus names curation, governance, size, labelling and representativeness. A model learns whatever is in the examples, including the mistakes and the imbalance.

Continued pre training

Train on a large unlabelled domain corpus so the model absorbs a field's language. No labels, much more data than fine tuning, much less than the original pre training.

Worth it when a domain is genuinely far from general text, such as clinical notes or legal filings. Expensive, and rarely the first answer.

Pre training from scratch

Training a foundation model from nothing. Millions of dollars, months, and a specialist team. Justified by a handful of organisations for reasons of sovereignty, licensing or a domain nothing else covers.

Choosing

Ask what kind of gap you are looking at.

If the model does not know something, that is retrieval. If it does not behave the way you need, that is fine tuning. If it does not speak the language of the field, that is continued pre training. If you are unsure, it is in context learning, because it takes an afternoon and it tells you which of the others you actually needed.

The order matters commercially as well. Each step costs more to set up and takes longer to correct, and teams that begin with fine tuning frequently discover afterwards that a better prompt and a retrieval index would have done it. Amazon Bedrock supports fine tuning and continued pre training on supported models, and the customised model then carries its own hosting cost on top of the tokens.

Common misconceptions

Fine tuning is how you teach a model your company's facts.

Fine tuning teaches behaviour, tone, format and domain language. Facts that change belong in retrieval, because correcting a fine tuned model means another training run while correcting an index means editing a document.

More training data always makes fine tuning better.

Quality and representativeness beat volume here. A few hundred carefully curated examples routinely outperform tens of thousands of inconsistent ones, because the model learns the inconsistency along with the task.

In context learning changes the model.

Nothing is changed. The examples live in the prompt and are gone after the call, which is why it costs tokens on every request and why it is the cheapest thing to try and the most expensive to run at volume.

3 questions test this concept

Order the four customisation approaches from lowest to highest setup cost, as the syllabus presents them.

  • AIn context learning, Retrieval Augmented Generation, fine tuning, continued pre training.
  • BFine tuning, in context learning, Retrieval Augmented Generation, continued pre training.
  • CContinued pre training, fine tuning, Retrieval Augmented Generation, in context learning.
  • DRetrieval Augmented Generation, in context learning, continued pre training, fine tuning.
Check whether it stuck.

One per page, with a worked explanation.

Start the set
Related material
Book
AI Engineering, On when adaptation is worth its cost.
Book
Designing Machine Learning Systems, On data curation for training.
Template
RICE scoring sheet, Reach, Impact, Confidence and Effort columns with the score formula built in, defined confidence bands, and a column recording the assumption behind each input.