The alpha, twice a week
That was 8 min.
Get the best new moments in your inbox every Wednesday and Saturday. It's free.
Check your inbox
We sent a link to your address. Click it to finish signing up. Not there in a minute? Look in spam.
or
Dwarkesh Podcast · 8 min · Apr 29, 2026
API price tiers can reveal a model's context-memory costs
Reiner Pope uses a context-length price increase to estimate where memory costs overtake compute, then backs out bytes per token.
The episode’s best minutes
Full analysis- 1:23:56Serving demand may push models far past Chinchilla optimal8 min
- 1:33:10API price tiers can reveal a model's context-memory costs8 min
- 3 more moments in the full episode
“we can solve for the number of bytes per token if we sort of make some assumptions about the number of active parameters”
Reiner Popeat 1:35:42 · Dwarkesh PodcastTakeaways
- A price jump can indicate a memory-bandwidth crossover.
- The estimate lands near two kilobytes per context token.
- Different attention designs can produce similar memory footprints.
About this segment
Reiner Pope uses a context-length price increase to estimate where memory costs overtake compute, then backs out bytes per token. The result offers clues about attention and KV-cache design from public prices.
Reiner Pope is CEO of MatX.
Co-founded MatX to design chips for LLMs, betting on HBM and SRAM; former Google TPU architect.

Dwarkesh Patel, Host · Host, Dwarkesh Podcast
Co-wrote The Scaling Era, an oral history of AI; named to TIME100 AI.
From “How GPT, Claude, and Gemini are actually trained and served – Reiner Pope”, Apr 29, 2026. Watch the full episode
Thanks. We'll look at and fix what's off.
Transcript
Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.
- 1:33:23
at a high level I understand why that might be but why specifically 50%? Yeah so I mean why specifically 50% let's sort of so the high level even in the first place is there is some amount of increasing cost with context length and we can bring that back up that was the the memory time versus the compute time. So, okay, so we've put up these same equations from before of the time for memory fetches, which is the weights and the KB cache, and then the time for the compute, which is just the matrix multiplications for the weights.
- 1:34:05
I will also draw the cost curve. But this time I'll do it as a function of context length instead of as a function of batch size. um so this is time over yeah just just time uh so this is the cost curve as a function of context length um we'll draw the compute um the the cost of the compute is actually constant as a function of context length there's no dependence here on context length in reality there is some dependence but it is very mild dependence so we'll ignore it um so this is the um time for the compute this one. And then we'll also draw the dependence of the memory fetch on context length.
- 1:34:55
And this starts at a large number for the weights and then grows gradually with the context length. So maybe here and then grow gradually with context length. And so you take the maximum and you see there is this inflection point here. So now, so this is the costs that, for example, Gemini might be paying. And then you think, how might you put a pricing structure on top of that? You would like to ensure that no matter what the context length is, you are still profitable.
- 1:35:31
Interesting. And so we've got a two-tier pricing structure. Maybe we've got something that looks like this up to some next context. Fascinating. So I think it says something about, given that the bump is at 200K, it probably means that this is somewhat aligned with this crossover point. Maybe not exactly aligned with. Fascinating. So we can actually probably even complete that calculation just… see where it lands out we can solve for the number of bytes per token if we sort of make some assumptions about the number of active parameters so solving for the number of bytes per token we're going to assume like the point where we equalize the time of memory and the time of compute is that let's say 200k tokens so we equalize these two we're also going to just assume that the batch size is large enough
- 1:36:20
that the memory time spent on weights is negligible. So we'll forget about this and we'll focus on the actual memory time spent on KB cache. So that ends up saying copying this term over batch times len context times bytes of the token over mem bandwidth is going to be equal to number activated params over flops. And then we're going to solve for bytes per token. Match size was missing here, shows up here, and then it cancels out by the time we get to here.
- 1:37:31
And I dropped the LEN context. So we can plug in numbers. This number, this is the reciprocal of the number that we saw before. Yeah, this is like 1 over 300, which is reasonably stable across many different hardware platforms. forms. We conjecturally said that maybe number of activated tokens is like 100 billion, and length of the context we said was 200k. Something is wrong here though. Length of the context should be on the denominator, not the numerator.
- 1:38:21
1, 6, 6, 7, like about one kilo, almost two kilobytes. That is plausible, actually. So you said around two kilobytes. So let's just do a sanity check for this, what this could be. There are two mechanisms that people do attention with a small number of bytes per token. One is denser tension with a lot of reuse across layers. So Character.ai has a blog post talking about that, alternating long and short context.
- 1:38:57
And like in the Character.ai kind of model, which also showed up in the Gemma models, the global context, which is really what we're talking about here, global context, was shared across all the layers. And so to get this two kilobytes, you could get that, for example, as a dhead of 128. is typical, and then like the number of bytes is typically number of attention layers times two times dhead times number of qheads.
- 1:39:41
so um this is the number of unique contexts per layer do you have do you share the context across many layers or do you use it only once um uh so in character ai like models uh, this number is one. Um, we said this is 100, 128. Um, and, uh, this is a choice which typically ranges from one, uh, sorry, this is KV heads, I meant. Um. So there was written a head and a KV head is that? The KV heads are the heads that are stored in memory, like store the contents of the previous tokens. The Q heads are the, um, the retrieval heads there. They're only used temporarily and they're used by the attending token.
- 1:40:24
So in this auto-aggressive context, I've got KV heads associated with all of the context and then Q heads associated with this new token here. But this head, the 128? Oh, this is... This number is actually the same for... Oh, so this D head is the dimension of the vector. Ah, yeah. And number of KV heads is typically in the range of 1 to 8. So, like, it is totally plausible to get this by, For example, having eight KB heads and a D head of 128, that gives you exactly this number.
- 1:40:57
Or you could have fewer KB heads, but more layers. So this is one way to get there via denser tension. There's also a way to get there via sparse attention, where you increase all of these numbers, but then you have a lot of sparsity term. So yeah, I mean, I think this number is plausible, if maybe a little bit small. It's funny that they would leak so much information through their API pricing. I mean, you are incentivized to price close to your costs