Scaling Language Models When Target Data Is Limited

Peter Bubenik · Apple ML · · Source
Image for Scaling Laws for Mixture Pretraining Under Data Constraints

After studying this material, you should be able to:

  1. Explain the fundamental trade-off in mixture pretraining under data constraints
  2. Understand what scaling laws are and why they matter for language model training
  3. Describe the role of data repetition in mixture training and its limits
  4. Apply the concept of repetition-aware mixture scaling laws to make practical training decisions
  5. Evaluate how model size, compute budget, and target data size interact to determine optimal configurations

Step-by-Step Teaching

Step 1: The Core Problem — Why Data Scarcity Matters

Background

When training large language models (LLMs), more data generally means better performance. However, not all data is equally available.

Data TypeAvailability
Generic web text (English)Abundant ✅
Low-resource languages (e.g., Swahili)Scarce ❌
Specialized domains (e.g., medical records)Scarce ❌
High-quality curated textScarce ❌

The Practical Dilemma

Suppose you want to train a model that performs well in medical text. You have:

  • 🗂️ 1 billion tokens of generic internet text
  • 📄 10 million tokens of medical text (100x smaller)

Question: How do you combine these two sources?

This is the mixture pretraining problem.


Step 2: Understanding the Trade-Off

There are two failure modes when mixing data:

Failure Mode A: Too Little Target Data

Generic Data: ████████████████████ 99%
Target Data:  ░                    1%
  • The model barely sees medical text
  • It learns general language well but underperforms on the target domain
  • Called: underexposure

Failure Mode B: Too Much Target Data

Generic Data: ████                 20%
Target Data:  ████████████████     80%
  • The same 10M medical tokens get repeated many times
  • The model memorizes examples rather than learning patterns
  • Called: overfitting / diminishing returns from repetition

The Sweet Spot

Generic Data: ████████████████     ~80%
Target Data:  ████                 ~20% (repeated optimally)

🎯 Key Insight: Finding this sweet spot is what this research is about.


Step 3: What Are Scaling Laws?

Before going further, you need to understand scaling laws.

Definition

A scaling law is a mathematical relationship that predicts model performance based on measurable quantities like:

  • Model size (number of parameters)
  • Amount of training data (tokens)
  • Compute budget (FLOPs)

Classic Example (Chinchilla Law)

Loss ≈ f(Model Size, Training Tokens)

If you double the model size, you need roughly double the data to maintain efficiency.

Why They're Useful

Instead of running thousands of expensive experiments at full scale, you:

  1. Run many small experiments
  2. Fit a mathematical law to the results
  3. Extrapolate to predict large-scale behavior

💡 Analogy: Like predicting how long it takes to drive 1,000 miles by first measuring your speed on a 10-mile test drive.


Step 4: The Role of Repetition — The Central Finding

What the Research Found

Across 2,000+ training runs, the key driver of target-domain performance was repetition — how many times the target data is reused during training.

Single-Source vs. Mixture Training

Training TypeRepetition Tolerance
Single-source (only target data)Low — overfits quickly
Mixture (target + generic data)High — tolerates 15–20x repetitions

Why Does Mixture Training Tolerate More Repetition?

Think of it this way:

Training Step Timeline:

Single-source:
[Medical] → [Medical] → [Medical] → [Medical] → OVERFIT ❌

Mixture:
[Medical] → [Generic] → [Generic] → [Medical] → [Generic] → [Medical] → Still Learning ✅

The generic data acts as a regularizer — it prevents the model from collapsing into memorizing the target data by continuously reinforcing general language understanding between exposures to target data.

🔑 Key Finding: Scarce target corpora can be reused 15–20 times without catastrophic overfitting, when mixed with generic data.


Step 5: What Determines the Optimal Number of Repetitions?

The optimal repetition count is not fixed — it depends on three factors:

Factor 1: Target Data Size

Small target dataset  → Can tolerate MORE repetitions
Large target dataset  → Needs FEWER repetitions

Intuition: If you only have 100 medical documents, repeating them 20x is fine. If you have 1 million, you barely need to repeat.

Factor 2: Compute Budget

Large compute budget  → More total training → More repetitions possible
Small compute budget  → Fewer total steps → Fewer repetitions needed

Factor 3: Model Scale

Larger model → More capacity → Can extract more from repeated data
Smaller model → Less capacity → Saturates faster with repetition

Summary Table

ConditionOptimal Repetitions
Tiny target data + Large compute + Large model~15–20x
Large target data + Small compute + Small model~1–3x

Step 6: The Repetition-Aware Mixture Scaling Law

The Innovation

The researchers developed a new mathematical formula that extends classic scaling laws to account for:

  1. Decreasing value of repeated tokens — the 20th time you see a document teaches you less than the 1st time
  2. Regularizing role of generic data — generic data keeps the model from overfitting

Conceptual Formula

Target Domain Loss ≈ g(
    model_size,
    target_tokens × f(repetitions),   ← diminishing returns term
    generic_tokens                      ← regularization term
)

Where f(repetitions) is a decreasing function — each additional repetition contributes less than the previous one.

Visualizing Diminishing Returns

Value of each repetition:

Rep 1:  ████████████████  (high value)
Rep 2:  ████████████      (good value)
Rep 5:  ██████            (moderate value)
Rep 10: ████              (low value)
Rep 20: ██                (minimal value)
Rep 50: █                 (near zero)

Step 7: Practical Application — How to Use This

The Workflow

Given your constraints, here's how to use the scaling law:

Step 1: Measure your inputs
        → Target data size (tokens)
        → Compute budget (FLOPs)
        → Model size (parameters)

Step 2: Plug into the scaling law
        → Solve for optimal repetition count R*

Step 3: Compute mixture ratio
        → Target proportion = (Target tokens × R*) / Total tokens

Step 4: Train with this mixture

Concrete Example

Suppose:

  • Target data: 50M tokens (medical)
  • Generic data: 5B tokens available
  • Compute budget: 100B token-equivalents of training

The scaling law might tell you:

  • Optimal repetitions: R = 12*
  • Use: 50M × 12 = 600M target tokens + 99.4B generic tokens
  • Mixture ratio: ~0.6% target, ~99.4% generic

⚠️ Without this framework, you might have guessed 50/50 and severely overfit, or 0.01% target and underexposed the model.


Step 8: Connection to Related Work

This research connects to two related problems:

Problem 1: Optimal Data Mixtures (Multi-Domain)

"Scaling Laws for Optimal Data Mixtures"

  • Addresses: What proportion of each domain should you use?
  • This paper addresses: Given a fixed target domain, how many repetitions are optimal?
  • They are complementary — one sets the ratio, the other handles scarcity

Problem 2: Fine-tuning vs. Pretraining

"Scaling Laws for Forgetting During Finetuning"

  • Fine-tuning on scarce target data → overfitting + forgetting of pretraining
  • Mixture pretraining → avoids forgetting because generic data is always present
  • Key difference: In mixture pretraining, you never fully leave the generic distribution

Summary: Key Takeaways

ConceptKey Point
The Trade-offToo little target data = underexposure; too much = overfitting
Repetition toleranceMixture training allows 15–20x repetitions of scarce data
Why it worksGeneric data regularizes and prevents overfitting
Optimal repetitionsDepends on target size, compute budget, model scale
Scaling lawMathematical formula accounting for diminishing returns of repetition
Practical valueReplaces trial-and-error with principled mixture configuration

Self-Check Questions

  1. Why does mixture training tolerate more repetition than single-source training?
  2. If your target dataset doubles in size, should you use more or fewer repetitions? Why?
  3. What two phenomena does the repetition-aware scaling law account for?
  4. What are the two failure modes when setting the mixture ratio?
  5. Why is finding the optimal mixture important for low-resource languages specifically?

More to study