Pretraining & scaling laws

Step 6 of 13 in Generative AI · Theorem · Medium

LLMs are transformers trained to predict the next token on huge text. Loss falls predictably as a power law in parameters, data and compute.

Build it

  1. Your own scaling curve

    Train 4 tiny GPTs of increasing size on the same data; plot loss vs parameters on log-log axes.

    Done when: Roughly straight line; you estimate the exponent.

Case study: Chinchilla (2022)

  • Most large models were undertrained for their size.
  • Compute-optimal: scale parameters and tokens about equally (~20 tokens per parameter).
  • A 70B model beat a 280B one trained with the same compute.

Read the case study

Resources

Earn this star

On the map, you log what you built. Finish the step and its star lights.

Open this step on the map