Log inStart free
LESSON 34.C1 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Cutting cost per token

Watch six techniques cut one chat workload's cost per token, one after another.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 34.C1 · COST WATERFALLSTART $0.511 PER 1M · 92.1 MS A REQUEST · 5 H100S
01
Stage 1 of 6 · The start
Every request runs the 8B model in FP16, with no cache. The start costs $0.511 per 1M output tokens.
Explain it simply

Each column at the bottom is one of the 12 sample requests. The teal part is the prompt, the blue part the answer. In request-level batches every answer waits for the longest, 420 tokens, and the brick part is that padding. Together they cost $0.511 for each million answer tokens.

A cost waterfall with one bar: the start at $0.511 per 1M output tokens. Below, 12 request columns of prefill, decode and padding time.

prompt tokensoutput tokens, cost; faint: 1B model workpadding, wrong answers, savings past $0cost cut
$0.0$0.1$0.2$0.3$0.4$0.5$0.511$0.511start5 H100sbatchingprefixcacheINT8weightspromptsrouteranswercachenow5 H100s88Q0189Q0288Q0391Q0494Q0592Q0688Q0795Q0889Q0992Q10102Q1198Q12$ per 1M output tokensGPU ms per requestmean 92.1 ms$0.0$0.1$0.2$0.3$0.4$0.5$0.511$0.511start5 H100sbatchingprefixcacheINT8weightspromptsrouteranswercachenow5 H100s88Q0189Q0288Q0391Q0494Q0592Q0688Q0795Q0889Q0992Q10102Q1198Q12$ per 1M output tokensGPU ms per requestmean 92.1 ms
Toy: 12 help-chat requests (34.C1), 2.7M a day; 8B and 1B models on H100s at a toy $4.00 an hour; busy GPU time only
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
c=tˉ⋅Nday⋅$4/h540M tokens\sy{c}{out}{c} = \dfrac{\sy{t}{ink}{\bar t}\cdot N_{\text{day}}\cdot \$4/\text{h}}{540\text{M tokens}}
c=92.1 ms⋅2.7M⋅$4/h540M=$276540M≈$0.511 per 1Mc = \dfrac{92.1\text{ ms}\cdot 2.7\text{M}\cdot \$4/\text{h}}{540\text{M}} = \dfrac{\$276}{540\text{M}} \approx \$0.511\text{ per 1M}

Cost per token is GPU time a request, priced and spread over the tokens.

Common mix-ups

MYTHThe savings of the six techniques add up.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With INT4 weights, is the final cost per token lower or higher than with INT8?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.