6.1.2 · HinglishScaling & Efficient Architectures

Compute-data-parameter tradeoffs

1,851 words8 min readRead in English

6.1.2 · AI-ML › Scaling & Efficient Architectures


WHY — hume kyun parwah karni chahiye?

WHY ? Har token ke liye roughly chahiye:

  • 2 FLOPs per parameter forward pass ke liye (ek multiply + ek add per weight = 2 FLOPs).
  • ~4 FLOPs per parameter backward pass ke liye (weights aur activations ke w.r.t. gradients, ≈ forward cost se do guna).

Toh total per token ≈ FLOPs. tokens ke upar:


Optimization problem (Chinchilla)

Empirical scaling law (Hoffmann et al., "Chinchilla", 2022) fit karta hai:

Optimum KAISE dhundhein — derive karo

Hum ko minimize karte hain (fixed budget) ke subject to.

Step 1 — constraint substitute karo. Kyun? 2-variable constrained problem ko 1 variable mein convert karne ke liye. se: .

Step 2 — differentiate karo aur zero pe set karo. Kyun? Ek smooth curve ke minimum ka slope zero hota hai.

Step 3 — ke liye solve karo. Kyun? Hume chahiye ki ke saath kaise scale karta hai. Terms move karo:

Step 4 — nikalo. Kyunki hai, .

Figure — Compute-data-parameter tradeoffs

Worked examples


Common mistakes


Flashcards

C, N, D ko link karne wali compute identity kya hai?
(2 FLOPs/param forward + 4 FLOPs/param backward, per token, D tokens ke upar).
mein 6 ka factor kyun?
2 FLOPs/param forward + 4 FLOPs/param backward (weights aur activations ke w.r.t. grads) = 6 FLOPs per parameter per token. (FMAs mein 3 hai, kyunki 1 FMA = 2 FLOPs.)
Chinchilla loss law likhiye.
: irreducible + parameter-limited + data-limited terms.
N_opt compute C ke saath kaise scale karta hai?
(Hoffmann et al. ka reported a≈0.46).
D_opt compute C ke saath kaise scale karta hai?
(b≈0.54).
Exponents a aur b ka sum 1 kyun hona chahiye?
Kyunki hai, toh ke liye a+b=1 chahiye.
Tokens per parameter ke liye Chinchilla rule of thumb?
~20 tokens per parameter.
GPT-3 suboptimal kyun tha?
Apne data ke liye bahut bada: ~1.7 tokens/param vs optimal ~20; data-starved, over-parameterized.
Chinchilla se kab deviate karo aur ek chhote model ko over-train karo?
Jab inference cost dominate kare — chhota model + zyada data serve karna sasta hota hai.
N_opt derive karte waqt kaun sa constraint substitute karte ho?
compute identity se, phir L(N) minimize karo.

Recall Feynman: ek 12-saal ke bachche ko samjhao

Socho tumhare paas ek fixed amount paisa hai ek robot banane aur sikhane ke liye. Paisa kharch kar sakte ho robot ka brain bada karne mein (zyada parameters) ya usse padhne ke liye zyada kitaabein dene mein (zyada data). Agar bahut bada brain banao lekin sirf ek kitaab do, toh woh smart hai lekin kuch jaanta nahi. Agar ek chhote brain ko ek million kitaabein do, woh sab yaad nahi rakh sakta. Trick hai balance: thoda bada brain, thodi zyada kitaabein — brain ke har bit ke liye ~20 pages. Yahi balance tumhare paison ke liye sabse smart robot deta hai.

Connections

  • Neural Scaling Laws — power-law backbone jisme yeh note fit hota hai.
  • Chinchilla vs GPT-3 — empirical head-to-head.
  • FLOP accounting in Transformers — precisely "6" kahaan se aata hai.
  • Inference cost vs training cost — kyun deployment tradeoff change karta hai.
  • Overfitting and capacity — data-starving ke peechhe intuition.
  • Learning rate schedules — token budget se match karna chahiye.

Concept Map

6 FLOPs per param per token

links

fixed budget forces tradeoff

fixed budget forces tradeoff

reduces

reduces

contributes to

contributes to

contributes to

minimize under C

yields

Nopt propto C^0.46

Dopt propto C^0.54

Compute budget C

Parameters N

Tokens D

Identity C approx 6ND

Forward 2N + Backward 4N

Loss L of N and D

Irreducible loss E

Penalty A over N^alpha

Penalty B over D^beta

Compute-optimal split

Exponents a=0.46 b=0.54