AWS AI Practitioner · 10 of 12

Customising and evaluating foundation models: fine-tuning, RLHF, ROUGE, BLEU and benchmarks

How a foundation model is pre-trained, fine-tuned and aligned with RLHF, the parameter-efficient methods such as LoRA, what a fine-tuning data set must look like, where AWS does the training (Bedrock custom models, SageMaker JumpStart, Ground Truth), and how to evaluate the result: human evaluation, benchmarks such as MMLU and HELM, ROUGE, BLEU and BERTScore, and the business metrics that decide whether it worked.

Updated 2026-09-10AIF-C01 · Domain 3
On this page

Every foundation model on Amazon Bedrock arrived there through the same three-stage journey: a provider pre-trained it on a slice of the written internet, fine-tuned it on examples of the behaviour it should have, and aligned it with human feedback. A customer who is unhappy with what the model does can repeat the second stage on their own data, and that is what "customising a foundation model" means in practice. This article covers how each stage works, the methods that make fine-tuning affordable, what the training data has to look like, where AWS runs the jobs, and then the harder half of the job: proving that the customised model is actually better. That proof comes in three layers, public benchmarks, automatic metrics such as ROUGE and BLEU, and human judgement, and finally the business numbers that decide whether the project paid for itself. The applications article already covers when to fine-tune rather than prompt or retrieve; this one is about how, and how to tell whether it worked.

The map

Read this first when short on time. Every branch is a section below.

Figure 1. The whole article on one page. The right side is how a model is trained and customised; the left side is where AWS runs it and how the result is evaluated. Fold what you know, open what you do not.

Pre-training: how a model learns language by predicting the next token

Pre-training is the first and by far the most expensive stage: a randomly initialised transformer is shown trillions of tokens of text and trained, over and over, to predict the next token, until the weights encode grammar, facts, reasoning patterns and the style of every kind of text it saw.

The remarkable thing about the objective is that it needs no labels. A sentence from a web page is its own training example: hide the last word, ask the model to guess it, score the guess against the word that was actually there, adjust the weights a little, repeat. This is self-supervised learning: the supervision signal is manufactured from the data itself rather than written by a person. Decoder models such as GPT, Llama, Claude and Amazon Nova use next-token prediction (also called causal language modelling); encoder models such as BERT use masked language modelling, where random tokens in the middle of a sentence are hidden and predicted from both sides. The fundamentals article covers the tokens, embeddings and attention that make this possible; the point here is the training loop and its scale.

The corpus

The training corpus is assembled from web crawls, books, encyclopaedias, code repositories, scientific papers and licensed data sets. It is filtered for quality, deduplicated so that a page copied ten thousand times does not count ten thousand times, and weighted so that high-quality sources such as books and reference text appear more often than their share of the raw crawl. Whatever the corpus contained on the day it was frozen is what the model knows; that date is the model's knowledge cut-off, and nothing after it is in the weights.

The cost

Pre-training a frontier model takes thousands of accelerators (NVIDIA GPUs, or AWS Trainium chips) running for weeks or months, with the data sharded across them and the weights kept in sync after every step. The bill is tens of millions of dollars for the largest models, plus the engineering team to keep a run of that size alive. This is why pre-training is done by model providers, Amazon, Anthropic, Meta, Mistral, Cohere, AI21 and a few others, and why for a business the question is never "shall we pre-train?" but "which pre-trained model shall we start from?". The compute also has an environmental cost, which the responsible AI article returns to.

What comes out

The output is a base model: a very good text completer that does not yet know it is supposed to be an assistant. Ask a base model "What is the capital of France?" and it may answer "Paris", or it may continue with "What is the capital of Germany?" because quiz lists are common on the web. Making it answer the question, follow instructions and refuse harmful requests is the job of the next two stages, which are the subject of the rest of the training half of this article.

flowchart TD
  C["Raw corpus<br/>web pages, books, code, trillions of tokens, no labels"] --> P["Pre-training<br/>self-supervised next-token prediction<br/>thousands of accelerators for weeks"]
  P --> B["Base model<br/>completes text, follows no instructions"]
  B --> D["Continued pre-training, optional<br/>unlabelled domain text, same objective"]
  D --> F["Supervised fine-tuning<br/>labelled prompt and completion pairs"]
  B --> F
  F --> I["Instruction-tuned model<br/>answers, formats, follows rules"]
  I --> R["RLHF<br/>human rankings, reward model, policy optimisation"]
  R --> A["Aligned assistant model<br/>helpful, honest, harmless"]
Figure 2. The training pipeline. Providers run all of it; a customer on Bedrock or SageMaker re-runs the middle (continued pre-training or supervised fine-tuning) on their own data, starting from the provider's base or instruction-tuned model.
In the wild
  • Meta Llama publishes the pre-training recipe with each release: the token count (Llama 3 was trained on about 15 trillion tokens), the data mix and the size of the GPU cluster, which is why it is the usual reference for what pre-training costs.
  • Amazon Nova and Titan are Amazon's own pre-trained families on Bedrock; Nova was trained in part on AWS Trainium, the accelerator AWS built for exactly this workload.
  • Anthropic Claude is pre-trained and aligned by Anthropic and offered on Bedrock as a closed model: customers see the API, not the weights, so customisation happens through prompts and retrieval, apart from the fine-tuning of Claude 3 Haiku that Bedrock has offered as the exception.
Exam angle

Pre-training is described by three words the exam likes: self-supervised, unlabelled, next-token. A question that mentions "trillions of tokens", "the most computationally expensive phase" or "training from scratch" is about pre-training, and the right business answer is almost always "do not do it, start from a foundation model". "Knowledge cut-off" is a pre-training fact: information after it needs RAG, not a bigger model.

self-supervised learning
Training where the labels are derived from the data itself, such as hiding the next word and predicting it, so no human labelling is needed.
next-token prediction
The pre-training objective of decoder models: given the tokens so far, output a probability for every possible next token; the loss is how much probability was given to the token that actually followed.
base model
The output of pre-training alone. It completes text in the style of its corpus but has not been taught to follow instructions or behave as an assistant.
knowledge cut-off
The date after which no text was included in the training corpus, and therefore the edge of what the model knows from its weights.

Fine-tuning: teaching a pre-trained model your task with labelled pairs

Fine-tuning is supervised training that starts from a pre-trained model's weights and continues on a much smaller set of labelled examples, each a prompt and the completion the model should have produced, so that the model's behaviour shifts towards those examples while keeping everything it learned in pre-training.

Mechanically it is the same loop as pre-training, gradient descent on next-token prediction, with two differences. First, the data is labelled: every example is a pair someone wrote or approved, and the loss is usually computed only on the completion tokens, so the model learns to produce the answer rather than to reproduce the prompt. Second, the scale is tiny by comparison: hundreds to tens of thousands of examples and hours of training on a handful of accelerators, not trillions of tokens and months. Because the starting point already understands language, a few thousand examples of "here is a support ticket, here is the category" are enough to make a general model a reliable ticket classifier in the company's own taxonomy.

Instruction tuning

The most important kind of fine-tuning is instruction tuning: training on pairs of an instruction and a good response ("Summarise the following article in three bullets" followed by three bullets, thousands of times across many task types). It is what turns a base model into an "instruct" or "chat" model that answers questions instead of continuing them, follows a requested format and stops when it is done. Every assistant model on Bedrock has been instruction-tuned by its provider; when a customer fine-tunes on Bedrock, they are adding their own instructions and examples on top of that.

Adapting to a domain

The second common purpose is domain adaptation: teaching the model the vocabulary, style and conventions of a field (clinical notes, insurance claims, legal clauses, a company's product names) so that it stops misusing terms and writes the way that field writes. Labelled pairs do this well when the domain is about how things are said; when it is about knowing a large body of new facts, the next section's method fits better, and when the facts change often, retrieval beats both, as the applications article explains.

Transfer learning, the idea underneath

Both are instances of transfer learning: knowledge learned on one task (predicting text across the whole internet) is reused as the starting point for another (classifying tickets). The general features, grammar, world knowledge, reasoning patterns, transfer; only the task-specific behaviour has to be learned, which is why so little data is needed. The same idea predates foundation models: image classifiers fine-tuned from ImageNet weights have been standard for a decade, and the fundamentals article introduces it in that setting.

In the wild
  • InstructGPT was OpenAI's demonstration that instruction tuning matters more than size: a 1.3-billion-parameter model fine-tuned on human-written demonstrations was preferred by raters over the 175-billion-parameter GPT-3 base model it came from.
  • Amazon Bedrock custom models fine-tune Amazon Titan, Amazon Nova and selected Meta and Cohere models on a customer's JSONL pairs; the custom model is private to the account and invoked through the same API as the base model.
  • SageMaker JumpStart offers open models (Llama, Mistral, Falcon and others) with a fine-tuning option that takes a labelled data set in S3 and produces a deployable model, no training script required.
Watch out
  • Fine-tuning teaches behaviour, not facts. A model fine-tuned on a thousand product FAQs learns the tone and shape of an FAQ answer far more reliably than the individual facts, and it still confabulates. Knowledge that must be exact belongs in a retrieval index.
  • Catastrophic forgetting. Push the weights hard on a narrow task and the model can lose general abilities it had before: the ticket classifier stops being able to summarise. Small learning rates, few epochs, a mixed data set and the parameter-efficient methods below all reduce it.
  • A fine-tuned model is a new artefact. It must be evaluated, versioned, hosted and paid for separately from the base model, and retrained when the base model is upgraded.
Exam angle

The exam's phrase for fine-tuning is supervised training on labelled data. "Instruction tuning" is the answer when the question describes a model that does not follow instructions or format its output. "Transfer learning" is the answer when the question describes reusing a model trained on one task for a related one with little data. "Domain-specific terminology the model misuses" points at fine-tuning; "up-to-date information" never does.

fine-tuning
Supervised training of a pre-trained model on labelled prompt and completion pairs so that it adopts a task, style or domain. Produces a new, private model.
instruction tuning
Fine-tuning on instruction and response pairs across many task types, which teaches a model to follow instructions rather than merely continue text.
transfer learning
Reusing what a model learned on one task as the starting point for another, so the second task needs far less data. Fine-tuning a foundation model is transfer learning at its largest scale.
catastrophic forgetting
The loss of previously learned abilities when a model is trained hard on a narrow new task.

Continued pre-training: giving the model a new domain's vocabulary and knowledge

Continued pre-training (Bedrock's name; the exam guide also writes "continuous pre-training") runs the self-supervised next-token objective again, this time on a large body of unlabelled text from one domain, so the model absorbs the domain's vocabulary, facts and style without anyone writing a single prompt and completion pair.

The difference from fine-tuning is the data, not the maths. Fine-tuning needs pairs and teaches a task; continued pre-training needs raw documents and teaches a field. A hospital group with twenty years of de-identified discharge summaries, a law firm with its archive of contracts, a manufacturer with thousands of maintenance manuals: none of that is labelled, all of it is full of terms and phrasing that a general model has seen rarely or never. Feed it in as plain text and the model's internal representation of that field sharpens. Afterwards the model is usually still fine-tuned on a small labelled set so that it also knows what to do with the new knowledge; Figure 2 shows continued pre-training as the optional step between the base model and supervised fine-tuning.

It sits one rung above fine-tuning on the cost ladder. It needs far more text (millions of tokens at least, and the more the better), longer training and, on Bedrock, the same Provisioned Throughput to host the result. It also shares fine-tuning's weakness for facts that change: whatever was in the documents at training time is frozen into the weights, so it complements rather than replaces retrieval.

Fine-tuningContinued pre-training
ObjectiveSupervised: predict the labelled completion given the prompt.Self-supervised: predict the next token of raw text.
DataLabelled prompt and completion pairs, hundreds to tens of thousands.Unlabelled domain documents, as much as possible.
TeachesA task, a format, a tone, following instructions.Vocabulary, domain knowledge, the style of a field.
EffortHours; the labelling is the expensive part.Longer runs; the data collection is the expensive part.
BedrockFine-tuning job, JSONL with prompt and completion.Continued pre-training job, JSONL with input text only.
Exam keyword"Labelled", "specific task", "consistent format"."Unlabelled", "domain-specific language", "large corpus of documents".
In the wild
  • BloombergGPT is the well-known example: a 50-billion-parameter model trained by Bloomberg on a mix in which roughly half the tokens were financial documents from its own archives and half were general text. It outperformed general models of its size on financial tasks (sentiment on earnings reports, named entities in filings) while holding its own on general benchmarks.
  • Amazon Bedrock offers continued pre-training for Amazon Titan Text models: point a job at a bucket of unlabelled text, and the output is a custom model that speaks the domain.
  • Medical and legal models such as the research families built on Llama for clinical text follow the same recipe: continued pre-training on PubMed abstracts or case law, then instruction tuning on a small set of questions and answers.
Exam angle

The tell is unlabelled. "A company has a large collection of unlabelled industry documents and wants the model to understand its terminology" is continued pre-training. If the same question says "labelled examples" it is fine-tuning; if it says "documents that are updated weekly" it is RAG. The exam sometimes lists continued pre-training as a fine-tuning method, so treat "methods for fine-tuning" as including it.

continued pre-training
Further self-supervised training of a foundation model on unlabelled domain text. Also written "continuous pre-training" in the exam guide. Teaches vocabulary and knowledge rather than a task.
domain adaptation
Any method that makes a general model perform well in one specialist field; fine-tuning and continued pre-training are its two training-based forms, RAG its retrieval-based form.

The customisation methods compared: full fine-tuning, PEFT and LoRA, instruction tuning, continued pre-training, RLHF

"Fine-tuning" covers several techniques that differ in which weights move, what data they need and what they cost, and the exam expects the names to be told apart: full fine-tuning updates every weight, parameter-efficient fine-tuning freezes the model and trains a small addition, instruction tuning and continued pre-training are defined by their data, and RLHF is defined by its feedback signal.

Full fine-tuning

Every parameter of the model is updated on the new data. It is the most flexible method and, for a small model, the simplest. For a large model it is expensive in three ways: the training run needs enough accelerator memory to hold the weights, their gradients and the optimiser state (several times the size of the model itself); every task produces a complete copy of the model to store and host; and the risk of catastrophic forgetting is highest because nothing is anchored.

Parameter-efficient fine-tuning

Parameter-efficient fine-tuning (PEFT) keeps the pre-trained weights frozen and trains a small number of new parameters that modify the model's behaviour. Two families matter:

Prompt tuning and prefix tuning belong to the same family: they learn a handful of virtual tokens prepended to every input rather than changing any layer. All of them trade a small loss of peak quality for a large saving in compute, storage and forgetting.

flowchart TD
  X["Input activations x"] --> W["Frozen pre-trained weight W<br/>billions of parameters, never updated"]
  X --> A["LoRA matrix A, d × r<br/>trainable, r is small"]
  A --> B["LoRA matrix B, r × d<br/>trainable"]
  W --> S(("add"))
  B --> S
  S --> Y["Output = W·x + B·A·x<br/>merged into one matrix for serving"]
Figure 3. LoRA in one layer. The big matrix stays frozen; the two thin matrices learn the task. Their product is a low-rank correction that can be merged into W once training ends, so serving costs the same as the base model.

The comparison

MethodData typeWhat movesCostOutcomeExam keyword
Full fine-tuningLabelled prompt and completion pairs.All weights.High: memory for weights, gradients and optimiser; one full model copy per task.Maximum adaptation; highest forgetting risk."Update all parameters", "best possible accuracy regardless of cost".
PEFT (LoRA, adapters)Labelled pairs, same as above.A small set of new weights; base frozen.Low: a fraction of the compute and memory, adapters of megabytes.Close to full fine-tuning quality; many tasks share one base."Reduce training cost", "limited compute", "fine-tune a large model efficiently".
Instruction tuningLabelled instruction and response pairs across many tasks.All or PEFT weights (it is defined by the data, not the mechanism).Medium; the labelling is the cost.A model that follows instructions and formats output."Follow instructions", "respond in a consistent format".
Continued pre-trainingUnlabelled domain text, lots of it.All weights, self-supervised.High: long runs over a large corpus.Domain vocabulary and knowledge."Unlabelled", "domain-specific language".
RLHFHuman preference rankings between candidate answers.Policy weights, guided by a learned reward model.High: human ranking plus a reinforcement learning loop.Helpful, harmless, preferred answers; alignment."Human feedback", "align with human preferences", "reward model".
In the wild
  • Hugging Face PEFT is the library most open-model fine-tuning uses for LoRA and QLoRA; a Llama adapter trained with it is a small file that loads on top of the public base weights.
  • SageMaker JumpStart fine-tuning scripts for Llama, Mistral and similar models use LoRA under the hood, which is what lets a 7-billion or 70-billion-parameter model be adapted on a single training instance.
  • Amazon Bedrock hides the mechanism: a customer submits pairs and receives a custom model, and whether the provider used full or parameter-efficient training is not exposed. The exam treats "Bedrock fine-tuning" as the managed, low-effort option.
Watch out

PEFT reduces the training cost, not the serving cost. A LoRA-tuned 70-billion-parameter model still needs the hardware to serve 70 billion parameters. If the goal is a cheaper or faster model in production, the tools are a smaller base model, distillation (training a small model to imitate a large one, which Bedrock offers as model distillation) or quantisation, not PEFT.

Exam angle

"Fine-tune a large model with limited compute" or "reduce the cost of fine-tuning" is PEFT or LoRA. "Update all of the model's parameters" is full fine-tuning. When a question lists the fine-tuning methods it wants recognised, the exam guide's list is instruction tuning, domain adaptation, transfer learning and continuous pre-training; RLHF is asked separately as the alignment method.

PEFT
Parameter-efficient fine-tuning: any method that freezes the pre-trained weights and trains a small number of additional parameters instead.
LoRA
Low-Rank Adaptation: the PEFT method that learns two small matrices whose low-rank product is added to a frozen weight matrix. The adapter is tiny and can be merged for serving.
adapter
A small trainable layer inserted into a frozen model; also the general word for the file produced by any PEFT method.
distillation
Training a smaller "student" model to reproduce the outputs of a larger "teacher", so the student is cheaper to serve. Offered on Bedrock as model distillation.

RLHF: turning human preferences into a reward the model can optimise

Reinforcement learning from human feedback is the alignment stage: humans rank several candidate answers to the same prompt, a reward model is trained to predict those rankings, and the language model is then optimised with reinforcement learning to produce answers the reward model scores highly, which makes it more helpful, more honest and less harmful than instruction tuning alone can.

The insight behind it is that people are bad at writing the perfect answer but good at recognising the better of two. Supervised fine-tuning needs someone to write the ideal response to every prompt, which is slow, expensive and caps quality at what the writers can produce. Preferences are cheap: show a rater two answers and ask which is better. Enough of those comparisons define what "good" means well enough that a model can be trained to score it, and once "good" is a number, ordinary optimisation can chase it.

The three stages

  1. Supervised fine-tuning (SFT). Start from the pre-trained model and fine-tune it on a modest set of human-written demonstrations so it produces sensible answers at all. This is the instruction tuning from the previous sections.
  2. Train the reward model. Sample several answers from the SFT model for each of many prompts. Human labellers rank them from best to worst (or pick the better of a pair). A second model, usually a copy of the language model with a scalar output head, is trained so that it gives a higher score to the answer the humans preferred. It is now a learned stand-in for human judgement, cheap to run millions of times.
  3. Optimise the policy. Treat the language model as a reinforcement learning policy: for a prompt it produces an answer, the reward model scores the answer, and an algorithm, classically Proximal Policy Optimisation (PPO), updates the weights to raise the expected score. A penalty on how far the policy's output distribution drifts from the SFT model (a KL divergence term) keeps it from finding nonsense that fools the reward model, and a little of the original pre-training loss is often mixed in to prevent forgetting.
sequenceDiagram
  autonumber
  participant L as Human labellers
  participant S as SFT model
  participant R as Reward model
  participant P as Policy (the FM)
  L->>S: write ideal answers to prompts
  S->>S: supervised fine-tuning
  S->>L: several answers per prompt
  L->>R: rank them, best to worst
  R->>R: learn to score like the raters
  P->>R: answer to a new prompt
  R->>P: reward score
  P->>P: PPO step, KL penalty to SFT
Figure 4. RLHF as a conversation. Humans appear only in steps 1 and 4; after that the reward model stands in for them and steps 6 to 8 repeat millions of times. The policy starts as a copy of the SFT model and is pulled back towards it by the KL penalty.

Variants

In the wild
  • InstructGPT and ChatGPT are the RLHF story. OpenAI's 2022 paper introduced the three-stage recipe above and showed that a small RLHF-trained model was preferred to a far larger base model; ChatGPT applied the same recipe to conversation, and its refusals and helpful tone are largely RLHF's work.
  • Anthropic Claude is trained with RLHF plus Constitutional AI, so a large share of the preference data comes from a model applying written principles rather than from human raters alone.
  • Meta Llama 2 Chat and Llama 3 Instruct were aligned with RLHF using more than a million human preference comparisons, and Meta reported that reward-model accuracy was one of the best proxies for the final model's quality.
  • Amazon SageMaker Ground Truth supports the human side: a ranking or comparison task template in which workers order several model answers, producing exactly the preference data a reward model is trained on.
Watch out
  • Reward hacking. A policy will find whatever the reward model over-rewards: longer answers, confident tone, flattery, excessive hedging. The KL penalty and fresh human data limit it; nothing removes it.
  • The raters' preferences become the model's values. Who the labellers are, what instructions they were given and which cases they saw all shape the aligned model. This is where bias enters at the alignment stage, a theme the responsible AI article picks up.
  • RLHF is not a customer-side step on Bedrock. Bedrock customisation offers fine-tuning and continued pre-training; the RLHF that shaped Claude, Titan or Nova was done by the provider. A customer wanting preference-based training does it on SageMaker with their own pipeline.
Exam angle

RLHF questions hinge on the words "human feedback", "human preferences", "rank the responses" and "reward model". The sequence to remember is: collect human rankings, train a reward model, optimise the policy with reinforcement learning. The purpose is alignment, making outputs helpful and harmless, not adding knowledge. If a question asks for the AWS service that collects the human rankings, the answer is SageMaker Ground Truth (with Mechanical Turk or a private workforce doing the work).

RLHF
Reinforcement learning from human feedback: aligning a model by training a reward model on human preference rankings and then optimising the model to maximise that reward.
reward model
A model trained to score an answer the way human raters would, used as the reward signal in RLHF so humans need not rate every sample.
policy
Reinforcement learning's word for the thing being optimised; in RLHF it is the language model itself, choosing tokens as actions.
PPO
Proximal Policy Optimisation, the reinforcement learning algorithm classically used in RLHF; it makes small, bounded updates to the policy.
RLAIF
Reinforcement learning from AI feedback: the same loop with a model, guided by written principles, supplying the preference rankings instead of people.

Preparing the data: what a fine-tuning set has to look like before training starts

A fine-tuning run is only as good as its examples, and preparing them is most of the work: choosing examples that represent the real inputs, labelling them consistently, removing duplicates and personal data, putting them into the format the service expects, splitting off a validation set and keeping a record of where every example came from.

The model will imitate the data exactly, including its mistakes. If a fifth of the training completions are sloppy, a fifth of the model's answers will be sloppy. If all the examples are short, the model will answer briefly no matter what it is asked. If none of the examples contain a refusal, the model will not refuse. This is why a few thousand carefully curated pairs beat a hundred thousand scraped ones, and why the exam frames data preparation as a governance task and not just a formatting one.

The checklist

  1. Define the task and collect candidates. Write down exactly what the model should do and gather real inputs from production logs, support systems or documents, with the outputs a good employee produced or would produce. Real inputs are better than invented ones because they carry the messiness the model will actually meet.
  2. Check representativeness. The set should cover the range of inputs in the same proportions as production: every category, every language, the hard cases and the easy ones, the requests that should be refused. A set that over-represents one product line teaches the model that everything is about that product line. This is the same sampling-bias concern the responsible AI article describes for classical models.
  3. Label, and check the labelling. Where completions have to be written or corrected, give labellers a written guide, use more than one labeller on a sample and measure their agreement. Amazon SageMaker Ground Truth manages the workflow; the workforce can be the company's own staff, a vendor or Amazon Mechanical Turk's public crowd.
  4. Deduplicate. Exact and near-duplicate examples inflate the weight of whatever they contain and make validation scores dishonest when a duplicate lands in both splits. Hash exact matches; use similarity search for near ones.
  5. Remove or mask personal and sensitive data. Names, addresses, account numbers and health details in the training set end up in the weights, where they cannot be deleted and can be regurgitated. Amazon Comprehend detects and redacts PII in text; Amazon Macie finds sensitive data in S3 buckets. Check licences and consent for every source at the same time.
  6. Balance and size. Bedrock and JumpStart work from hundreds of examples upwards; a few thousand high-quality pairs is the usual sweet spot, and more helps with diminishing returns. Rebalance under-represented classes rather than letting the majority swamp them.
  7. Format. Convert to the shape the service expects, JSON Lines with one example per line for Bedrock, and upload to an S3 bucket the training service role may read. SageMaker training jobs take their data as named channels (typically train and validation), each an S3 prefix mounted into the container.
  8. Split. Hold out a validation set the training never sees (ten to twenty percent is typical) to measure real quality and to catch overfitting; Bedrock accepts a separate validation file and reports its loss alongside the training loss. Keep a further test set for the evaluation half of this article.
  9. Record provenance. Where each example came from, who labelled it, which version of the guide they used, and what was removed. Governance questions later ("was any customer's data used?") are unanswerable without it, and the same record lets a poisoned example be traced.
// Bedrock fine-tuning data: JSON Lines, one prompt and completion per line
{"prompt": "Classify the ticket: My card was charged twice for one order.", "completion": "billing/duplicate-charge"}
{"prompt": "Classify the ticket: The app crashes when I open my basket.", "completion": "app/crash"}
{"prompt": "Classify the ticket: How do I change my delivery address?", "completion": "account/address-change"}

// Bedrock continued pre-training data: unlabelled text only
{"input": "Under clause 14.2 the lessee shall indemnify the lessor against ..."}
{"input": "Heads of terms are not binding unless expressly stated to be so ..."}
flowchart TD
  A["Collect real inputs and good outputs<br/>logs, tickets, documents"] --> B["Curate<br/>representative, balanced, licensed"]
  B --> C["Label and review<br/>Ground Truth, written guide, agreement check"]
  C --> D["Clean<br/>deduplicate, remove PII with Comprehend"]
  D --> E["Format<br/>JSONL prompt and completion pairs"]
  E --> F["Split<br/>train, validation, held-out test"]
  F --> G["Upload to S3<br/>training job reads it through a service role"]
Figure 5. The data pipeline before any training happens. Every box is a place where the model's future behaviour is being decided; the training job at the end only faithfully reproduces what arrived.
In the wild
  • Amazon Bedrock takes fine-tuning data as a JSONL file in S3 with prompt and completion fields (a conversational format with system and messages for chat models), an optional validation file, and writes training and validation loss per step to an output bucket.
  • SageMaker Ground Truth Plus is the managed version of labelling: AWS supplies and manages the workforce, the customer supplies the data and the instructions.
  • Amazon Comprehend is the usual PII step in an AWS pipeline: its DetectPiiEntities call returns the spans to mask before the text goes anywhere near a training job.
Watch out
  • Leakage between splits. A near-duplicate of a training example in the validation set produces a flattering score that the production traffic will not reproduce.
  • Overfitting a small set. Too many epochs over a few hundred examples and the model memorises them; validation loss rising while training loss falls is the signal to stop.
  • Poisoned or drifted labels. A labelling crowd that misunderstands the guide, or a malicious contributor, corrupts the model silently; the prompt engineering article lists data poisoning among the attack families for exactly this reason.
Exam angle

Data-preparation questions want the governance words: curation, representativeness, labelling quality, deduplication, PII removal, provenance. "Which service labels the data?" is SageMaker Ground Truth; "which service finds PII in text?" is Amazon Comprehend; "which finds sensitive data in S3?" is Amazon Macie. "Training data for Bedrock fine-tuning must be in" JSON Lines in S3 with prompt and completion pairs. "The model performs well on training data but poorly on new inputs" is overfitting, fixed with more varied data, fewer epochs or a validation-based stop.

JSON Lines (JSONL)
A text file with one JSON object per line. The training-data format for Bedrock customisation and a common one for SageMaker.
data channel
A named input to a SageMaker training job, backed by an S3 prefix and made available inside the training container; conventionally train, validation and test.
validation set
Examples held out of training and scored during it to measure real quality and detect overfitting. Distinct from the test set, which is used only at the end.
provenance
The recorded origin and history of a data item: source, licence, labeller, transformations. The basis of data governance for training sets.

Where AWS does it: Bedrock custom models, SageMaker JumpStart, training jobs and Ground Truth

AWS offers the training half of this article at three levels of effort: Amazon Bedrock runs fine-tuning and continued pre-training as a managed job with no infrastructure to see, SageMaker JumpStart fine-tunes open models with a prepared script on infrastructure you pick, and a SageMaker training job runs any script on any container; Amazon SageMaker Ground Truth and Amazon Mechanical Turk supply the labelled and preference data all three need.

Amazon Bedrock custom models

In the Bedrock console or API a customisation job takes a base model that supports it (Amazon Titan Text and Titan Image Generator, Amazon Nova, and selected Meta Llama and Cohere models), a training file in S3, optional validation data and a few hyperparameters (epochs, batch size, learning rate), and produces a custom model that lives in the account, encrypted with an AWS-managed or customer-managed KMS key and never shared with the model provider. Two job types exist: fine-tuning on labelled pairs and continued pre-training on unlabelled text. The output metrics (training loss, validation loss) are written to S3 for inspection.

To invoke a custom model it has to be hosted, and the mechanism the exam expects is Provisioned Throughput: you buy a number of model units for a term (no commitment, one month or six months), which reserves capacity for that model. Base models are billed on demand per token; custom models have historically required provisioned throughput because a private copy of the weights has to be loaded onto dedicated capacity. AWS has since added on-demand inference for some custom models, but "a custom model on Bedrock needs Provisioned Throughput" remains the exam's fact. The Bedrock article covers model units and the rest of the pricing.

flowchart TD
  D["Training data in S3<br/>JSONL prompt and completion pairs"] --> J["Bedrock customisation job<br/>fine-tuning or continued pre-training"]
  V["Validation data in S3, optional"] --> J
  J --> M["Custom model in the account<br/>encrypted, private to you"]
  J --> O["Output metrics in S3<br/>training and validation loss"]
  M --> T["Provisioned Throughput<br/>model units reserve capacity"]
  T --> I["InvokeModel or Converse<br/>same API as the base model"]
Figure 6. The Bedrock customisation path. Nothing leaves the account: the data stays in S3, the custom model is stored encrypted, and the model provider never sees either. Hosting the result is the step that costs money every hour.

SageMaker JumpStart

JumpStart is the model hub inside SageMaker Studio: hundreds of open and proprietary models (Llama, Mistral, Falcon, Stable Diffusion, Hugging Face models, plus Amazon's own) that can be deployed to an endpoint in a few clicks or fine-tuned with a prepared training script. For text models the script is typically LoRA-based; you point it at a data set in S3, choose an instance type and hyperparameters, and get back model artefacts to deploy on a SageMaker endpoint. More control than Bedrock (you choose the instance, you own the endpoint), less than a hand-written job.

SageMaker training jobs

A training job is the general mechanism the lifecycle article describes: a container (a built-in algorithm, a framework container for PyTorch or Hugging Face, or your own image), a script, instance type and count, input channels from S3 and an output location. For foundation models this is where full fine-tuning, custom PEFT, RLHF and DPO pipelines run, on GPU instances or on Trainium (trn1) instances, with distributed training libraries for models that do not fit on one device. Managed Spot Training cuts the cost of interruptible runs; SageMaker HyperPod is the resilient cluster option for runs that take days.

Labelling: Ground Truth and Mechanical Turk

Amazon SageMaker Ground Truth builds labelled data sets: it presents items to human workers with a task template (classification, bounding boxes, text spans, and for generative work, writing a completion or ranking several model answers), consolidates several workers' answers per item, and can use automated labelling to reduce the human share. The workforce is one of three: a private workforce of the company's own staff, a vendor workforce from AWS Marketplace, or Amazon Mechanical Turk, the public crowd marketplace, suitable for tasks with no confidential data. Ground Truth Plus is the fully managed version where AWS runs the workforce. For RLHF the ranking template produces the preference pairs a reward model needs.

Amazon Bedrock customisationSageMaker JumpStart fine-tuningSageMaker training job
ModelsBedrock models that support customisation (Titan, Nova, selected Llama and Cohere).Open and hub models: Llama, Mistral, Falcon, Hugging Face.Anything you can load in a container.
MethodsFine-tuning, continued pre-training, (distillation).Prepared scripts, usually LoRA.Full fine-tuning, PEFT, RLHF, DPO, whatever the script does.
InfrastructureNone visible; serverless job.You pick the training instance; SageMaker runs it.You pick instances, count, container, distribution.
Hosting the resultProvisioned Throughput on Bedrock.SageMaker endpoint.SageMaker endpoint, or export the artefacts.
EffortLowest.Low to medium.Highest, most control.
Exam keyword"Least operational overhead", "managed", "custom model on Bedrock"."Open-source model", "pre-built solution", "quickly fine-tune"."Custom training script", "full control", "own algorithm".
In the wild
  • Amazon Titan and Nova are the models most often fine-tuned on Bedrock, because Amazon's own models were the first to support customisation and the exam's examples are written around them.
  • Meta Llama on JumpStart is the standard open-model path: deploy a Llama Instruct model in minutes, or fine-tune it with the JumpStart LoRA script on a domain data set and deploy the result behind an endpoint.
  • Amazon Mechanical Turk predates all of this by nearly two decades; it is the public crowd that labelled many of the early public data sets, and Ground Truth simply adds it as one workforce option next to private teams.
Exam angle

Three services, three signals. "Least effort", "managed", "no infrastructure": Bedrock customisation. "Open-source model", "pre-trained solution to fine-tune quickly": SageMaker JumpStart. "Custom training script", "specific framework version", "distributed training": SageMaker training job. For data: "label the data" is Ground Truth; "public crowd" is Mechanical Turk; "AWS manages the labelling workforce" is Ground Truth Plus; "the fine-tuned model is not available on demand" is because a custom Bedrock model needs Provisioned Throughput.

customisation job
The Bedrock job that produces a custom model from a base model plus training data; either a fine-tuning job or a continued pre-training job.
Provisioned Throughput
Reserved capacity on Bedrock, bought in model units for a term, required to host a custom model and available for base models that need guaranteed throughput.
model unit
The unit of Provisioned Throughput: a fixed amount of input and output tokens per minute for one model.
Ground Truth Plus
The fully managed labelling service in which AWS supplies and runs the workforce; the customer supplies data and instructions.

Human evaluation: rubrics, pairwise preference and Bedrock human evaluation jobs

Human evaluation is people reading model outputs and scoring them, either against a written rubric or by choosing the better of two, and it is the only method that measures what actually matters for open-ended tasks, whether a person finds the answer helpful, correct and appropriate, at the price of being slow, expensive and only as consistent as the people.

Automatic metrics compare an output with a reference; for a summary or a translation that is workable, but for "draft a reply to this customer" there is no single right reference, and a metric that rewards word overlap will punish a better answer phrased differently. So the gold standard for generative quality is human judgement, and every automatic method in the following sections is ultimately validated by how well it agrees with humans.

Rubrics

A rubric names the criteria (accuracy, completeness, tone, harmlessness, adherence to format) and defines what each score means (1 to 5, or pass and fail) so that two raters looking at the same answer reach the same number. Good rubrics are specific ("contains no claim not supported by the source" rather than "is accurate"), and the evaluation uses at least two raters per item with their agreement measured, exactly as labelling does. Scores per criterion are more useful than one overall score because they say what to fix.

Pairwise preference

Show a rater the same prompt with two answers, from two models or two prompts or two versions, and ask which is better. People are more reliable at comparison than at absolute scoring, the results convert to a ranking (Elo-style ratings, as in chess), and the pairs are the same data RLHF's reward model is trained on. It is the method behind public chatbot leaderboards and the standard way to decide "is the new model better than the old one?".

Bedrock human evaluation jobs

Amazon Bedrock model evaluation has a human evaluation mode alongside its automatic one. You supply a prompt data set (your own, in JSONL), choose one or two models to compare, define the metrics and rating method (thumbs up or down, a Likert scale, choice between the two answers, ordinal ranking), and choose the workforce: your own team, set up as a private work team with instructions you write, or an AWS-managed team for which you describe the task and AWS supplies the people. The job produces a report with the scores per metric and, for a comparison, the preference rate. A related later addition, LLM-as-a-judge, lets a strong Bedrock model score another model's answers against a rubric, cheaper than people and closer to them than n-gram metrics.

In the wild
  • Chatbot Arena (LMSYS) ranks models purely by anonymous pairwise votes from the public, converted to Elo-style scores; it is the most-quoted human-preference ranking of chat models.
  • Amazon Bedrock model evaluation human jobs are how a team on AWS compares two Bedrock models, or a base model against its fine-tuned version, on its own prompts with its own raters.
  • Amazon Augmented AI (A2I) is the production counterpart: it routes low-confidence or sampled outputs to human reviewers while the system runs, and the reviewed items become the next evaluation set. The responsible AI article covers it.
Watch out

Human raters are inconsistent, tire, prefer longer and more confident answers, and disagree with each other on anything subjective. Measure inter-rater agreement, randomise which answer appears first in a pairwise task, keep the rubric short enough to be applied, and sample enough items to make the difference between two models statistically meaningful before acting on it.

Exam angle

"Subjective quality", "tone", "creativity", "no single correct answer", "brand voice" all point at human evaluation; "compare two models on our own prompts with our own staff" is a Bedrock human evaluation job with a private work team. If the question stresses cost or speed, the answer moves to automatic evaluation or a judge model. Pairwise preference is the human-evaluation form that also produces RLHF data.

rubric
A written scoring guide that names the criteria and defines each score level, so different raters score alike.
pairwise preference
An evaluation where a rater picks the better of two answers to the same prompt; aggregated into rankings and used as RLHF training data.
inter-rater agreement
How often independent raters give the same score; low agreement means the rubric or the task is unclear and the scores cannot be trusted.
LLM-as-a-judge
Using a capable model to score another model's outputs against a rubric; cheaper and faster than human raters, and closer to them than n-gram metrics.

Benchmarks: the public exams a model sits, and what each one measures

A benchmark is a fixed public data set with a scoring rule, so that every model can be given the same test and the numbers compared; the well-known ones each probe one ability, general knowledge, common sense, language understanding, reading comprehension, truthfulness or coding, and a model card quotes a handful of them the way a school report quotes subjects.

Benchmarks answer "which base model should we start from?" and "did our fine-tuning damage the model's general abilities?" (run the benchmarks before and after: a drop is catastrophic forgetting made visible). They do not answer "does it do our task well?", which needs the task-specific metrics and human evaluation of the other sections. Most are multiple-choice or short-answer so they can be scored automatically, and most are scored as accuracy.

BenchmarkWhat it measuresHowScore
MMLU (Massive Multitask Language Understanding)Breadth of knowledge and reasoning across 57 subjects: maths, law, medicine, history, computer science and more.Multiple-choice questions at school-exam to professional level.Accuracy. The most-quoted single number on model cards.
HellaSwagCommon-sense inference about everyday situations.Pick the most plausible continuation of a short scenario from four options written to fool models.Accuracy.
GLUE and SuperGLUENatural language understanding: sentiment, paraphrase, entailment, coreference, question answering.Suites of classic NLP tasks (GLUE has nine); SuperGLUE is the harder successor built after models saturated GLUE.Average over tasks; each task has its own metric (accuracy, F1, correlation).
SQuAD (Stanford Question Answering Dataset)Reading comprehension: answer a question from a given Wikipedia paragraph.Extract the answer span; version 2 adds unanswerable questions the model must decline.Exact match and F1 against the reference answers.
HELM (Holistic Evaluation of Language Models)Many things at once: accuracy, calibration, robustness, fairness, bias, toxicity and efficiency across dozens of scenarios.Stanford's framework that runs a model through a broad matrix of scenarios and metrics rather than one test.A profile of scores, not one number.
BIG-bench (Beyond the Imitation Game)Breadth and unusual abilities: over 200 tasks contributed by researchers, from logic puzzles to obscure translation.Diverse tasks, many designed to be beyond current models; BIG-bench Hard is the subset that still is.Per-task and aggregate scores.
TruthfulQAWhether the model repeats common human misconceptions and falsehoods.Several hundred questions on which people are often wrong (health myths, conspiracy claims, superstitions); scored on truthfulness and informativeness.Percentage of truthful answers.
HumanEvalCode generation.164 Python programming problems with hidden unit tests; the model writes the function body.pass@k: the share of problems solved by at least one of k samples (pass@1 is the usual quote).

Two more names are worth recognising. GSM8K tests multi-step arithmetic word problems and is the usual reasoning benchmark next to MMLU. And the Hugging Face Open LLM Leaderboard is not a benchmark but a table: it runs open models through a fixed set of benchmarks (MMLU, HellaSwag, TruthfulQA, GSM8K and others in its first version) with one harness so the numbers are comparable, and ranks them. Model cards on Bedrock and elsewhere quote benchmark scores; the leaderboard is where the same scores are compared across open models on equal terms.

In the wild
  • The Hugging Face Open LLM Leaderboard is the first place people look when a new open model is released; a jump in MMLU or GSM8K there is what a "state-of-the-art open model" claim usually means.
  • Model cards for Llama, Claude, Nova and others report MMLU, HumanEval, GSM8K and a few more alongside each release, which is why those names recur in every comparison.
  • SageMaker Clarify foundation model evaluation ships built-in data sets drawn from public benchmarks (BoolQ, TriviaQA, Natural Questions for question answering, for instance) so a team can run benchmark-style checks on their own candidate models.
Watch out
  • Contamination. Benchmarks are public, so their questions leak into pre-training corpora and a model can score well by memory. A benchmark score is a floor on suspicion, not a proof of ability.
  • Saturation. When frontier models all score above ninety percent on a benchmark it stops discriminating between them; GLUE was retired for SuperGLUE for this reason, and MMLU is heading the same way.
  • Benchmarks are not your task. A model that tops MMLU can still be the wrong choice for classifying your tickets in your taxonomy. Benchmarks shortlist; task evaluation decides.
Exam angle

The exam wants the names matched to what they measure: MMLU is broad knowledge across subjects, HellaSwag is common sense, GLUE and SuperGLUE are language understanding suites, SQuAD is reading comprehension question answering, HELM is holistic (many metrics including fairness and toxicity), BIG-bench is a very large diverse task set, TruthfulQA is truthfulness, HumanEval is code. "Compare several candidate models before choosing one" is benchmarks; "measure performance on the company's own task" is not.

benchmark
A fixed, public data set and scoring rule used to compare models on the same test.
pass@k
The code-generation score: the fraction of problems for which at least one of k generated solutions passes all the tests.
contamination
Benchmark questions appearing in a model's training data, which inflates its score without improving its ability.
leaderboard
A ranked table of models scored on a shared set of benchmarks with one harness; the Hugging Face Open LLM Leaderboard is the best known for open models.

Metrics: ROUGE, BLEU, BERTScore, perplexity, exact match and F1

An automatic metric turns a model output and a reference answer into a number without a human in the loop, and each of the standard ones measures a different notion of "close": ROUGE counts how much of the reference the output recalled, BLEU counts how much of the output is precise, BERTScore compares meaning through embeddings, perplexity measures how well the model predicts text, and exact match and F1 score short answers.

ROUGE: recall, for summaries

ROUGE (Recall-Oriented Understudy for Gisting Evaluation) asks: of the n-grams in the human-written reference, how many appear in the model's output? It is recall-oriented, so it rewards an output that covers what the reference covers, which is the right question for summarisation: did the summary keep the important content? ROUGE-1 counts single words, ROUGE-2 counts word pairs (so word order starts to matter), and ROUGE-L uses the longest common subsequence between output and reference, which credits words in the same order even if they are not adjacent. Implementations usually report precision and F1 as well, but recall is the headline.

BLEU: precision with a brevity penalty, for translation

BLEU (Bilingual Evaluation Understudy) asks the opposite: of the n-grams in the model's output, how many appear in the reference? It is precision-oriented, combines precision for 1-grams to 4-grams as a geometric mean, and multiplies by a brevity penalty so that a very short output cannot score well by containing only safe words. It was built for machine translation, where a translation should say what the source says and nothing more, and it is still the standard number there. Scores run from 0 to 1 (or 0 to 100); anything much above 0.4 on real translation is good.

BERTScore: meaning, not wording

BERTScore replaces exact word matching with embeddings: each token in the output and the reference is embedded with a BERT-style model, every output token is matched to its most similar reference token by cosine similarity, and the similarities are averaged into precision, recall and F1. "The firm's profits rose" and "The company's earnings increased" share no words and would score near zero on ROUGE or BLEU, but their embeddings are close and BERTScore says so. It is the metric to reach for when paraphrase is acceptable, at the cost of needing a model to compute it and being harder to explain.

A worked example

Reference : the cat sat on the mat            (6 words)
Candidate : the cat sat on a mat              (6 words)

Unigrams   matched: the, cat, sat, on, mat      = 5
  ROUGE-1 recall    = 5 / 6 reference unigrams  = 0.83
  BLEU-1 precision  = 5 / 6 candidate unigrams  = 0.83

Bigrams    reference: the-cat, cat-sat, sat-on, on-the, the-mat
           candidate: the-cat, cat-sat, sat-on, on-a,   a-mat
           matched  : the-cat, cat-sat, sat-on           = 3
  ROUGE-2 recall    = 3 / 5                     = 0.60
  BLEU-2 precision  = 3 / 5                     = 0.60

ROUGE-L    longest common subsequence: the cat sat on ... mat = 5
           recall = 5 / 6 = 0.83

Brevity penalty: candidate length 6 = reference length 6, so BP = 1.0

Now a candidate that games precision:
Candidate : the cat                           (2 words)
  BLEU-1 precision  = 2 / 2 = 1.00   but BP = exp(1 - 6/2) = 0.14, BLEU collapses
  ROUGE-1 recall    = 2 / 6 = 0.33   recall exposes the missing content
ROUGEBLEUBERTScore
OrientationRecall: how much of the reference did the output cover?Precision: how much of the output is in the reference? Times a brevity penalty.Semantic similarity: do the tokens mean the same thing?
Unit comparedn-grams (ROUGE-N) or longest common subsequence (ROUGE-L).n-grams, 1 to 4, geometric mean.Contextual token embeddings, cosine similarity.
Built forSummarisation.Machine translation.Any text generation where paraphrase is fine.
Blind spotRewards long outputs that mention everything; ignores synonyms.Punishes valid rephrasing; needs several references to be fair.Needs a model to compute; less interpretable; slower.
Exam keyword"Summarisation", "recall"."Translation", "precision", "brevity penalty"."Semantic similarity", "meaning", "embeddings".

The others

In the wild
  • Amazon Bedrock model evaluation in automatic mode scores a model on built-in task types (general text generation, summarisation, question answering, classification) with the metrics accuracy, robustness and toxicity, using built-in data sets (BOLD and RealToxicityPrompts for toxicity, Gigaword for summarisation, BoolQ, Natural Questions and TriviaQA for question answering, among others) or your own JSONL prompts.
  • SageMaker Clarify foundation model evaluation, backed by the open-source fmeval library, runs the same kind of checks on any model, on SageMaker or beyond: accuracy (with ROUGE, BLEU, exact match and F1 depending on task), factual knowledge, prompt stereotyping, toxicity and semantic robustness, with a report in SageMaker Studio.
  • News summarisation research has reported ROUGE on the CNN/Daily Mail data set for a decade, and machine translation shared tasks have reported BLEU for two, which is why those two pairings are fixed in the exam's mind.
Watch out

All the overlap metrics are relative to the reference. A model that produces a better summary than the human reference scores worse on ROUGE because it matches the reference less. Use them to track changes between versions of the same system and to catch regressions; use humans or a judge model to decide whether the output is good.

Exam angle

The pairings are the whole question: ROUGE, summarisation, recall; BLEU, translation, precision, brevity penalty; BERTScore, semantic similarity, embeddings; perplexity, how well the model predicts text, lower is better; exact match and F1, question answering; toxicity and robustness, Bedrock model evaluation and SageMaker Clarify. If a question says the reference and the output use different words for the same meaning, the metric that copes is BERTScore.

n-gram
A run of n consecutive words (or tokens): unigrams, bigrams, trigrams. Overlap metrics count how many n-grams two texts share.
brevity penalty
BLEU's multiplier, below 1 when the output is shorter than the reference, so a short output cannot score highly just by being precise.
longest common subsequence
The longest sequence of words that appears in both texts in the same order, not necessarily adjacent; the basis of ROUGE-L.
perplexity
The exponential of a model's average negative log-likelihood on a text; how many equally likely choices it was effectively facing per token. Lower is better.

Choosing an evaluation approach: automatic or human, and which metric for which task

The evaluation approach follows from the task: if there is a single correct answer, score it automatically with accuracy, exact match or F1; if there is a reference text, use the overlap metric built for that task; if there is neither, use people or a judge model; and in practice a serious evaluation layers all three, automatic metrics on every build and human review on a sample.

flowchart TD
  S["What does the task produce?"] --> Q1{Fixed answer?}
  Q1 -- "yes: a label or a span" --> E["Accuracy, exact match, F1<br/>classification, extractive QA"]
  Q1 -- no --> Q2{Reference texts?}
  Q2 -- no --> H["Human evaluation or judge model<br/>rubric or pairwise preference"]
  Q2 -- yes --> Q3{Which task?}
  Q3 -- summarisation --> R["ROUGE, recall<br/>plus BERTScore for paraphrase"]
  Q3 -- translation --> B["BLEU, precision<br/>with brevity penalty"]
  Q3 -- other --> BS["BERTScore<br/>meaning over wording"]
Figure 7. Picking the evaluation. Everything except the human branch can be scored by a machine in minutes (Bedrock model evaluation, SageMaker Clarify) and belongs in the build pipeline; the human or judge-model branch belongs before every release. Toxicity and robustness checks run on every branch.
Automatic metricsBenchmarksJudge modelHuman evaluation
NeedsReference answers for your prompts.Nothing of yours; public data sets.A rubric and a strong model.People, a rubric, time.
Speed and costSeconds, nearly free.Minutes to hours, compute only.Minutes, token cost.Days, the most expensive.
MeasuresCloseness to the reference.General abilities; regression after fine-tuning.Rubric adherence, approximating a person.What people actually think.
MissesParaphrase, quality beyond the reference.Your task entirely.Its own biases; it must be validated against humans.Scale; consistency.
On AWSBedrock model evaluation (automatic), SageMaker Clarify fmeval.Clarify built-in data sets; public harnesses on SageMaker.Bedrock LLM-as-a-judge.Bedrock human evaluation job; A2I in production.

The practical pattern is a pyramid. Every change to a prompt, model or fine-tuning set runs the automatic suite on a fixed test set of a few hundred of your own prompts with references, and fails the build on a regression. Every release candidate gets a judge-model pass over a larger sample and a human pass over a smaller one. Benchmarks run when the base model changes. And after launch, the business metrics of the next section take over.

In the wild
  • Amazon Bedrock model evaluation is one console for all three: automatic jobs with built-in or custom data sets, LLM-as-a-judge jobs, and human jobs with your team or an AWS-managed one, reporting into S3.
  • SageMaker Clarify foundation model evaluation is the SageMaker-side equivalent, with a UI in Studio for JumpStart models and the fmeval library for anything else, including models not hosted on AWS.
  • HELM is the academic version of the same layering: a fixed matrix of scenarios and metrics run identically over every model so the comparison is fair.
Exam angle

"Quickly and cheaply", "repeatable", "automated" is automatic evaluation with the metric that matches the task. "Subjective", "creative", "no reference answer" is human evaluation. "Compare foundation models before choosing" is benchmarks. When the question says "on AWS with the least effort", the managed answer is Bedrock model evaluation; when the model is on SageMaker or the question mentions bias and toxicity reports, it is SageMaker Clarify.

Meeting the business objective: productivity, engagement, cost, latency and A/B tests

A model that scores well on every metric above can still fail the project, because the objective was never "high ROUGE" but "agents resolve tickets faster" or "customers finish the checkout"; determining whether the model meets the business objective means naming that outcome, choosing the numbers that track it, and measuring them on real traffic with A/B tests and human feedback loops.

Outcome metrics

Operational metrics

How to measure them

A/B testing sends a slice of live traffic to the new model or prompt and the rest to the current one, and compares the outcome metrics with enough volume for the difference to be real. On AWS, a SageMaker endpoint can host several production variants with traffic weights, and Bedrock applications route in the application layer or with Bedrock Prompt Management versions. Human feedback loops close the circle: thumbs down, edits to a draft, escalations to a person and Amazon A2I reviews are collected, labelled and fed back both as the next evaluation set and as the next fine-tuning set, so the system improves on exactly the cases it got wrong. After launch, monitoring for drift (a change in the inputs, a fall in acceptance rate) tells you when to run the loop again.

flowchart TD
  O["Business objective<br/>fewer escalations, faster drafts, more conversions"] --> K["Choose the numbers<br/>task accuracy, cost per request, p95 latency, engagement"]
  K --> T["A/B test<br/>new model or prompt on a slice of live traffic"]
  T --> Q{Better?}
  Q -- yes --> R["Roll out and keep monitoring for drift"]
  Q -- no --> I["Iterate: prompt, RAG, fine-tune, other model"]
  I --> T
  R --> F["Human feedback loop<br/>thumbs, edits, A2I reviews become eval and training data"]
  F --> K
Figure 8. The business loop. Model metrics decide what is worth testing; only the outcome numbers on live traffic decide what ships, and the feedback they generate is the next round's data.
In the wild
  • Customer-support deployments report deflection rate (questions answered without a human), handle time and customer satisfaction scores, not ROUGE; Amazon Connect with Amazon Q in Connect is the AWS shape of this.
  • Coding assistants such as Amazon Q Developer and GitHub Copilot are judged on suggestion acceptance rate and time to complete a task in controlled studies, an engagement metric and a productivity metric respectively.
  • Amazon SageMaker endpoints host production variants with traffic splitting, the built-in mechanism for A/B testing a fine-tuned model against its predecessor; Amazon CloudWatch carries the latency and invocation metrics for both.
Watch out

Improving a proxy is not improving the outcome. Higher thumbs-up rates can mean a more flattering model, not a more useful one; a faster model can be faster because it answers less. Tie every proxy to the outcome it is supposed to predict and check the link from time to time with a human review.

Exam angle

When a question asks how to tell whether an FM "meets business objectives" the answer is business metrics, productivity, user engagement, task success, cost, latency, measured on real use, often through A/B testing and user feedback, not benchmark scores. "Which metric shows the model is helping employees?" is productivity; "whether users keep using the feature" is engagement; "the cost of running the model" is cost per request or per token; "compare two versions on live traffic" is A/B testing.

A/B test
Splitting live traffic between two versions and comparing their outcome metrics, so that the better one is chosen on evidence from real use.
task engineering
Shaping the business task so that a model can perform it and a metric can measure it; the definition work that precedes prompt or model work.
production variant
One of several models behind a single SageMaker endpoint, each receiving a configured share of traffic; the SageMaker mechanism for A/B tests.
feedback loop
Collecting user reactions and human corrections to model outputs and feeding them back as evaluation and training data.

Recap

  • Pre-training is self-supervised next-token prediction on trillions of unlabelled tokens; it costs thousands of accelerators for weeks and is done by model providers. Its output is a base model with a knowledge cut-off.
  • Fine-tuning is supervised training on labelled prompt and completion pairs; it teaches behaviour, format and domain style, not fresh facts. Instruction tuning is fine-tuning on instruction and response pairs; both are transfer learning.
  • Continued (continuous) pre-training runs the self-supervised objective on unlabelled domain text to teach vocabulary and knowledge. Keyword: unlabelled. BloombergGPT is the example.
  • Full fine-tuning updates every weight; PEFT (LoRA, adapters) freezes the base and trains a small addition, cutting training cost and forgetting but not serving cost.
  • RLHF: collect human preference rankings, train a reward model, optimise the policy with PPO under a KL penalty. RLAIF uses a model as the rater. Purpose: alignment, helpful and harmless.
  • Data preparation is governance: representative, deduplicated, PII-free (Comprehend, Macie), consistently labelled (Ground Truth, Mechanical Turk), split into train and validation, provenance recorded. Format for Bedrock: JSONL prompt and completion pairs in S3.
  • Catastrophic forgetting and overfitting are the training risks; validation loss and before-and-after benchmarks catch them.
  • Bedrock customisation is the managed path (fine-tuning and continued pre-training jobs, custom model hosted on Provisioned Throughput); JumpStart fine-tunes open models with prepared scripts; SageMaker training jobs run anything.
  • Human evaluation, with rubrics or pairwise preference, is the gold standard for open-ended tasks; Bedrock human evaluation jobs use your team or an AWS-managed one; LLM-as-a-judge is the cheaper approximation.
  • Benchmarks: MMLU knowledge, HellaSwag common sense, GLUE and SuperGLUE understanding, SQuAD reading comprehension, HELM holistic, BIG-bench breadth, TruthfulQA truthfulness, HumanEval code. The Hugging Face Open LLM Leaderboard compares open models on them.
  • ROUGE is recall for summarisation (ROUGE-N, ROUGE-L); BLEU is precision with a brevity penalty for translation; BERTScore is embedding similarity for meaning; perplexity is prediction quality, lower is better; exact match and F1 score question answering; toxicity and robustness are safety metrics.
  • Bedrock model evaluation and SageMaker Clarify foundation model evaluation (fmeval) run the automatic metrics on AWS.
  • Whether the model meets the business objective is measured on real traffic with productivity, engagement, task accuracy, cost per request and latency, through A/B tests and human feedback loops, not with benchmark scores.

Questions

Say the answer out loud before opening it. Conceptual questions and exam-style scenarios are mixed.

What are the three stages that turn raw text into an assistant model, and what data does each use?

Pre-training on trillions of unlabelled tokens with self-supervised next-token prediction, supervised fine-tuning (instruction tuning) on labelled prompt and completion pairs, and RLHF on human preference rankings between candidate answers.

  • Pre-training produces a base model that completes text but does not follow instructions; it is the expensive stage and only providers do it.
  • Fine-tuning shifts the weights a little towards the examples and produces an instruct or chat model.
  • RLHF trains a reward model on the rankings and optimises the policy against it, for helpfulness and harmlessness.

Continued pre-training is the optional step between the first two: more self-supervised training on unlabelled domain text.

Why is pre-training called self-supervised, and why does its cost make it a provider's job rather than a customer's?

Because the label is manufactured from the data itself, the next token of the text, so no human labelling is needed; and because it takes thousands of accelerators for weeks over trillions of tokens, a cost measured in tens of millions of dollars that only a model provider recovers.

  • Decoder models predict the next token; encoder models such as BERT predict masked tokens.
  • The corpus is filtered, deduplicated and weighted; whatever it held on the freeze date is the knowledge cut-off.
  • For a business the decision is which foundation model to start from, never whether to pre-train.

The exam's cost ladder runs pre-training, then continued pre-training, then fine-tuning, then RAG, then prompt engineering, from most to least expensive.

A company has a large archive of unlabelled industry documents and finds the model misunderstands its terminology. Which customisation method fits, and why not fine-tuning?

Continued pre-training: it runs the self-supervised objective on the unlabelled documents so the model learns the domain's vocabulary and knowledge, whereas fine-tuning needs labelled prompt and completion pairs the company does not have.

  • The distinguishing word is "unlabelled"; "labelled examples" would make it fine-tuning.
  • On Bedrock it is a continued pre-training job over JSONL lines with an input field, available for Titan Text models.
  • If the documents changed often the answer would be RAG, because weights freeze the facts at training time.

BloombergGPT is the classic example: about half its training tokens were Bloomberg's own financial text.

What is the difference between instruction tuning, domain adaptation and transfer learning?

Instruction tuning is fine-tuning on instruction and response pairs so the model follows instructions and formats; domain adaptation is any method that makes a general model good in one field; transfer learning is the principle underneath both, reusing knowledge learned on one task as the starting point for another.

  • Instruction tuning is what turns a base model into an "instruct" or "chat" model.
  • Domain adaptation can be done with labelled pairs (fine-tuning), unlabelled text (continued pre-training) or retrieval (RAG).
  • Transfer learning explains why a few thousand examples suffice: grammar, world knowledge and reasoning transfer, only the task is new.

The exam guide lists instruction tuning, domain adaptation, transfer learning and continuous pre-training together as "methods for fine-tuning".

Explain LoRA and when a team would choose it over full fine-tuning.

LoRA freezes the pre-trained weights and trains two small low-rank matrices beside each large weight matrix, whose product is added to the frozen weight; a team chooses it when it wants to adapt a large model with limited compute, keep one base model shared across many tasks, or reduce the risk of catastrophic forgetting.

  • Trainable parameters are typically well under one percent of the model; the adapter is megabytes.
  • The product can be merged into the base weight after training, so serving costs nothing extra.
  • Full fine-tuning updates all weights, needs memory for gradients and optimiser state and produces a full model copy per task.

PEFT lowers training cost, not serving cost; a cheaper model in production comes from a smaller base, distillation or quantisation.

Walk through RLHF and say what a reward model is for.

Start from a supervised fine-tuned model, sample several answers per prompt and have humans rank them, train a reward model to reproduce those rankings as a score, then optimise the language model as a policy with reinforcement learning (PPO) to maximise that score under a KL penalty that keeps it near the SFT model; the reward model exists so that human judgement can be applied millions of times without humans.

  • People are better at comparing two answers than at writing a perfect one, which is why preferences are the data.
  • The KL penalty and a mixed-in pre-training loss limit reward hacking and forgetting.
  • RLAIF swaps the human raters for a model guided by written principles, as in Anthropic's Constitutional AI; DPO skips the reward model entirely.

InstructGPT showed a 1.3-billion-parameter RLHF model being preferred over the 175-billion-parameter GPT-3 base model.

Which AWS service collects the human rankings that RLHF needs, and which workforces can do the work?

Amazon SageMaker Ground Truth, using a ranking or comparison task template; the workers can be a private workforce of company staff, a vendor workforce from AWS Marketplace, or the public Amazon Mechanical Turk crowd.

  • Ground Truth consolidates several workers' answers per item and measures agreement.
  • Ground Truth Plus is the fully managed version where AWS runs the workforce.
  • Mechanical Turk suits tasks without confidential data; private teams handle sensitive material.

Bedrock customisation itself offers only fine-tuning and continued pre-training; an RLHF pipeline runs on SageMaker.

What must a fine-tuning data set look like for Amazon Bedrock, and what preparation steps come before formatting?

A JSON Lines file in S3 with one prompt and completion pair per line (plus an optional validation file), preceded by curating representative real examples, labelling them consistently, deduplicating, removing PII, checking licences and consent, splitting off validation data and recording provenance.

  • Amazon Comprehend detects and redacts PII in text; Amazon Macie finds sensitive data in S3.
  • Ground Truth manages the labelling workflow and worker agreement.
  • A few thousand high-quality pairs beat a hundred thousand noisy ones; the model imitates the data's mistakes too.

SageMaker training jobs take the same data as named channels, conventionally train and validation, each an S3 prefix mounted into the container.

What is catastrophic forgetting, how would you detect it, and how do you reduce it?

The loss of general abilities when a model is trained hard on a narrow task; detect it by running the same benchmarks or a general test set before and after fine-tuning; reduce it with a low learning rate, few epochs, a mixed data set that includes general examples, and parameter-efficient methods that leave the base weights frozen.

  • Validation loss rising while training loss falls is the related overfitting signal.
  • RLHF mixes some pre-training loss back in for the same reason.
  • A ticket classifier that can no longer summarise is the typical symptom.

LoRA's frozen base is one reason it forgets less than full fine-tuning.

A team fine-tuned a Titan model on Bedrock and cannot call it on demand like the base model. Why, and what do they need?

Because a custom model is a private copy of the weights that has to be loaded onto dedicated capacity, so the exam's answer is that it must be hosted with Provisioned Throughput, bought as model units for a term.

  • Base models are billed on demand per token; custom models need capacity reserved for them.
  • Terms are no commitment, one month or six months; longer terms cost less per hour.
  • The custom model stays in the account, encrypted, and is invoked with the same InvokeModel or Converse API.

AWS has since added on-demand inference for some custom models, but "custom model implies Provisioned Throughput" is the fact the exam tests.

Compare Bedrock customisation, SageMaker JumpStart fine-tuning and a SageMaker training job. Which does a question with "least operational overhead" want?

Bedrock customisation is a managed job with no visible infrastructure for Bedrock models that support it; JumpStart fine-tunes open hub models with a prepared, usually LoRA-based script on an instance you choose; a training job runs any script in any container with full control; "least operational overhead" is Bedrock.

  • "Open-source model" or "pre-built solution" points at JumpStart.
  • "Custom training script", "specific framework", "distributed training" points at a training job, possibly on Trainium.
  • Bedrock hosts the result on Provisioned Throughput; SageMaker hosts it on an endpoint.

Ground Truth and Mechanical Turk supply the labelled data for all three.

When is human evaluation the right approach, and how does Amazon Bedrock support it?

When the task has no single correct answer, tone, creativity, helpfulness, brand voice, so overlap metrics cannot judge it; Bedrock model evaluation runs human evaluation jobs on your own prompt data set with either your own private work team or an AWS-managed team, using rating methods such as thumbs up or down, Likert scales and pairwise choice.

  • Rubrics define criteria and score levels so raters agree; measure inter-rater agreement.
  • Pairwise preference is more reliable than absolute scoring and doubles as RLHF data.
  • LLM-as-a-judge is the cheaper approximation when people are too slow or costly.

Chatbot Arena's Elo-style ranking is pairwise preference at internet scale.

Match MMLU, HellaSwag, SQuAD, HELM, TruthfulQA and HumanEval to what they measure.

MMLU is broad knowledge across 57 subjects by multiple choice; HellaSwag is common-sense continuation of everyday scenarios; SQuAD is reading comprehension scored by exact match and F1; HELM is a holistic matrix of many scenarios and metrics including fairness and toxicity; TruthfulQA is whether the model repeats common falsehoods; HumanEval is code generation scored by pass@k.

  • GLUE and SuperGLUE are natural language understanding suites; SuperGLUE replaced GLUE when models saturated it.
  • BIG-bench is a very large, diverse task collection; GSM8K is arithmetic word problems.
  • The Hugging Face Open LLM Leaderboard ranks open models on a fixed set of these with one harness.

Benchmarks shortlist a base model and reveal forgetting after fine-tuning; they do not measure your task.

Contrast ROUGE, BLEU and BERTScore: orientation, task, and blind spot.

ROUGE is recall-oriented n-gram overlap (ROUGE-N) or longest common subsequence (ROUGE-L) for summarisation, and ignores synonyms; BLEU is precision-oriented n-gram overlap with a brevity penalty for translation, and punishes valid rephrasing; BERTScore matches token embeddings by cosine similarity to measure meaning, and needs a model to compute and is less interpretable.

  • ROUGE asks how much of the reference the output covered; BLEU asks how much of the output is in the reference.
  • The brevity penalty stops a two-word output scoring perfect precision.
  • All three are relative to a reference: an output better than the reference scores worse.

For "the cat sat on a mat" against "the cat sat on the mat", ROUGE-1 and BLEU-1 both give 5 out of 6; the metrics diverge when lengths differ or words are paraphrased.

What does perplexity measure, and what is it not telling you?

How well a language model predicts a text, as the exponential of its average negative log-likelihood per token, lower being better; it says nothing about whether the model's answers are correct, helpful or safe.

  • A perplexity of 10 means the model was as uncertain as a uniform choice among 10 tokens.
  • It needs only text, no references, so it is the metric for pre-training and continued pre-training.
  • Exact match and F1 are the question-answering counterparts that do need reference answers.

A model can have low perplexity on a domain corpus and still fail the business task, which is why perplexity never appears alone in an evaluation.

Which AWS tools run automatic model evaluation, and what metrics do they report?

Amazon Bedrock model evaluation in automatic mode and SageMaker Clarify foundation model evaluation (the fmeval library); both score task types such as summarisation, question answering, classification and open generation with accuracy-style metrics (ROUGE, BLEU, exact match, F1 depending on task), robustness and toxicity, and Clarify adds factual knowledge and prompt stereotyping.

  • Both accept built-in public data sets or your own JSONL prompts.
  • Bedrock's console also runs LLM-as-a-judge and human evaluation jobs.
  • Clarify works for JumpStart models in Studio and, through fmeval, for models hosted anywhere.

Robustness is measured by perturbing the prompt (typos, case, whitespace) and checking whether the answer holds.

A model scores well on benchmarks and ROUGE, yet the business is unsure the project worked. How do you determine whether it meets the business objective?

Name the outcome the project was for and measure it on real traffic: productivity (time saved, tickets resolved), user engagement (adoption, retention, acceptance rate), accuracy on the actual business task, cost per request and latency at the percentiles users feel, using A/B tests to compare versions and human feedback loops to keep improving.

  • Task engineering, defining the task narrowly enough to measure, comes first.
  • SageMaker production variants split traffic for A/B tests; CloudWatch carries latency and invocation metrics.
  • Thumbs down, edits and A2I reviews become the next evaluation and fine-tuning sets.

Beware proxies: a rising thumbs-up rate can mean a more flattering model, so check the proxy against the outcome with periodic human review.