ArticleslgStudy

mathematics

Neural scaling law

Neural scaling law is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Neural scaling law rather than just read about it. In short: In machine learning, a neural scaling law is an empirical scaling law that describes how neural network performance changes as key factors are scaled up or down. These factors typically include the number of parameters, training dataset size, and training cost.

Neural scaling law — main illustration
Neural scaling law — illustration

Key takeaways

  • Neural scaling law belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Neural scaling law to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Neural scaling law from memory before moving on to harder problems.

Reference excerpt

In machine learning, a neural scaling law is an empirical scaling law that describes how neural network performance changes as key factors are scaled up or down. These factors typically include the number of parameters, training dataset size, and training cost. Some models also exhibit performance gains by scaling inference through increased test-time compute (TTC), extending neural scaling laws beyond training to the deployment phase.

Introduction In general, a deep learning model can be characterized by four parameters: model size, training dataset size, training cost, and the post-training error rate (e.g., the test set error rate). Each of these variables can be defined as a real number, usually written as N , D , C , L {\displaystyle N,D,C,L} (respectively: parameter count, dataset size, computing cost, and loss). A neural scaling law is a theoretical or empirical statistical law between these parameters. There are also other parameters with other scaling laws.

Size of the model In most cases, the model's size is simply the number of parameters. However, one complication arises with the use of sparse models, such as mixture-of-expert models. With sparse models, during inference, only a fraction of their parameters are used. In comparison, most other kinds of neural networks, such as transformer models, always use all their parameters during inference.

Size of the training dataset The size of the training dataset is usually quantified by the number of data points within it. Larger training datasets are typically preferred, as they provide a richer and more diverse source of information from which the model can learn. This can lead to improved generalization performance when the model is applied to new, unseen data. However, increasing the size of the training dataset also increases the computational resources and time required for model training. With the "pretrain, then finetune" method used for most large language models, there are two kinds of training dataset: the pretraining dataset and the finetuning dataset. Their sizes have different effects on model performance. Generally, the finetuning dataset is less than 1% the size of pretraining dataset. In some cases, a small amount of high quality data suffices for finetuning, and more data does not necessarily improve performance. Many scaling laws, due to their inherent diminishing returns nature, value data based on a submodular set function which was shown in a paper on this topic.

Cost of training

Training cost is typically measured in terms of time (how long it takes to train the model) and computational resources (how much processing power and memory are required). It is important to note that the cost of training can be significantly reduced with efficient training algorithms, optimized software libraries, and parallel computing on specialized hardware such as GPUs or TPUs. The cost of training a neural network model is a function of several factors, including model size, training dataset size, the training algorithm complexity, and the computational resources available. In particular, doubling the training dataset size does not necessarily double the cost of training, because one may train the model for several times over the same dataset (each being an "epoch").

Performance

The performance of a neural network model is evaluated based on its ability to accurately predict the output given some input data. Common metrics for evaluating model performance include:

Negative log-likelihood per token (logarithm of perplexity) for language modeling; Accuracy, precision, recall, and F1 score for classification tasks; Mean squared error (MSE) or mean absolute error (MAE) for regression tasks; Elo rating in a competition against other models, such as gameplay or preference by a human judge. Performance can be improved by using more data, larger models, different training algorithms, regularizing the model to prevent overfitting, and early stopping using a validation set. When the performance is a number bounded within the range of [ 0 , 1 ] {\displaystyle [0,1]} , such as accuracy, precision, etc., it often scales as a sigmoid function of cost, as seen in the figures.

Examples

… excerpt ends here. Continue reading the full article.

Illustrations

Neural scaling law: Performance of AI models on various benchmarks from 1998 to 2024
Performance of AI models on various benchmarks from 1998 to 2024
Neural scaling law: Amortized hardware and energy cost to train frontier AI models over time
Amortized hardware and energy cost to train frontier AI models over time
Neural scaling law: MMLU performance vs AI scale as a sigmoid
MMLU performance vs AI scale as a sigmoid
Neural scaling law: BIG-Bench (hard)[8] performance vs AI scale as a sigmoid
BIG-Bench (hard)[8] performance vs AI scale as a sigmoid
Neural scaling law: Performance on several benchmarks vs negative log-likelihood loss 
  
    
      
        L
      
    
    {\displaystyle L}
  
 (with 
  
    
      
        
          L
          
            0
          
        
      
    
    {\displaystyle L_{0}}
  
 removed), fitted as sigmoid functions[9]: Figure 2
Performance on several benchmarks vs negative log-likelihood loss L {\displaystyle L} (with L 0 {\displaystyle L_{0}} removed), fitted as sigmoid functions[9]: Figure 2

Worked examples

Example 1 — a first encounter with Neural scaling law

Start with the simplest possible case. Write down what Neural scaling law claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Neural scaling law before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Neural scaling law ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Neural scaling law

In research
Neural scaling law appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Neural scaling law in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Neural scaling law is common in secondary-school and first-year university syllabi. It links to neighbouring topics Artificial intelligence, Artificial neural networks, Deep learning, so understanding it makes those chapters shorter.
In everyday life
Look for Neural scaling law outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Neural scaling law in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Neural scaling law means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Neural scaling law out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Neural scaling law in simple terms?

In machine learning, a neural scaling law is an empirical scaling law that describes how neural network performance changes as key factors are scaled up or down. These factors typically include the number of parameters, training dataset size, and training cost.

Why does Neural scaling law matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Neural scaling law?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Neural scaling law.

Tags

  • Artificial intelligence
  • Artificial neural networks
  • Deep learning
  • Power laws
  • Statistical laws

Keep exploring