Foundations to Frontier
Tests
D. Classical Machine Learning › D15 Semi-Supervised Learning

Self-Training

Self-training is the simplest way to use unlabelled data: train a classifier on the few labelled examples, let it label the unlabelled examples it is most confident about, add those pseudo-labels to the training set, and repeat. When classes form well-separated clusters, the confident predictions are mostly right and they pull the decision boundary into the low-density gap between clusters, so a handful of labels can approach fully supervised accuracy. But the method has no way to detect its own mistakes: wrong pseudo-labels are learned as truth and reinforce themselves (confirmation bias), and the confidence of a model fitted to a few points is badly calibrated, so a high threshold does not reliably protect it. Modern variants (FixMatch, Noisy Student) add consistency regularisation, strong augmentation and teacher–student training. This page covers the algorithm, the cluster and low-density assumptions behind it, thresholds and per-round caps, confirmation bias and calibration, its relation to EM and entropy minimisation, and when to prefer other semi-supervised methods. In the exercises you implement self-training for logistic regression; then you map when it helps and when it hurts, across class overlap and confidence thresholds.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Learn from your own best guesses

A student with only six worked examples could practise on a stack of unmarked exercises: answer the ones they are sure about, treat those answers as correct, learn from them, and try again. Self-training does exactly this with a classifier. It is cheap and often helpful, but the danger is plain: if a confident answer is wrong, the student now practises the mistake.

Self-training: learn from your own confident guesses
round 1: 283 pseudo-labelled (0 wrong) · test accuracy 0.987 (labelled only 0.988)
When the classes are well separated, the confident guesses are right and pull the boundary toward the gap between the clusters. When they overlap, early mistakes become training labels, the model grows more confident in them, and the errors compound (confirmation bias). A higher τ does not always help: a model trained on 6 points is overconfident, and a very high threshold admits only far-out points that say little about where the boundary should be.
Why engineers care

Labels are expensive: an expert must inspect each fault, image or report, while unlabelled data pile up for free. Self-training (pseudo-labelling) is the first thing people try to exploit them, and it underlies modern methods such as Noisy Student and FixMatch. Knowing when it silently degrades a model is essential before deploying it on safety-relevant data.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Self-training adds to the training set…
  2. 2. The main risk of self-training is…
  3. 3. Self-training tends to work when classes…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The algorithm by hand

Algorithm.

  1. Train classifier f on the labelled set L.
  2. Predict the unlabelled set U. Confidence is max(p, 1 − p) for binary problems: p = 0.1 gives confidence 0.9.
  3. Move every unlabelled point with confidence ≥ τ into L, labelled with its prediction (p > 0.5 gives class 1). For probabilities 0.95, 0.5, 0.03, 0.8 and τ = 0.9, points 0 and 2 are added.
  4. Retrain, and repeat until no point passes τ or U is empty.

Variants.

  • Add only the top m most confident points per class per round, which limits the damage from one bad round.
  • Allow pseudo-labels to be revised in later rounds.
  • Weight pseudo-labelled points less than true labels.

Tracking error. The pseudo-label error rate is the fraction of added points whose pseudo-label is wrong. Pseudo-labels 1, 0, 1, 1 against truth 1, 1, 1, 0 give 0.5: half of what the model then learns is wrong.

One gradient step of logistic regression: w ← w − η Fᵀ(p − y)/n. With rows (1, 2) and (1, −2), labels 1 and 0, w = 0 and η = 1, the step gives w = (0, 1).

📝 Quick check (Level 1)
0/3 answered
  1. 1. Binary confidence for p = 0.3 is…
  2. 2. Capping additions per round mainly limits…
  3. 3. Once added, a wrong pseudo-label…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 30 minUndergraduate students and practising engineers.

Why it can work, and why it can fail

Assumptions.

  • Cluster assumption: points in the same cluster share a label.
  • Low-density separation: the true boundary passes through a sparse region.

Under these assumptions, confident predictions lie deep inside clusters and are right. Training on them pushes the boundary away from dense regions toward the gap, which is the same effect as entropy minimisation (Grandvalet and Bengio, 2005).

Confirmation bias. If classes overlap, or the initial boundary is badly placed, some confident predictions are wrong. The refitted model becomes more confident in them, so more neighbouring points are mislabelled and the boundary drifts further. Nothing in the loop can detect this.

Calibration. A model fitted to a handful of separable points has large weights and reports probabilities near 0 or 1 almost everywhere, so its confidence says little about correctness. Raising τ then admits only extreme points, far out along the classes’ long axis, which carry little information about where the boundary belongs.

Exercise 1 (two elongated Gaussian classes, 6 labelled and 994 unlabelled points, 8 datasets):

  • mean test accuracy 0.992 with the labels alone, 0.999 with self-training at τ = 0.9, and 1.000 with all labels;
  • the gain per dataset ranged from +0.000 to +0.050;
  • the mean pseudo-label error rate was 0.001.

The classes were well separated, so the pseudo-labels were nearly all correct.

from sklearn.semi_supervised import SelfTrainingClassifier
from sklearn.linear_model import LogisticRegression
clf = SelfTrainingClassifier(LogisticRegression(), threshold=0.9).fit(X, y_with_minus_one_for_unlabelled)
🐍 Exercise 1: self-training
Implement logistic regression by gradient descent and a self-training loop that adds unlabelled points with confidence ≥ τ as pseudo-labels; compare labelled-only, self-trained and fully supervised accuracy on two elongated classes.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Self-training's effect under the cluster assumption resembles…
  2. 2. A model trained on a few separable points tends to be…
  3. 3. Confirmation bias means…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Relation to EM. Self-training with hard pseudo-labels is “classification EM”: assign each unlabelled point to its most probable class (a hard E-step), then refit (M-step). Soft EM with a generative model (Nigam et al., 2000, for text) uses probabilistic labels instead. Both depend on the model’s assumptions matching the data; when they do not, unlabelled data can reduce accuracy (Cozman and Cohen, 2002).

Guarantees. Wei et al. (2021) proved that self-training with input-consistency regularisation provably improves when the classes satisfy an expansion assumption, meaning that neighbourhoods of the correctly pseudo-labelled region grow into the rest of each class. Without such structure, no guarantee holds.

Modern pseudo-labelling.

  • FixMatch (Sohn et al., 2020) uses high-confidence predictions on weakly augmented images as targets for strongly augmented versions.
  • Noisy Student (Xie et al., 2020) trains a larger, noised student on teacher pseudo-labels.

Augmentation and consistency make the confidence more meaningful and reduce confirmation bias.

Interview questions.

  • When would you not use self-training? When classes overlap, when the base model is poorly calibrated or very weak, or when the unlabelled data come from a different distribution. Prefer graph-based methods, co-training with good views, or simply labelling more data.
  • How do you make it safer? Use a small labelled validation set to monitor accuracy each round, caps per class, calibrated probabilities, pseudo-label weights below 1, revisable pseudo-labels and early stopping.
📝 Quick check (Level 3)
0/3 answered
  1. 1. Self-training with hard labels is a form of…
  2. 2. Unlabelled data can reduce accuracy when…
  3. 3. FixMatch uses predictions on weakly augmented data as targets for…

Level 4: Expert

★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.

When does self-training help?

History.

  • H. Scudder (1965) described self-learning adaptive pattern recognition.
  • D. Yarowsky (1995) used self-training for word-sense disambiguation.
  • K. Nigam et al. (2000) applied EM with unlabelled text.
  • D.-H. Lee (2013) introduced pseudo-labelling for deep networks.
  • K. Sohn et al. (2020) introduced FixMatch, and Q. Xie et al. (2020) Noisy Student.

Exercise 2. Two elongated classes with varying separation, 6 labelled and 994 unlabelled points, 8 datasets per setting. Each cell gives the mean gain in test accuracy over the labelled-only model, then the worst gain over the 8 datasets, then the pseudo-label error rate.

class separation labelled only → all labelled τ = 0.7 τ = 0.9 τ = 0.99
0.4 (overlapping) 0.918 → 0.981 −0.011, −0.078, 0.063 −0.072, −0.217, 0.076 −0.129, −0.332, 0.100
0.6 0.974 → 0.999 +0.013, −0.001, 0.010 −0.020, −0.149, 0.022 −0.125, −0.312, 0.031
0.8 0.992 → 1.000 +0.008, +0.000, 0.003 +0.007, +0.000, 0.001 −0.110, −0.298, 0.020
1.2 0.999 → 1.000 +0.001, +0.000, 0.000 +0.001, +0.000, 0.000 −0.024, −0.185, 0.004
  • With overlapping classes, self-training hurt at every threshold, by up to 33 points of accuracy on the worst dataset, even though full labels would reach 98%.
  • With well-separated classes it helped a little, and never hurt at τ ≤ 0.9. There was little room to improve, since 6 labels were already nearly enough.
  • The strictest threshold, τ = 0.99, was the worst everywhere, even at 1.2 separation, where its pseudo-labels were 99.6% correct. It admitted only far-out points along the classes’ long axis, which tilted the linear boundary. “Only trust very confident predictions” is not a safe rule when the confidence comes from a model fitted to 6 points.
  • The mean gains hide large variation between datasets. Monitor a labelled validation set every round.
🐍 Exercise 2 (research): separation and thresholds
For class separations 0.4–1.2 and thresholds τ = 0.7, 0.9, 0.99, measure the mean and worst accuracy gain of self-training over the labelled-only model, and the pseudo-label error rate, over 8 datasets.

Self-training in AI, robotics and aerospace

  • Defect and anomaly classification: pseudo-label large archives of inspection images or telemetry windows from a few expert labels, with validation monitoring.
  • Perception domain adaptation: adapt a detector to a new site or sensor by pseudo-labelling confident detections, a standard technique in autonomous driving.
  • Text triage: extend a small labelled set of maintenance reports with confident predictions.

References

  1. D. Yarowsky (1995). “Unsupervised word sense disambiguation rivaling supervised methods.” Proc. ACL.
  2. K. Nigam, A. McCallum, S. Thrun, T. Mitchell (2000). “Text classification from labeled and unlabeled documents using EM.” Machine Learning 39.
  3. Y. Grandvalet, Y. Bengio (2005). “Semi-supervised learning by entropy minimization.” Advances in NeurIPS 17.
  4. K. Sohn et al. (2020). “FixMatch: simplifying semi-supervised learning with consistency and confidence.” Advances in NeurIPS 33.
  5. C. Wei, K. Shen, Y. Chen, T. Ma (2021). “Theoretical analysis of self-training with deep networks on unlabeled data.” Proc. ICLR.