Synthetic Data Pipelines › Curriculum Design

Michael BrenndoerferNovember 25, 20265 min read
Language AI HandbookAll chapters
Part 21 of 67Data Governance, Provenance, and Synthetic Ecosystems
Chapter 152Synthetic Data Pipelines › Curriculum Design
Reading section 7 of 11 · Curriculum Design · 5 minSection 7 of 11 · 5 min

Section 7 of 11 · 5 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

A curriculum specifies when examples are presented and how they are weighted.

If the learner reads a concatenated easy-to-hard file in order, it receives an easy-to-hard sequence. A shuffled loader can erase that ordering. Report the actual sampling or loading policy.

Difficulty labels

Choose a difficulty estimate before ordering items. Three possible signals are:

  • Heuristic. Use observable features such as the number of operations or the size of operands and check whether they distinguish the task types you intend.
  • Model-based. Use per-item loss or sampled pass rate to describe difficulty for a specified model and scoring setup.
  • Item-response theory. Fit item difficulty and model ability from scored responses, using an explicit response model.

Heuristics measure chosen task features. Loss and pass rates measure difficulty for a particular model. Item-response theory estimates item and model parameters on a calibrated scale. In a one-parameter logistic model, increasing ability changes pass probabilities while preserving the ranking by item difficulty.

We use the heuristic here, because our items have interpretable structure: number of operations and operand magnitude.

PythonIn [36]
CollapseExpand
def tier(row):
    if row["steps"] == 1 and row["max_operand"] <= 10:
        return "easy"
    if row["steps"] >= 2 and row["max_operand"] >= 12:
        return "hard"
    return "medium"


final["tier"] = final.apply(tier, axis=1)

Ordering and mixing

Curriculum learning can vary both the sequence of examples and the mixture seen at each stage. Bengio et al. (2009) studied several curricula on specific tasks. This fixture illustrates a change in mixture. Comparing it with strict easy-to-hard ordering would require training both ways.

Keep earlier difficulty bands in the mix when later stages still need practice on them. Report the realized mixture and evaluate retention across stages.

A stage plan is a table of weights over difficulty tiers. Ours moves from foundation-heavy to frontier-heavy across three stages.

PythonIn [37]
CollapseExpand
STAGE_PLAN = [
    ("stage-1 foundation", 0.40, {"easy": 0.80, "medium": 0.20, "hard": 0.00}),
    ("stage-2 core", 0.35, {"easy": 0.30, "medium": 0.50, "hard": 0.20}),
    ("stage-3 frontier", 0.25, {"easy": 0.05, "medium": 0.45, "hard": 0.50}),
]

stage_rng = random.Random(f"curriculum|{SEED}")
pools = {
    t: final.index[final["tier"] == t].tolist()
    for t in ("easy", "medium", "hard")
}

assignments, reused = {}, 0
for name, share, mix in STAGE_PLAN:
    n_stage = int(round(share * len(final)))
    idx = []
    for tier_name, weight in mix.items():
        k = int(round(weight * n_stage))
        pool = pools[tier_name]
        if not pool or k == 0:
            continue
        if k <= len(pool):
            idx.extend(stage_rng.sample(pool, k))
        else:
            idx.extend(stage_rng.sample(pool, len(pool)))
            idx.extend(stage_rng.choices(pool, k=k - len(pool)))
            reused += k - len(pool)
    assignments[name] = idx
PythonIn [38]
CollapseExpand
rows = []
for name, _, _ in STAGE_PLAN:
    idx = assignments[name]
    tiers = final.loc[idx, "tier"].value_counts()
    tokens = int(
        sum(
            len(final.loc[i, "problem"].split())
            + len(final.loc[i, "response"].split())
            for i in idx
        )
    )
    rows.append(
        {
            "stage": name,
            "items": len(idx),
            "easy": int(tiers.get("easy", 0)),
            "medium": int(tiers.get("medium", 0)),
            "hard": int(tiers.get("hard", 0)),
            "words": tokens,
        }
    )
stage_summary = pd.DataFrame(rows)
ConsoleOut [39]
CollapseExpand
             stage  items  easy  medium  hard  words
stage-1 foundation     46    37       9     0    932
      stage-2 core     40    12      20     8    843
  stage-3 frontier     28     1      13    14    606

draws with replacement to fill a short tier: 12
VisualizationOut [40]
CollapseExpand
Stacked bar chart of easy, medium, and hard item counts across three curriculum stages.
Difficulty composition of the three curriculum stages, stacked by easy, medium, and hard item counts. The share of easy items shrinks while the hard share grows across stages, so the mixing weights, not the ordering, are what shift the training distribution from foundation items toward frontier items. The bands count draws, including any rows repeated to fill a short tier.

The stages shift their realized mix toward harder items. Within each stored assignment list, the code appends batches in tier order. These lists record the stage composition, and a training sampler can shuffle them if the intended curriculum mixes difficulty within the stage.

The code rounds each nominal stage size using Python's round, then rounds each tier quota independently. Those choices need not sum exactly to the nominal budget. The nominal counts are 46, 41 and 29, but the tier quotas yield 46, 40 and 28 actual draws, totaling 114. An empty tier can further reduce a realized count. The reuse counter covers extra draws within each stage when an available tier is short. It excludes repetitions across stages.

Budget accounting

Curriculum design is a token-budget exercise, and the budget must be computed with the model's tokenizer, not with whitespace splitting. Our words column is an approximation labelled as such; a real plan would run the tokenizer from Part V: Subword Tokenization over every sample and report compressed token counts, including the chat template and any special tokens.

The token-to-word ratio depends on the text and the tokenizer. Measure the actual tokens in each stage, including any template and special tokens, before treating a word-count balance as a token-count balance.

Track the synthetic fraction per stage, meaning the share of tokens that came from generators. Reproducing a mixture requires the actual data identities and sampling policy as well as the fraction. The recursive-training studies below show why it matters whether original examples are retained or replaced.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy