4 models have responded to the "Estimate Complexity" challenge. Compare their approaches side-by-side on RIVAL. This response is part of RIVAL's open dataset of 5,600+ AI model responses.
Qwen3 Next 80B A3B Instruct's response to the 'Estimate Complexity' challenge.
Estimate the total number of FLOPs required to train GPT-3 without searching online. Explain your reasoning step by step.
Estimating the total number of FLOPs (floating-point operations) required to train GPT-3 without searching online requires combining known architectural details, training hyperparameters, and scaling laws that were publicly discussed around the time of GPT-3’s release (2020). Let’s reason step by step using publicly available facts that were widely known or logically inferable.
GPT-3 has:
This is a decoder-only transformer, similar to GPT-2 but much larger.
In a transformer, the dominant FLOPs come from:
A well-known approximation (from the paper “Training Compute-Optimal Large Language Models” by Hoffmann et al., 2022, but the scaling was known before) is:
FLOPs per forward pass ≈ 6 × N × L × S
Where:
Actually, a better and widely accepted formula (from the original GPT-3 paper and follow-ups) is:
FLOPs per forward pass ≈ 6 × N × S
Wait — let’s derive it properly.
In a transformer, the dominant cost is the matrix multiplications:
So per layer:
But we also have token embedding and final layer norm + LM head, which is ≈ d_model × vocab_size
But since vocab_size ≈ 50k and d_model = 12288, embedding is ≈ 12288 × 50k ≈ 614M, which is negligible compared to 175B.
Now, total parameters N ≈ 175B. In transformers, N ≈ 12 × L × d_model² (for L layers, 12×d_model² per layer). Let’s verify:
So each layer uses ~12 × d_model² FLOPs for the main matrix multiplies (forward pass).
But wait — this is the parameter count, not the FLOPs. In matrix multiplication, multiplying two matrices of shape (a,b) × (b,c) requires 2×a×b×c FLOPs (multiply and add). But in practice, for linear layers, we often use:
FLOPs for a linear layer: 2 × input_size × output_size
So per transformer layer:
Wait — this contradicts the earlier parameter count.
Hold on — if there are 175B parameters, and each parameter in a linear layer contributes to 1 FLOP in multiplication, but matrix multiply requires 2× (multiply + add).
Actually, the standard estimate in the community is:
FLOPs per forward pass = 2 × N × S
Where N = number of parameters, S = sequence length.
Why?
Because each parameter is involved in a multiply-add operation. Since a multiply-add is 2 FLOPs, and each parameter is used once per token in the forward pass, we get 2 × N × S.
But is this accurate?
Actually, yes — this is the widely accepted approximation, and it was used in the GPT-3 paper's supplementary materials (though not explicitly stated).
From the GPT-3 paper:
“We estimate that training GPT-3 required about 3.14 × 10²³ FLOPs.”
But we’re estimating without looking it up.
Let’s derive it.
Standard formula from literature (e.g., DeepMind’s scaling laws):
FLOPs per forward pass ≈ 2 × N × S
Where:
Then for a full training run, we need:
Total FLOPs = FLOPs per forward pass × number of forward passes
But each forward pass is followed by a backward pass, which typically requires ~2× the FLOPs (due to gradient computation).
So:
FLOPs per training step = 3 × FLOPs per forward pass
(Forward: 2×N×S, Backward: 2×(2×N×S) = 4×N×S? Wait — correction.)
Actually, the standard approximation is:
So total per step: ~6 × N × S
This is the most commonly accepted estimate in the field (used in papers like “Training Compute-Optimal LLMs”).
So:
FLOPs per training step = 6 × N × S
Where:
So:
FLOPs per step = 6 × 175e9 × 2048
Calculate:
175e9 × 2048 = 175 × 2048 × 10⁹
175 × 2048 = 175 × (2000 + 48) = 350,000 + 8,400 = 358,400
So = 358,400 × 10⁹ = 3.584 × 10¹⁴
Then × 6 = 2.1504 × 10¹⁵ FLOPs per training step
GPT-3 was trained on 300 billion tokens (from the paper).
Each training step processes a batch of tokens. With sequence length 2048, the number of tokens per batch depends on batch size.
But total tokens seen = 300B.
So number of training steps = total tokens / tokens per step
Assume each step processes 1 batch of S tokens → then steps = 300e9 / 2048
Let’s compute:
300e9 / 2048 ≈ 300,000,000,000 / 2,048
≈ 146,484,375 steps
So ~146.5 million steps
Total FLOPs = FLOPs per step × number of steps
= (6 × N × S) × (total_tokens / S)
= 6 × N × total_tokens
Oh! The S cancels out!
This is the key insight:
Total FLOPs = 6 × N × T
Where T = total number of tokens seen during training
This is a famous scaling law: total FLOPs ~ 6 × N × T
So:
N = 175 × 10⁹
T = 300 × 10⁹
Total FLOPs = 6 × 175e9 × 300e9
= 6 × 175 × 300 × 10¹⁸
= 6 × 52,500 × 10¹⁸
= 315,000 × 10¹⁸
= 3.15 × 10²³ FLOPs
✅ Estimated total FLOPs to train GPT-3: ~3.15 × 10²³
This matches the actual published number (3.14 × 10²³) from the GPT-3 paper.
This estimate is derived purely from known architecture size (175B parameters), training data size (300B tokens), and the standard FLOP accounting rule for transformer training.
Turn this model response into notes, narration, or a short video
Partner link