How AI models are trained: supervised, unsupervised, reinforcement, transfer learning, and more
A plain-English guide to how AI and ML models are trained - the learning paradigms (supervised, unsupervised, semi-supervised, self-supervised, reinforcement), how foundation models are adapted (prompting, RAG, fine-tuning, transfer learning), plus evaluation, overfitting, and the concepts foundational AI exams like AIF-C01 test.
Ask ten people "how is an AI model trained?" and you get ten different answers, because there is no single method. The right one depends on two questions: what data do you have, and are you building a model from scratch or adapting one that already exists? Get those two straight and the whole zoo of terms - supervised, unsupervised, reinforcement, transfer learning, fine-tuning, RAG, RLHF - snaps into a simple map.
This guide walks that map end to end. It is provider-neutral (the concepts are the same on AWS, Azure, Google Cloud, and everywhere else), but it is written with the foundational AI certifications in mind - the AWS AI Practitioner (AIF-C01), Azure AI Fundamentals, Google Cloud Generative AI Leader, and their peers all test exactly these ideas. Where an exam leans on a concept in a particular way, there is an "On the exam" note. It is long; treat it as a reference you scan by section.
The two questions that organize everything
There are two different senses of "training" people blur together:
- How a model learns from data - the learning paradigm. This is about the shape of your data (labeled? unlabeled? a reward signal?) and it decides which family of algorithms applies. Supervised, unsupervised, semi-supervised, self-supervised, and reinforcement learning live here.
- How you adapt an existing model - the customization ladder. Modern AI rarely starts from zero. You take a pre-trained foundation model and adapt it, from a cheap prompt tweak up to expensive retraining. Prompt engineering, RAG, fine-tuning, and continued pre-training live here.
Keep the two senses separate. The first is "what kind of learning problem is this?" The second is "given a model that already exists, how much do I change it?" Most exam questions are really asking which box a scenario falls into.
Part 1: The learning paradigms
Supervised learning
What. The model learns from labeled examples - input paired with the correct answer. You show it thousands of emails tagged spam or not-spam, and it learns the mapping from email to label.
Why. When you have labeled data and a clear target to predict, this is the most direct and accurate approach. It powers most classic ML in production.
How. Two sub-types by what you predict:
- Classification - predict a category (spam or not, which of 20 disease types, fraud or legitimate).
- Regression - predict a continuous number (house price, tomorrow's demand, expected revenue).
You split your labeled data, train the model to minimize error against the known answers, and measure how well it predicts held-out examples.
On the exam. The trigger phrase is "labeled data." If a scenario hands you inputs with known correct outputs and asks you to predict a category or a value, it is supervised learning. Classification vs regression is decided by whether the answer is a class or a number.
Unsupervised learning
What. The model learns from unlabeled data - no correct answers provided. It finds structure on its own.
Why. Most real-world data is unlabeled, and labeling is expensive. When you want to discover patterns rather than predict a known target, this is the tool.
How. The main jobs:
- Clustering - group similar items (customer segmentation, grouping documents by topic).
- Dimensionality reduction - compress many features into a few while keeping the signal (for visualization or to speed up downstream models).
- Anomaly detection - flag points that do not fit the learned pattern (fraud, intrusion, defective parts).
On the exam. The trigger is "unlabeled data" plus a goal like "segment," "group," or "find unusual." Clustering for customer segmentation is the single most common unsupervised example you will see.
Semi-supervised learning
What. A middle ground: a small amount of labeled data plus a large pool of unlabeled data.
Why. Labeling is costly; often you can only afford to label a fraction. Semi-supervised learning uses the few labels to guide learning over the much larger unlabeled set, getting better results than labels alone would allow.
How. Typical pattern: train on the labeled subset, use that model to label the unlabeled data (pseudo-labeling), then retrain on the combined set. It reduces annotation cost and can improve generalization.
Self-supervised learning
What. The model creates its own labels from the raw data, so no human labeling is needed. The classic example: hide the next word in a sentence and train the model to predict it.
Why. This is how modern foundation models and large language models are pre-trained. There is far more raw text, image, and code on the internet than anyone could ever label, and next-token (or masked-token) prediction turns all of it into training signal.
How. The model is trained to fill in or predict parts of its own input over enormous datasets. The result is a base model with broad general knowledge - fluent, but not yet aligned to follow instructions or match human preferences.
On the exam. You may not see "self-supervised" named often, but you must know that a foundation model is a large model pre-trained on massive, mostly unlabeled data, and that this pre-training is what makes it adaptable to many downstream tasks.
Reinforcement learning (and RLHF)
What. An agent learns by interacting with an environment: it takes an action, gets a reward or penalty, and adjusts to maximize long-term reward. There is no labeled answer key - only feedback on how good an action was.
Why. It fits sequential decision problems where the "right" move is not known in advance: game playing, robotics, recommendation, control systems.
How. The agent observes a state, chooses an action, receives a reward, moves to a new state, and repeats - gradually learning a policy (a strategy) that earns the most reward over time.
RLHF (reinforcement learning from human feedback) is the celebrity application. After a language model is pre-trained, humans rank its outputs; those rankings train a reward model; then reinforcement learning tunes the language model to produce outputs the reward model scores highly. This is a major reason modern chat assistants are helpful and aligned rather than just fluent.
On the exam. The trigger is "learns from feedback / rewards / trial and error." A chatbot that improves by being rewarded for good responses is reinforcement learning. Know that RLHF is how LLMs are aligned to human preferences.
Part 2: The ML lifecycle
Training is one step in a loop, not the whole thing. The standard lifecycle:
- Frame the problem - what are you predicting, and is ML even the right tool? (Sometimes a simple rule beats a model.)
- Collect and prepare data - gather, clean, and label if needed.
- Exploratory data analysis (EDA) - inspect distributions, correlations, and quality before modeling.
- Feature engineering - use domain knowledge to create or transform input variables that make patterns easier to learn.
- Train - fit the model on the training data.
- Evaluate - measure performance on data the model has not seen.
- Deploy - serve the model for predictions (this is called inference).
- Monitor - watch for drift and degradation, and retrain when needed.
Train, validation, and test split. You never judge a model on the data it trained on. Split the data: the training set fits the model, the validation set tunes settings and compares candidates, and the test set gives a final, honest estimate on data used nowhere else. A common split is something like 80/20, with the training portion split again for validation.
On the exam. Know that inference is using a trained model on new data (as opposed to training), and that feature engineering means creating better inputs from raw data using domain knowledge.
Part 3: Fitting and generalization
The whole game is generalization - doing well on new data, not just the training data.
- Overfitting - the model memorizes the training data (including its noise) and fails on new data. Symptom: high training accuracy, poor production accuracy; or accuracy that improves then degrades as you train longer. Fixes: more (and more varied) training data, regularization, early stopping, dropout, or a simpler model.
- Underfitting - the model is too simple to capture the pattern and does poorly even on training data. Fix: a more capable model, better features, or more training.
- Bias-variance tradeoff - bias is error from an over-simple model (underfitting); variance is error from an over-complex one (overfitting). More complexity lowers bias but raises variance. The art is balancing the two.
On the exam. "Great on training data, bad in production" is the signature of overfitting; the expected answers are more data, regularization, or early stopping. Do not confuse it with underfitting (bad everywhere).
Part 4: How you measure a model
You cannot improve what you cannot measure, and the right metric depends on the task.
Classification metrics.
- Accuracy - fraction of predictions that are correct. Fine when classes are balanced; misleading when they are not.
- Confusion matrix - the full table of true positives, false positives, true negatives, and false negatives. Everything else is derived from it.
- Precision - of the items you flagged positive, how many really were. (Punishes false positives.)
- Recall (sensitivity) - of the truly positive items, how many you caught. (Punishes false negatives.)
- F1 score - the harmonic mean of precision and recall, one number balancing both.
- AUC (area under the ROC curve) - threshold-independent measure of how well the model separates classes.
Regression metrics.
- RMSE (root mean squared error) and MAE (mean absolute error) - how far predictions land from the true numbers.
Generative and language metrics.
- BLEU - translation quality against human references.
- ROUGE - summarization quality (overlap with reference summaries).
- BERTScore - semantic similarity to a reference using embeddings.
- Human evaluation - still the gold standard for open-ended generative output.
On the exam. Business cost picks the metric. When a miss is far more costly than a false alarm (fraud, disease screening), optimize for recall. Accuracy is the default for balanced classification; a confusion matrix when you want the full breakdown; BLEU/ROUGE for translation/summarization.
Part 5: Hyperparameters and training dynamics
Hyperparameters are the settings you choose before training (as opposed to the weights the model learns). Key ones:
- Epochs - how many times the model passes over the training data. Too few underfits; too many overfits.
- Learning rate - how big a step the model takes when it updates. Too high and it never settles; too low and it crawls.
- Batch size - how many examples per update.
Hyperparameter tuning is the search for the best combination; it is often automated (for example by AutoML tools).
Do not confuse training hyperparameters with inference-time settings on generative models:
- Temperature - low (near 0) gives deterministic, repeatable output; high gives creative, varied output.
- Top-p / top-k - limit which candidate tokens the model may sample from.
On the exam. "Make the model's answers more consistent/repeatable" means lower the temperature. "Improve accuracy by training more" points to more epochs (with overfitting as the caveat).
Part 6: Adapting foundation models - the customization ladder
You rarely train a large model from scratch. You take a pre-trained foundation model and adapt it. The methods, ordered from cheapest and fastest to most expensive, are the single most exam-relevant idea in this whole guide.
Transfer learning (the umbrella idea)
What. Reuse knowledge a model learned on one task to do a related task. Instead of starting from random weights, you start from a model that already understands language or images.
Why. It slashes the data and compute you need. This is the principle underneath almost everything below - fine-tuning is one specific way to do transfer learning.
On the exam. "Adapt a pre-trained model for a new task instead of building from scratch" is transfer learning, and its benefit is less data, less time, less cost.
Rung 1: Prompt engineering
What. Change the instructions you give the model, not the model itself. Nothing is retrained.
How. Techniques:
- Zero-shot - just ask, with no examples.
- One-shot / few-shot (in-context learning) - include a few worked examples in the prompt so the model infers the pattern. This adapts behavior with zero parameter updates.
- Chain-of-thought - ask the model to reason step by step for harder problems.
- Prompt templates - standardized, reusable prompt structures.
Why. Cheapest, fastest, no infrastructure. Always try this first.
On the exam. Few-shot learning and in-context learning are the same idea: examples in the prompt, no retraining. Zero-shot risks poor results when the task is far from what the model saw in training.
Rung 2: Retrieval-augmented generation (RAG)
What. Fetch relevant facts from your own data at query time and add them to the prompt, so the model answers from current, private, or authoritative information it was never trained on.
How. Convert your documents into embeddings (numeric vectors capturing meaning), store them in a vector database, retrieve the closest chunks to the user's question, and feed them to the model alongside the question.
Why. It grounds answers in your data and dramatically reduces hallucination, without any retraining. Ideal when your knowledge changes often - you update the documents, not the model.
On the exam. "Ground the model in company data / reduce hallucination / keep answers current without retraining" is RAG. Embeddings are the numeric representations that make retrieval work.
Rung 3: Fine-tuning
What. Continue training the model on your own labeled examples so it internalizes a task or style.
How. Provide labeled data - typically prompt-and-completion pairs. Instruction fine-tuning uses input-output pairs formatted as instructions; domain adaptation teaches specialized behavior (for example, handling scientific or legal terminology). Parameter-efficient fine-tuning (PEFT), such as LoRA, updates only a small slice of the model's parameters, cutting cost while keeping most of the model frozen.
Why. When prompting and RAG are not enough and you need the model to reliably behave a certain way. It costs more (data, compute) than the rungs above.
On the exam. Fine-tuning needs labeled data (prompt-completion pairs). Use it for consistent task behavior or domain adaptation; it changes the model, whereas RAG leaves the model alone and supplies context at query time.
Rung 4: Continued pre-training
What. Keep pre-training the base model on a large body of unlabeled domain text.
Why. To teach the model the vocabulary and concepts of a specialized field (medical, legal, scientific) at scale, or to keep it current as data evolves. More expensive than fine-tuning.
On the exam. Continued pre-training uses lots of unlabeled domain text for vocabulary and concept mastery; instruction fine-tuning uses labeled instruction pairs for task behavior. Different data, different goal.
The cost ladder, in one line
Prompt engineering (cheapest, no retraining) -> RAG (add your data at query time) -> fine-tuning (retrain on labeled examples) -> continued pre-training (retrain on unlabeled domain text) -> full pre-training from scratch (rare, most expensive). Climb only as high as the problem demands.
Part 7: Making models smaller and faster
Once a model works, you often need it cheaper or lower-latency:
- Knowledge distillation - train a small "student" model to mimic a large "teacher," keeping most of the quality at a fraction of the size.
- Quantization - store weights at lower numeric precision (for example 8-bit instead of 32-bit) to shrink and speed up the model.
- Pruning - remove weights or structures that contribute little.
Part 8: Architectures, briefly
The paradigms above are how models learn; architectures are what the model is built from. You should recognize the names:
- Neural networks / deep learning - layered networks that learn hierarchical features; the basis of modern AI.
- CNNs - specialized for images.
- RNNs - built for sequences (largely superseded by transformers).
- Transformers - the architecture behind modern LLMs; the "GPT" in generative pre-trained transformer and models like BERT.
- GANs - two networks competing to generate realistic synthetic data.
- Diffusion models - generate images by learning to reverse a noising process.
You do not need to implement these for a foundational exam, but you should know, for example, that transformers power LLMs and GANs generate synthetic data.
The 30-second decision guide
- Labeled data, predict a category or number -> supervised learning (classification or regression)
- Unlabeled data, find groups or oddities -> unsupervised learning (clustering, anomaly detection)
- A few labels plus lots of unlabeled data -> semi-supervised learning
- Model creates its own labels from raw data (how foundation models pre-train) -> self-supervised learning
- Agent learns from rewards / feedback -> reinforcement learning; aligning an LLM to human preference -> RLHF
- Reuse a pre-trained model for a related task -> transfer learning
- Adapt a foundation model, cheapest first -> prompt engineering, then RAG, then fine-tuning, then continued pre-training
- Ground answers in your own current data, no retraining -> RAG
- Great on training data, bad in production -> overfitting (more data, regularization, early stopping)
- Missing a positive is very costly (fraud) -> optimize recall
- Make generative output more consistent -> lower the temperature
Related certifications
These learning-method fundamentals are core to every foundational AI exam - this guide appears under Related Study Guides on each of their hubs:
- AWS Certified AI Practitioner (AIF-C01) - the exam this guide is tuned to; Domains 1-3 lean heavily on these concepts.
- AWS Certified Machine Learning Engineer Associate (MLA-C01) - goes deeper on the lifecycle, training, and evaluation.
- Microsoft Azure AI Fundamentals (AI-900 / AI-901) - tests the same learning paradigms and ML basics.
- Google Cloud Generative AI Leader - foundation models, prompting, and adaptation.
- NVIDIA-Certified Associate: Generative AI and LLMs (NCA-GENL) - LLM training and adaptation.
- IBM watsonx Generative AI Engineer Associate - generative AI foundations.
- Claude Certified Architect - Foundations (CCA-F) - foundation-model concepts.
How to study this
For a foundational exam, do not memorize algorithms - practice classification. Read each scenario and ask the two organizing questions: what data do I have (labeled, unlabeled, reward), and am I building or adapting? That routes you to the right paradigm or the right rung of the customization ladder in seconds. Run practice questions with the 30-second decision guide open, and when you miss one, come back to that section here until the boundary is crisp. The concepts that separate people who pass are the ones with fuzzy edges: supervised vs unsupervised, fine-tuning vs RAG, overfitting vs underfitting, and the cost order of the customization ladder.
Source: the AWS Certified AI Practitioner (AIF-C01) exam guide and question domains, and standard machine-learning references, as of September 2026.