AI Pub Profile picture
Aug 30 19 tweets 7 min read
// SCALING LAWS, Explained (Part I) //

You've heard "Scale is All You Need", seen graphs with straight lines going down, others muttering that "AGI is coming".

What exactly are scaling laws? What is being scaled? And why is everyone excited (or scared) about them?

1/18
First, a summary in two tweets:

Scaling laws show that large language models' (LLMs') loss decreases when you increase the model's:
- # parameters,
- training data,
- training compute budget

In a mathematically predictable way.

2/18
Why does this matter?

It means we don't need to make theoretical or architectural advances to significantly power up LLMs.

Just let the GPUs rip, baby!

(There's a second, much more important reason at the end of the thread!)

3/18
Now, the details. First, the form of the law:

With L the test loss,

x = one of compute, dataset size, or model parameters, and *not* bottlenecked by the other two, empirically we find

L = C/x^a

For constants C and a that depend on the scaling type (see below!).

4/18
Alternatively we have log L ~ -log(a)*log(x), so a linear relationship on a log-log scale.

(Hence the straight-line log-log charts.)

5/18
What's the loss L, you ask?

It's the "cross-entropy", which in this case is also equal to the (average) log-likelihood. Formula below!

Intuitively, it's the (scaled, -log) chance that your LLM would actually generate your text dataset. You want this chance to be high.

6/18
Now that you get the basics, here's a puzzle:

The scaling law exponents are between 0.05 and 0.1. These exponents are tiny.

Concretely, if you 1,000x'd your training data, your loss would only go down by a factor of 1/(1,000)^0.1 ~ 50%!

So why care about scaling laws?

7/18
Here comes the kicker - why you should *actually* care about scaling laws, why some say "Scale is All You Need", why others say "AGI is coming":

*Minor* improvements in test loss give *massive* generalization and new capabilities for LLMs.

An example from DeepMind:

8/18
DeepMind trained two LLMs, Gopher and Chinchilla.

Chinchilla was trained more efficiently resulting in a cross-entropy of 1.97, vs. Gopher's 2.05 - only a 4% improvement.

Yet Chinchilla blew Gopher out of the water on a range of high-level tasks like high school math.

9/18
Specifically, Chinchilla performed on average 10x better than Gopher on MMLU, a multitask language understanding dataset ranging from exams in professional medicine to high school chemistry.

Chinchilla beat Gopher by over 30x in college physics, with only 4% lower loss!

10/18
This is *real* reason to care about scaling laws, why some say that "AGI is coming". The reasoning chain is:

1. Scale up data, params, GPUs go brrr -->
2. *Minor* yet predictable decrease in model loss -->
3. *Massive* increase in LLM capabilities.

Be afraid! (perhaps)

11/18
That's a wrap on scaling laws! If you read the thread carefully, you now understand:

1. The mathematical form of scaling laws
2. The cross-entropy loss
3. That scaling laws lead to minor improvements in loss...
4. But massive improvements in LLM capabilities

12/18
This thread was an introduction to scaling laws, and largely a walk-through of OpenAI's 2020 paper that discovered them.

Later this week we'll do Part II on the limits of scaling laws, scaling laws and data, and the 2022 Chinchilla paper!

arxiv.org/abs/2001.08361

13/18
To buy the shirt from this thread, made by @ethanCaballero, go here: agiwear.ai

(Not a paid promotion, lol)

14/18
For those new to the channel, a bit about us:

We now do 3 things (with more cooking in the kitchen...):

1) We publish explainer threads like the one you just read. Here's another on Stable Diffusion that blew up last week:

15/18
2) We publish a weekly "Best of AI Twitter" thread - here's last week's:

16/18
3) We're building a job board for ML engineers and SWEs who want to work on ML products - out in a week!

We're also building on a solution to match the above talent with companies building cutting-edge ML products, but that'll take a month or two.



17/18
That's a wrap! Check in later this week for the job board and Part II on scaling laws.

Comments and DMs are always open if there's an explainer thread topic you'd like covered!

Oh, and tomorrow I'll post a thread of resources to learn more about scaling laws.

18/18
To learn more about scaling laws, check out these resources:

19/18

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with AI Pub

AI Pub Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @ai__pub

Aug 31
Here are the resources I used to learn about scaling laws!

1/13 Image
Gwern: The Scaling Hypothesis
gwern.net/Scaling-hypoth…

2/13
Rich Sutton: The Bitter Lesson
incompleteideas.net/IncIdeas/Bitte…

3/13
Read 13 tweets
Aug 28
Are you hiring MLEs or SWEs working on ML products?

AI Pub is building a job board + talent-matching service, and we want to understand hiring pain points.

If you're hiring in ML/ML SWE, we'd *love* your feedback in the form here:

docs.google.com/forms/d/e/1FAI…
*All* questions are optional, feel free to only answer one!

Also, we include the option to share your (anonymized) feedback in tweet form.

For those who answered "yes", we'll share selected feedback in the thread below.

docs.google.com/forms/d/e/1FAI…
1) Stripe ML executive: "We’re not too hung up on specific talent profile - primarily looking for someone who has interest and proven capability to ship sufficiently advanced ML to production."
Read 4 tweets
Aug 21
// Stable Diffusion, Explained //

You've seen the Stable Diffusion AI art all over Twitter.

But how does Stable Diffusion _work_?

A thread explaining diffusion models, latent space representations, and context injection:

1/15
First, a one-tweet summary of diffusion models (DMs).

Diffusion is the process of adding small, random noise to an image, repeatedly. (Left-to-right)

Diffusion models reverse this process, turning noise into images, bit-by-bit. (Right-to-left)

Photo credit: @AssemblyAI

2/15
How do DMs turn noise into images?

By training a neural network to do so gradually.

With the sequence of noised images = x_1, x_2, ... x_T,

The neural net learns a function f(x,t) that denoises x "a little bit", producing what x would look like at time step t-1.

3/15
Read 16 tweets
Aug 19
I'm making a short video explaining Stable Diffusion!

But first, I have to learn how Stable Diffusion works...

I'll populate the thread below with the best resources I've found to understand Stable Diffusion at a medium level of technical sophistication.
1) The SD paper itself:

Clearest, most detailed resource. But easy to digest only if you have the background concepts!

I typically skim a paper quickly, then read blogs/watch videos to understand background, then return to the paper to read in detail.

arxiv.org/pdf/2112.10752…
2) This video by @AssemblyAI:

Love the principle of explaining at multiple levels of difficulty.

To speed-watch this video, watch 2:24-2:45 and 5:05-6:15 and you'll understand the whole thing.

Read 5 tweets
Aug 18
Last week in AI Twitter (Aug 11-18).

10 items, including #stablediffusion and AI art, mind-blowing research results, new dev tools, new products, and a naming controversy:
1. #stablediffusion is top of the list.

Crazy demo applying Stable Diffusion to video editing from @pess_r. @runwayml is building cutting-edge products in this space.

1+. Hugging Face begins rolling out libraries and support for Stable Diffusion, full public release in the next few days.

Elsewhere, Stable Diffusion weights are leaked (@StabilityAI planning on releasing soon anyways).

Read 14 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(