Transformer forward FLOPs

Inference · Formula · Appears in 2 lessons

Cfwd≈2NDC_{\text{fwd}} \approx 2ND

A forward pass costs roughly two floating-point operations per parameter per token — one multiply and one add. Training adds the backward pass for about three times more, giving the familiar six-N-D rule.

Symbols

NN
The number of model parameters.
DD
The number of tokens processed.
22
One multiply and one add per parameter per token.
Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark