Search

Search papers and lessons

Curriculum Learning

Level 3 · 11 min read

Curriculum learning trains a model on easy examples first and gradually adds harder ones, so early gradient steps point in useful directions and the model reaches good answers sooner.

On this page

  • Colour = topic mix
  • Calculus
  • Discrete math
  • Probability
  • Linear algebra
  • Optimizers
  • Learning basics
  • Sign in to see your progress

TL;DR

Curriculum learning changes the order in which a model sees its training data. It starts with examples that are easy for the model and gradually adds harder ones, the way a school teaches addition before long division. The model still learns from the same data in the end. The early steps are simply more useful, because they are not dominated by examples the model cannot yet make sense of, so it often reaches a good answer with less training.

Where you'll see it: training language and vision models on examples sorted by length or quality, and Reinforcement Learning agents that start a task near its goal and move the start farther away over time.

Intuition

The problem: hard examples early

A model trained with Stochastic Gradient Descent learns by taking steps. Each step is computed from one example or a small batch, and it moves the model's settings a little toward doing better on that batch, along the Gradient of the loss (the direction that most increases the error, followed backwards). Early in training the model knows almost nothing. For a hard example, the step it receives is large and pointed in a direction that is shaped by the model's confusion, not by the real pattern. Those steps can waste effort or push the model into a poor region of its settings.

Easy examples carry a cleaner signal. A model that already gets an example right, or nearly right, receives a small and reliable step. Starting with those steps lets the model build the basic features first, and the harder examples later refine features that already exist.

The picture: a student's course of study

A teacher does not hand a first-year student a graduate exam. Units are ordered so each one uses the skills of the last. Curriculum learning applies the same rule to the training data. The difficulty of an example is a score, and the curriculum is a schedule that releases examples in order of that score.

Two parts make up a curriculum. The first is a difficulty score for each example. It might be the length of a sentence, the loss of a simpler model on the example, or the judgement of a human. The second is a pacing rule, which says how much of the sorted data the model may use at each stage of training. A common rule starts with the easiest fraction of the data and widens the pool over time until all of it is in use. One pass through the whole training set is called an epoch.

The math

Setup

Let D={(xi,yi)}i=1N\mathcal{D} = \{(x_i, y_i)\}_{i=1}^{N} be a training set of NN input and answer pairs, as in Supervised Learning. Let ℓ(θ;x,y)\ell(\theta; x, y) be the Loss Function for a model with settings θ\theta. Standard training minimizes the average loss

L(θ)=1N∑i=1Nℓ(θ;xi,yi)L(\theta) = \frac{1}{N} \sum_{i=1}^{N} \ell(\theta; x_i, y_i)

by Gradient Descent or its stochastic version. Each step uses examples chosen with equal probability from the whole set.

Difficulty scores and pacing

A difficulty score is a function d(x,y)d(x, y) that ranks examples. Sort the examples so that d(x(1),y(1))≤d(x(2),y(2))≤…d(x_{(1)}, y_{(1)}) \le d(x_{(2)}, y_{(2)}) \le \dots. A pacing function g(t)g(t) gives the fraction of the sorted data that is available at training step tt, with g(0)>0g(0) \gt 0 and g(t)=1g(t) = 1 after some point. At step tt, the model draws examples from the easiest g(t)Ng(t) N examples only.

A linear pacing rule is

g(t)=min⁡ ⁣(1,  g0+tT(1−g0)),g(t) = \min\!\left(1, \; g_0 + \frac{t}{T}(1 - g_0)\right),

where g0g_0 is the starting fraction and TT is the number of steps at which the full data becomes available. Before step TT, the pool grows in equal increments. After it, the curriculum is over and the method is ordinary training.

Why the schedule can help

Write the expected gradient at step tt as the average of the gradients of the examples in the current pool. With an easy pool, where the model is already roughly right, the gradients are small and point toward a shared pattern. As harder examples join, the average is dominated by the hard examples' gradients. The point of pacing is to keep the early average close to the pattern the model can already learn, and to let it shift toward the full objective only as the model improves.

The schedule does not change the objective at the end, L(θ)L(\theta). A curriculum helps the path to the minimum, not the location of the minimum, provided training runs to the end on the whole data.

Worked examples

Example
1. Choosing a pool by hand

Six examples have difficulty scores 1,2,3,4,5,61, 2, 3, 4, 5, 6, with 11 the easiest. Use pacing with g0=1/3g_0 = 1/3, so the pool starts with two examples, and let it reach all six at step T=2T = 2.

  1. Compute the fraction at step 00: g(0)=1/3g(0) = 1/3. The pool holds ⌊6×1/3⌋=2\lfloor 6 \times 1/3 \rfloor = 2 examples, namely the scores 11 and 22.
  2. Compute the fraction at step 11: g(1)=1/3+(1/2)(2/3)=2/3g(1) = 1/3 + (1/2)(2/3) = 2/3. The pool holds 44 examples, scores 11 to 44.
  3. Compute the fraction at step 22: g(2)=1g(2) = 1. The pool holds all six.
  4. Check the order: the pool only grows, and every example enters exactly once, at the step where its score is first covered.
  5. Interpretation: the schedule spends the first steps on the two easiest examples, and the two hardest examples are not used until the model has had two rounds on the easier ones.
Example
2. Order changes the path (a one-parameter fit)

Fit the model y^=θx\hat{y} = \theta x to two examples by squared loss, ℓ=(θx−y)2\ell = (\theta x - y)^2, which has gradient 2x(θx−y)2x(\theta x - y). The easy example is (x,y)=(1,2)(x, y) = (1, 2), and the hard example is (x,y)=(3,9)(x, y) = (3, 9), which is an outlier because the other example implies θ=2\theta = 2 and this one implies θ=3\theta = 3. Start at θ=0\theta = 0 and use step size η=0.05\eta = 0.05.

Order A, easy first:

  1. Gradient on the easy example at θ=0\theta = 0 is 2⋅1⋅(0−2)=−42 \cdot 1 \cdot (0 - 2) = -4, so θ=0−0.05(−4)=0.2\theta = 0 - 0.05(-4) = 0.2.
  2. Gradient on the hard example at θ=0.2\theta = 0.2 is 2⋅3⋅(0.6−9)=−50.42 \cdot 3 \cdot (0.6 - 9) = -50.4, so θ=0.2+2.52=2.72\theta = 0.2 + 2.52 = 2.72.

Order B, hard first:

  1. Gradient on the hard example at θ=0\theta = 0 is 2⋅3⋅(0−9)=−542 \cdot 3 \cdot (0 - 9) = -54, so θ=2.7\theta = 2.7.
  2. Gradient on the easy example at θ=2.7\theta = 2.7 is 2⋅1⋅(2.7−2)=1.42 \cdot 1 \cdot (2.7 - 2) = 1.4, so θ=2.7−0.07=2.63\theta = 2.7 - 0.07 = 2.63.

Interpretation: both orders end near the hard example's answer (θ=3\theta = 3), but the final values differ, 2.722.72 against 2.632.63, because the last example pulls the model toward its own answer. In this tiny convex problem order only changes the path, not the destination, so there is no accuracy gain to show; the benefit of a curriculum appears in deep networks, where the path decides which region of the loss surface training settles into. At the first step, the gradient on the hard example (−54-54) is more than thirteen times the size of the gradient on the easy example (−4-4), so a hard example dominates any step it appears in. Curriculum learning uses this fact on purpose: it keeps large, noisy steps out of the first phase.

Example
3. A realistic image schedule

A classifier is trained on 100,000100{,}000 images. Each image has a difficulty score from a pretrained teacher, and the schedule uses the easiest 20%20\% at the start. The pool grows by another 20%20\% at the end of each epoch until it holds everything from epoch 55 onward. Training then runs for ten epochs in total.

  1. The pool sizes by epoch are 20,00020{,}000, 40,00040{,}000, 60,00060{,}000, 80,00080{,}000, then 100,000100{,}000 for every later epoch.
  2. Add the examples seen in the first four epochs: 20,000+40,000+60,000+80,000=200,00020{,}000 + 40{,}000 + 60{,}000 + 80{,}000 = 200{,}000.
  3. Add the examples seen in the last six epochs: 6×100,000=600,0006 \times 100{,}000 = 600{,}000.
  4. The total is 800,000800{,}000 example visits. Standard training for ten epochs makes 1,000,0001{,}000{,}000 visits.
  5. Interpretation: the schedule makes about 20%20\% fewer example visits for the same number of epochs. The saving comes from the early epochs, which train on less data. Whether the final accuracy holds up is an empirical question, and the schedule has to be tuned against a baseline with the same budget.

These counts follow from the schedule as stated. They are not measurements of a real run.

Tradeoffs and failure modes

SituationWhat goes wrongBetter choice
Difficulty score is wrong or noisyThe model learns the wrong order and the schedule adds noiseUse a score from a trained reference model, and check it on held-out data
Pacing is too slowHard examples arrive late, and the model may never learn them wellShorten the schedule, or use a smooth schedule that brings in data continuously
Pacing is too fastThe benefit disappears, and the method becomes ordinary trainingStart with a larger initial pool
Easy data is much larger than hard dataThe model overfits the easy pattern and stays thereUse Overfitting checks on a validation set that includes hard examples
Hard examples are the important onesDropping them until late may hurt the final resultMix in some hard examples from the start, or use a soft weighting
Task is reinforcement learning with rare rewards (the Sparse Reward Problem)The agent never sees a reward on the hardest tasksStart the task close to its goal and move the start away

Curriculum learning is a schedule, not a new loss function, so it sits on top of any learner. Its main cost is the extra work to compute difficulty scores and tune the pacing. When the data is already well mixed and the model trains quickly, a random order is often just as good.

History

Jeffrey Elman showed in 1993 (in his paper on the importance of "starting small") that a neural network trained on a language task learned better when the training sentences were introduced gradually, starting with simple ones. The idea that the order of training examples matters was older than that, and the method was named in a 2009 paper by Yoshua Bengio and coauthors, who showed that easy-to-hard orders could speed up learning on several tasks. The idea caught on as models grew and training became expensive. Ordered data, staged tasks and reward shaping in reinforcement learning all became common, and the principle is still used whenever a training run is long or the data is hard for the model to start on.

Recap

Training is a sequence of steps, and each step uses a chunk of data. Curriculum learning chooses which chunks come first. A difficulty score ranks the examples and a pacing function releases them over time. Early steps then point in more useful directions, and the model can reach good settings with less total work. The objective stays the same, so the schedule only changes the route. The same idea reappears in Transfer Learning, where a model is first trained on a simpler source task, and in reinforcement learning, where the goal is moved farther away as the agent improves.

Check yourself

QuestionRecall: what are the two parts of a curriculum?Show answer

A difficulty score that ranks the examples, and a pacing rule that says how much of the sorted data the model may use at each stage of training.

QuestionComputation: with 50 examples sorted by difficulty, a linear pacing rule starts at g0=0.2g_0 = 0.2 and reaches 11 at step T=10T = 10. How many examples are in the pool at step 5?Show answer

At step 5, g(5)=0.2+(5/10)(1−0.2)=0.2+0.4=0.6g(5) = 0.2 + (5/10)(1 - 0.2) = 0.2 + 0.4 = 0.6. The pool holds 0.6×50=300.6 \times 50 = 30 examples.

QuestionWhy: why can a hard example cause a bad step early in training?Show answer

Early in training the model is confused, so its prediction on a hard example is far from the answer. The gradient is large, and it points in a direction shaped by the confusion rather than by a pattern the model has learned. A large step in that direction can move the settings away from a good region, which is why the early steps are better spent on examples the model can already handle.

QuestionApplied: a curriculum uses 800,000 example visits, while standard training uses 1,000,000 with the same number of epochs. Why might the curriculum still fail to match the final accuracy?Show answer

Fewer visits mean the model sees the hard examples fewer times in total, and the early phase trains on a subset only. If the hard examples carry the signal that separates good models from average ones, the reduced exposure can cost accuracy. The comparison has to be made at the same budget and checked on a held-out set that includes hard examples.

Sources