Home Knowledge Base Curriculum Learning

Curriculum Learning

What is Curriculum Learning? Training models on examples ordered by difficulty, starting with easy examples and progressing to harder ones, mimicking human learning.

Curriculum Types

Predefined Curriculum Order by known difficulty:

def difficulty_score(example):
    return len(example["text"])  # Simple: shorter is easier

# Sort by difficulty
curriculum = sorted(data, key=difficulty_score)

# Train in batches of increasing difficulty
for epoch in range(epochs):
    current_data = curriculum[:epoch_fraction * len(curriculum)]
    train(model, current_data)

Self-Paced Learning Model determines what is easy:

def self_paced_weights(losses, threshold):
    # Easy examples have low loss
    weights = (losses < threshold).float()
    return weights

# Increase threshold over training
for epoch in range(epochs):
    threshold = initial + epoch * increment
    losses = model.get_losses(data)
    weights = self_paced_weights(losses, threshold)
    train(model, data, weights)

Difficulty Metrics

MetricDescription
LengthShorter sequences are easier
VocabularyCommon words are easier
Syntax complexitySimple grammar is easier
Model lossLow loss = easy for current model
Human annotationExpert-labeled difficulty

Curriculum Strategies

StrategyDescription
Baby StepsVery gradual difficulty increase
One-passSingle sweep from easy to hard
InterleavedMix difficulties, weighted toward easy
Anti-curriculumHard first (sometimes works)

Benefits

Implementation Example

class CurriculumDataLoader:
    def __init__(self, data, difficulty_fn, pacing_fn):
        self.data = sorted(data, key=difficulty_fn)
        self.pacing_fn = pacing_fn

    def get_epoch_data(self, epoch):
        fraction = self.pacing_fn(epoch)
        cutoff = int(fraction * len(self.data))
        return self.data[:cutoff]

Use Cases

curriculum learningeasy to hard

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.