Skip to content
AI 知识地图 0.18 · 2026-07-30
关于与纠错文字目录 / Search
Understanding the principles

Supervised Learning

Learn from “input + target” samples and make reliable predictions on unseen data.

Supervised Learning · supervised learning

Recommended 25–35 minutes · Basic · Requires: basic concepts of functions and vectors.

Core idea Supervised learning learns a function from input to output from a large number of “input + target value (label)” samples, and the real goal is not to memorize the training set but to remain reliable on unseen data from the target scenario. Labels are the supervision signal used during training; they may be close to the true target, or may contain noise, disagreement, or proxy bias.
After reading this page, you should be able to answer these yourself:
  • What it is—where “supervision” actually comes from, and why labels do not necessarily equal absolute truth.
  • Two types of tasks—the difference between classification and regression, and what their answers look like.
  • What learning actually learns—abstractly, what training is actually doing.
  • Success criteria—why “getting everything right on the training set” does not count as success.
  • Its weakness—how the labeling bottleneck gave rise to unsupervised and self-supervised learning.
  • Its place today—why, in the era of large models, we still cannot do without it.
The minimal example used throughout this page teach the model to recognizespam email: each sample is an email (input), paired with a human-labeled answer (label: spam / normal). Show it tens of thousands of such labeled emails, and it should learn to givenewemails a judgment of whether they are spam. The whole page revolves around it.

1What Is Supervised LearningIntuition

This section answers: To make a machine “learn” something, what is the most direct approach?

The most direct approach is somewhat similar to using worked examples to teach people to generalize rules: give the model manyinputs and corresponding targets, and make the predictions gradually approach these targets. The recorded target value here is calledlabel; “supervised” means that during training each input has a comparable target signal, not that there is a teacher watching in real time.

Therefore, supervised learning can be understood asusing “input–target” examples to learn a prediction rule. It aims to solve: given a new email not seen during training, how to make a checkable judgment based on past examples. During training, theinputis the email content and the corresponding label,outputis a model that can produce categorical or numerical predictions for new emails.

ElementIn the spam email example
Input x (feature)the content of an email
Label y (training target)the “spam” or “normal” recorded in the data
Training settens of thousands of “email → label” examples
Goallearn a rule so that, fornew emails that have not been labeledit can also classify accurately
Labels are not the truth Emails may be mislabeled, annotators may disagree, and business logs may record only a proxy target. The model will learn the patterns in these signals, and it will also learn the errors and biases in them.
The key is in the last row The value of supervised learning is not to memorize the emails it has seen, but togeneralize to emails it has not seen. This point runs throughout the page; Section 4 will discuss it specifically.

Its basic process is to first have the model predict the training examples, then compare the predictions with the labels, and then adjust the rule based on the error and repeat. When the model gives a “spam probability of 0.8” for a new email, it means that under the current rule it leans toward the spam category; this does not prove that the label is absolutely correct, nor can it guarantee that it will remain reliable when the source of emails changes.

2Two Types of Tasks: Classification and RegressionIntuitionMath

The labels in the previous section were “spam/normal.” But answers are not always this kind of “choose one of several.” What the answer looks like divides Supervised Learning into two major categories.

TaskWhat the answer isExamples
ClassificationDiscrete categories (choose one of several)spam/normal, cat/dog/bird, positive/negative reviews
RegressionContinuous numerical valuesHouse prices, tomorrow’s temperature, product sales
Classification: draw a dividing line Regression: fit a line

Scroll horizontally to view the full diagram on small screens.

Figure 1 Similarly, “predicting output from input,” classification learns aboundary, and regression learns atrend line. Whether the answer is discrete or continuous determines which type to use and which loss to pair with.

Classification and regression describethe two basic forms of Supervised Learning output, used to avoid mixing up categories, probabilities, and continuous numerical values.

Given sample features and training targets, classification outputs a class or probabilities for each class, and regression outputs a continuous numerical value. During training, both first produce predictions, then use a task-appropriate loss to compare the prediction with the target, and finally adjust the model.

How to interpret and boundaries Classification results indicate which predefined category the sample better matches, and regression results indicate the numerical magnitude estimated by the model. When categories are ordered, numerical values need to be binned, or the answer contains multiple structures at the same time, you cannot mechanically decide the task type just by “whether it looks like numbers or text”; you also need to consider the object the business wants to predict and the error cost.

3What Does “Learning” Actually Learn?Math

Classification and regression look different, but when abstracted into mathematics, what training does isthe same thing. What is it?

Think of the rule to be learned as aparameterized function f_θ: feed in the input x, and it outputs a prediction f_θ(x). Here θ is the set of parameters that the model needs to learn,n is the total number of training samples,i is the sample index,xᵢ and yᵢ are the input and label of the i-th sample, respectively. Learning means finding a set of parameters θ, which makes the average error on the training samples as small as possible:

Find θ such that   (1/n) Σᵢ L( f_θ(xᵢ) , yᵢ )   is as small as possible

L is the loss function, which turns the disagreement between a prediction and the label into a number; for now just understand its role. See 1.2 for specific losses and 1.3 “Gradient Descent” for how parameters are updated.

Here “learning” refers tofinding a set of parameters from the candidates that has a relatively small average loss. The input is the training samples, the current parameters, and the loss rule; the output is the updated parameters and the prediction function determined by them. During training, first use the current parameters to compute predictions, then compute the loss for each sample, then aggregate the batch average and update the parameters; after repeating for many batches, use independent data to judge whether the rule has actually improved.

3.1 Work Through a Binary Classification Batch by Hand

First, unify notation: let y=1 represent spam, and y=0 represent normal email; the model always outputs the same quantity p=P(y=1|x), that is the probability that “this email is spam.” Now consider a small batch with only two emails:

  • The first is actually spam (y=1), and the model outputs p=0.80, so the probability it assigned to the true class is q=0.80.
  • The second is actually normal mail (y=0), and the model outputs p=0.30; the probability of normal mail is 1-p, so the true class probability q=0.70.

The full form of binary cross-entropy is:

L(y,p) = −[ y ln(p) + (1−y) ln(1−p) ]

When y=1, the second term becomes 0, and the loss is −ln(p); when y=0, the first term becomes 0, and the loss is −ln(1−p). In other words, both cases can be written uniformly as −ln(q), where q is the probability that the model assigns to the true class.

SampleModel output p: spam probabilityTrue class probability qLoss −ln(q)
Spam, y=10.80q=p=0.800.223
Normal mail, y=00.30q=1−p=0.700.357
Batch average(0.223+0.357)/2=0.290
Why use the negative logarithm? Because q is closer to 1, −ln(q) is closer to 0; the smaller the probability assigned to the true class, the faster the penalty grows. For example, q=0.9 gives a loss of about 0.105, and q=0.1 gives a loss of about 2.303. It especially penalizes predictions that are “very confident but wrong,” while also being a continuous function that is easy to optimize.
You don't need to know how to compute gradients yet This section only establishes the connection “probability → loss.” In 1.2 we will systematically study loss functions, and in 1.3 we will learn how to use the loss to adjust parameters. Neural networks, decision trees, and support vector machines are models; supervised learning describes the paradigm of training models using input–target pairs.

A decreasing average loss means the model is closer to the labels under the current sample and loss definition, but it does not mean every sample is predicted correctly, nor does it automatically imply that it can generalize. Parameter update methods vary by model; the binary classification mini-batch in this section only explains “how probability becomes loss” and cannot replace the later gradient derivation or test set acceptance.

4Success Criterion: Not Memorization, but GeneralizationIntuitionEngineering

Since training is about “making predictions close to the labels,” does getting all the labels in the training set right mean success?

On the contrary, when the model has many parameters, it can memorize the training setby rote—score 100 on it, but be clueless with new emails. What we truly need is to be accurate onunseen data; this is calledgeneralization.

So the standard practice is to split the data into three parts, each with its own role:

Training set Validation set Test set Used to tune parameters Used to select model/hyperparameters Final acceptance once

Scroll horizontally to view the full diagram on small screens.

Training set
Used to tune parameters
Validation set
Used to select model/hyperparameters
Test set
Final acceptance once
Figure 2 The training set tunes parameters, the validation set helps choose the model and hyperparameters, and the test set is reserved for final acceptance after the solution is frozen. If test results ever guide modifications, they have actually participated in development and can no longer serve as an unbiased final test.
It's the same thing as overfitting when training error keeps decreasing while validation error starts to increase, it's aoverfitting signal—the model is memorizing rather than learning. A whole set of techniques to combat it (regularization, early stopping, adding data) are covered in the “Overfitting” and “Regularization” nodes.

4.1 Metrics Must Correspond to Error Costs

Suppose there are only 100 spam emails among 10,000 emails. A model that classifies all emails as “normal” still has 99% accuracy, but it misses all spam emails. Therefore, acceptance testing cannot only ask “how many overall are correct”; it must also look separately at:

MetricWhat it answers in the spam email taskMain risk
PrecisionOf the emails that are blocked, how many are really spam?Low precision will mistakenly block normal emails
RecallOf all spam emails, how many are successfully blocked?Low recall will miss spam emails
Slicing by scenarioAre new senders, different languages, and phishing emails all reliable?Overall averages can hide failures in key subgroups

The model outputs probabilities, and finally classifying them as “spam/normal” still requires choosing a threshold. The lower the threshold, the more are blocked and the more false positives; the truly appropriate threshold depends on the business cost of the two types of errors.

Generalization evaluation describeswhether the model remains effective on data that did not participate in training and selection, and it solves the problem that training scores cannot represent real-world performance.

The inputs to evaluation are a frozen model, independent samples and their targets; the outputs are acceptance evidence such as loss, precision, recall, and business slices. The specific procedure: first use the training set to fit parameters, then use the validation set to select the approach, and finally use the test set only after the approach is frozen.

When validation error starts to increase while training error continues to decrease, it indicates the model is more like memorizing training details. But a single high test score is still affected by sample representativeness, temporal changes, and data leakage, and cannot prove reliability in all future scenarios.

5The Cost of Supervision: Labeling BottleneckEngineering

Where does such a direct and effective method fall short? The answer lies in the word “supervision”.

The fuel for supervised learning isdata with target values. Targets may come from manual labeling, or from transaction results, sensor measurements, user behavior, or rule systems. What is truly difficult is not just increasing the number of labels, but obtaining data that is consistent with the real target, covers deployment scenarios, and whose quality can be verified:

  • Expensive, slow: large-scale labeling is a huge amount of human effort, and many fields still require experts (medical imaging, law).
  • The target may be a proxy: clicks do not necessarily equal liking, and historical approval results may also replicate past biases.
  • Noisy and ambiguous: some tasks are difficult for people themselves to label consistently, and automatic logs may also record errors.
  • Distributions change: training emails come from the past, while attack methods, users, and language will continue to change.
This bottleneck is important Manual labeling being expensive is only part of it; the more general limitation is the scarcity of reliable supervision signals. Self-supervised learning constructs training targets from the data itself, thereby reducing dependence on manual labels and enabling models to leverage large-scale unlabeled data.

The “labeling bottleneck” recordsthe limitations of reliable target signals in cost, quality, and coverage, used to determine whether a supervised scheme can support real deployment.

When evaluating, input the labeling source, sampling scope, consistency results, and deployment scenarios; output the usable label scale, noise slices, coverage gaps, and priorities for continued collection.

The approach is not just to count the total number of labels, but to first sample and review labeling consistency, then compare coverage across different populations, times, and sources, and subsequently check whether the labels align with the true business objective. A high consistency rate indicates that the labeling rules are relatively stable, not that the target itself is unbiased; cheap automatic logs do not mean they are trustworthy, while expert review is more accurate but may be expensive and slow.

6It's Not the Only Paradigm: Four Ways of LearningIntuition

If no external target values are provided, what signal can a machine still learn from? Put supervised learning into a bigger map.

ParadigmWhat it learns fromTypical tasks
Supervised LearningLabeled samplesClassification, regression
Unsupervised LearningNo labels; discovers structure on its ownClustering (automatic grouping), dimensionality reduction (using a few coordinates to summarize multiple features, facilitating compression or observation)
Self-supervised LearningNo need for manual annotation; uses the data itself to construct answersLarge model pre-training (predicting the next word)
Reinforcement LearningTrial and error in an environment, relying on reward signalsPlaying chess, robotics, RLHF in alignment
How to understand the categorization of self-supervised learning From a computational form standpoint, it also constructs “input—target—loss”; from a data source standpoint, it does not rely on external manual labels, so many textbooks place it under unsupervised representation learning. There is no need to get stuck on a single categorization; the key is to see clearlywhere the supervision signal comes from: for example, language models use the actual subsequent tokens in the text to construct prediction targets.

This comparison table describeswhere the training signal comes from and what is produced after learning, used to choose an appropriate paradigm when no manual labels are available.

The input is the data available for the task, the feedback method, and the interaction conditions; the output is the choice of a supervised, unsupervised, self-supervised, or reinforcement learning path, along with the corresponding model, structural representation, or policy.

When making a judgment, first check whether there is an external target value; then check whether the data can construct targets on its own; finally, check whether the problem requires delayed rewards obtained through actions. The classification result indicates the main source of supervision, not that an algorithm can only belong to one traditional category; self-supervised learning can be like supervised training in computational form, and RLHF also mixes supervised fine-tuning, reward models, and reinforcement learning, so the boundaries allow combinations.

7In the era of large models, does it still matter?EngineeringSynthesis

Since large models rely on self-supervised pre-training, why still learn supervised learning?

Because it is thecommon language, and it is still everywhere today:

  • Turning a base model into an assistant: Instruction fine-tuning (SFT) is supervised learning—"instruction" is the input and "ideal answer" is the label (see the "Fine-tuning" deep-dive page).
  • Many downstream tasks: For classification, scoring, and extraction in vertical domains, many are still cheapest and most stable when using labeled data for supervised learning.
  • Evaluation philosophy: Evaluation sets with reference answers follow the idea of held-out testing; but evaluating a model on a dataset does not mean the model has undergone supervised training on that dataset.
One-sentence positioning Large models have changed the acquisition of large amounts of representation and knowledge, buthave not replacedsupervised learning: SFT and many downstream adaptations still directly use input–target samples; evaluation borrows the principle of using held-out data to test generalization.

The role of supervised learning in the era of large models can be understood asusing high-quality target signals to constrain the specific behavior of a general-purpose model. It addresses the problem that a model with broad pre-training capabilities may not necessarily answer according to task requirements.

Inputs can be instructions and ideal answers, domain samples and labels, and the output is a supervised fine-tuned model or a task-specific predictor.

In application, first define the behavior you want the model to exhibit, then collect representative input–target pairs, then minimize the loss between predictions and targets, and validate on an independent slice. An improvement in downstream scores indicates the model is more suitable for the current objective and distribution, but it cannot be inferred that its foundational knowledge has increased comprehensively; when demonstration data is narrow, labels are biased, or deployment tasks change, supervised adaptation can still fail.

8Connecting the entire causal chainSynthesis

From samples paired with inputs and targets to reliable predictions on unseen samples, how is the evidence chain built step by step?

  1. Give the model samples of 'input + target value' to let it learn the rule from input to output—this is supervised learning. Target values may be noisy, so data quality is also part of the mechanism.(§1)
  2. Discrete answers mean classification; continuous ones mean regression.(§2)
  3. Abstractly, training = adjusting parameters to make 'predictions' close to 'labels', i.e., minimizing the loss.(§3)
  4. The criterion for success is not memorizing the training set, but being accurate on unseen data (generalization), so we should split into training/validation/test.(§4)
  5. It requires target values paired with inputs; sources can be manual labeling or observational records such as transaction outcomes and sensor measurements. The bottleneck lies in the cost, quality, target consistency, and scenario coverage of the supervision signal; it cannot be attributed solely to manual labeling.(§5)
  6. When comparing other paradigms, examine the signal source and learning objective separately: unsupervised learning seeks structure from unlabeled data; self-supervised learning constructs targets from the data itself, reducing dependence on manual labels and supporting large-scale pre-training; reinforcement learning learns sequential decision-making from rewards brought by actions. These differences do not mean that all three emerged to circumvent the labeling bottleneck.(§6)
  7. In the era of large models, it has not been replaced; instead, it is redirected to calibrate behavior (SFT), adapt to downstream tasks, and perform evaluation.(§7)
Pass standard If you can clearly explain 'why supervised learning pursues generalization rather than memorizing the training set,' and can compare the sources and boundaries of external labels and the data's own supervision signals, you have grasped its core.

9Common MisconceptionsIntuition

This section only disambiguates: which statements sound reasonable but would directly lead to wrong data, training, or acceptance decisions?

MisconceptionMore Accurate Understanding
Supervised Learning = Neural NetworkIt is atraining approach; Neural Network, decision trees, and SVM can all be trained with it.
If the training set is accurate, it's successful.The goal isgeneralizationto new data; a perfect score on the training set may just be overfitting.
Labels are objective truth.Labels are training targets; they may have noise, disagreement, or just be business proxies.
More data is always better.Data'squality, representativeness, and target consistencycannot be replaced by quantity
In the era of large models, it is outdated.Pre-training heavily uses self-supervised learning; SFT and many downstream adaptations still use supervised learning, and evaluation borrows the held-out test principle.
Self-supervised learning is just automatically generating manual labels.It constructs supervisory signals from data structure; the computational form may resemble supervised training, but the paradigm classification and learning objective are more complex.

10Check whether you really understandSelf-test

The questions move step by step from definitions to real acceptance; each scenario question uses only concepts already established on this page.

  1. Where does 'supervision' come from? Why is the label not necessarily equal to objective truth?
  2. What is the fundamental difference between classification and regression? Give one example of each.
  3. Explain in one sentence: abstractly speaking, what is supervised learning training doing?
  4. Why does 'predicting the entire training set correctly' not mean the model is successful? How should it be correctly evaluated?
  5. The data bottleneck of supervised learning is not just 'expensive manual labeling.' What other problems does it include?
  6. What are the connections and differences between self-supervised and supervised learning, respectively, in terms of computational form and the source of the supervisory signal?
  7. In the era of large models, in which stages does supervised learning still play a role?
  8. Among 10,000 emails, only 100 are spam. The model predicts all as normal. What is the accuracy? Why does this result not show that the model is effective?
  9. You find that duplicate versions of the same email appear in both the training set and the test set. Why does the test score become inflated? How should you re-split the data?
  10. Design three acceptance slices for the spam model, and for each slice explain the errors or metrics to observe.
Reference answers
  1. Supervision comes from the target values paired with inputs in the training samples; labels are used to compute loss and adjust the model, but they may contain mislabeling, subjective disagreement, measurement error, or proxy bias, so they do not naturally equal objective truth.
  2. If the answer is a discrete category, it is classification (spam/normal); if it is a continuous numerical value, it is regression (house price).
  3. Adjust the model parameters so that its predictions on the training samples are as close to the labels as possible, that is, minimize the loss.
  4. Because when there are enough parameters, the model may memorize the training set but fail to generalize; you should use a validation set to select the model and hyperparameters, and after the approach is frozen, use a test set that did not participate in selection for acceptance. If the test results are used for further modification, new independent test data is needed afterwards.
  5. It also includes label noise and ambiguity, targets that are only business proxies, insufficient data coverage, and distribution shift over time between the training distribution and the deployment distribution. Methods such as self-supervised, unsupervised, semi-supervised, and weakly supervised learning reduce reliance on high-quality human labels from different angles.
  6. In computational form, both may construct inputs, targets, and minimize loss; the difference is that ordinary supervised learning uses externally provided targets, while self-supervised learning constructs the supervisory signal from the data's own structure. This allows large models to leverage massive amounts of data without human annotation for pre-training.
  7. Typical stages include supervised fine-tuning (SFT) with demonstration data, and using domain labels to adapt classification, extraction, or scoring tasks. Evaluation with reference answers borrows the held-out test principle of supervised learning, but evaluation itself is not training.
  8. The accuracy is 99%, because 9,900 normal emails are all predicted correctly; but all 100 spam emails are missed, so the spam recall is 0%. You should report spam recall and the precision of blocked emails at the same time, and choose the threshold based on the cost of false positives and missed detections.
  9. Duplicate samples make the test set no longer representative of unseen data, and the model may obtain inflated scores by memorization. You should first deduplicate by original email or email thread, then split using email source, thread, or time as grouping units, ensuring that variants from the same source fall into only one set.
  10. You can design: ① slice by true class, and look at spam recall and the false positive rate on normal emails separately; ② slice by source and language, checking precision/recall on new senders, different domains, and different languages; ③ slice by time, using more recent emails to test performance after attack methods change. The miss rate for high-risk phishing emails should have an independent upper limit and cannot be offset by the high accuracy on normal emails.

11Concept Dependencies and Extended LearningPath

As page 1 of the official path, which content must be mastered now, and which content only needs to be encountered now and left for later nodes to expand?

Learning levelConcepts involved
Before this pageOnly need to know that a function means "input passes through rules to produce output"; vectors can for now be understood as a set of numbers
Core of this pageLabels, classification and regression, generalization, training/validation/test, four learning paradigms
Next stepInformation theory, loss functions, gradient descent; this page's cross-entropy and parameter updates will be formally developed at those nodes
Immediate extensionsOverfitting, regularization, unsupervised learning, reinforcement learning; self-supervised learning will continue to be expanded in the model architecture stage
FurtherPre-training, fine-tuning and instruction fine-tuning, large language models, evaluation
Sources and adaptation notes
Access date: 2026-07-25