You are reading immutable version 3. The current guide may be newer.

Study the paper

Scaling Laws for Neural Language Models

Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.

16 activities

Lesson

At a glance

Overview of Scaling Laws in Language Models

Scaling Laws in Language Models

Lesson

Transformer Parameter Count Approximation

Transformer Parameter and Compute Scaling

This equation estimates the total number of non-embedding parameters in a standard Transformer model. It assumes standard scaling relationships between the model dimension, attention dimension, and feed-forward dimension.

Lesson

Transformer Forward Pass FLOPs Estimate

Transformer Parameter and Compute Scaling

This equation estimates the computational cost (in FLOPs per token) of a forward pass through a standard Transformer model. It accounts for both the parameter-dependent operations (such as feed-forward networks and projections) and the context-dependent attention operations.

Lesson

Unified Loss Equation L(N,D)

Transformer Parameter and Compute Scaling

The unified loss equation L(N,D) models the joint dependence of the cross-entropy loss on both the number of non-embedding parameters N and the dataset size D (measured in tokens). It captures how overfitting occurs when either resource is constrained relative to the other.

Lesson

Optimal Compute Allocation Scaling Relations

Transformer Parameter and Compute Scaling

This set of scaling relations determines how to optimally allocate an increased compute budget C among the model size (number of non-embedding parameters N ), the batch size B , and the number of training steps S . The total number of tokens processed during training is given by D = B cdot S .

Visual

Transformer Parameter Count Approximation: step by step

Transformer Parameter and Compute Scaling

Follow the existing bounded walkthrough in its intended sequence.

Visual

Transformer Forward Pass FLOPs Estimate: step by step

Transformer Parameter and Compute Scaling

Follow the existing bounded walkthrough in its intended sequence.

Visual

Optimal Compute Allocation Scaling Relations: step by step

Transformer Parameter and Compute Scaling

Follow the existing bounded walkthrough in its intended sequence.

Visual

Unified Loss Equation L(N,D): step by step

Transformer Parameter and Compute Scaling

Follow the existing bounded walkthrough in its intended sequence.

Lesson

The Infinite Data Limit and Overfitting

The Infinite Data Limit and Overfitting

Joint Scaling and Overfitting

Lesson

Critical Batch Size Power Law

Critical Batch Size and Training Dynamics

The critical batch size B rm crit (L) determines the optimal batch size for training neural language models. It represents the threshold where further increasing the batch size yields diminishing returns in terms of training speedup per step. This relationship is modeled as a power law of the cross-entropy loss L .

Visual

Critical Batch Size Power Law: step by step

Critical Batch Size and Training Dynamics

Follow the existing bounded walkthrough in its intended sequence.

Lesson

Optimal Allocation of Compute Budgets

Optimal Allocation of Compute Budgets

Language modeling performance improves smoothly as we increase the model size, dataset size, and amount of compute used for training. Empirical performance has a power-law relationship with each individual factor when not bottlenecked by the other two.

Lesson

Extreme Scaling: Contradictions and Conjectures

Extreme Scaling: Contradictions and Conjectures

The Contradiction in Scaling Laws at Extreme Scales

Quiz

Test your understanding

Scaling Laws Assessment

12 questions grounded in this paper section.

Resource

Further learning

Scaling Laws Assessment

3 supplementary resources for this paper section.