EasyDeepLearn

How much does it cost to pretrain a modern LLM?

hard

Answer

  • Rule of thumb: 6*N*T FLOPs, where N = parameters and T = training tokens.
  • LLaMA-3 8B on 15T tokens = ~7.2e23 FLOPs.
  • On an H100 doing ~1e15 FLOPs/s in bf16 (~50% MFU), that's ~1.5M GPU-hours (~35Matcloudprices).GPT4estimatedat1025MH100hours( 3-5M at cloud prices). GPT-4 estimated at 10-25M H100-hours (~60-100M).
  • Frontier training is 10-100x more expensive than fine-tuning; inference at scale often dominates lifetime cost.
Check yourself — multiple choice
  • A few thousand dollars
  • 6·N·T FLOPs → LLaMA-3-8B ~ 35M;GPT4estimated3-5M; GPT-4 estimated60-100M; inference at scale often dominates
  • Free with public GPUs
  • Independent of data size

Training cost ~ 6·N·T; frontier LLMs cost 10M10M-100M+ in compute alone.

#pretraining#cost#production

Practise LLMs & GenAI

214 interview questions in this topic.

Related questions