Case files · 01
Caffeine Lab
A pharmacokinetic simulator that predicts when caffeine stops working, by how much, and how to avoid it.
Diagnosis
With daily use, caffeine loses its effect. The reason is counter-intuitive: the brain makes more adenosine receptors, and the same dose blocks an ever smaller fraction of them.
Treatment
A five-stage model (pharmacokinetics, receptor blockade, memory, adaptation, effect) calibrated on the literature, with Monte Carlo uncertainty bands and a web app to try it.
Outcome
59 simulated scenarios and a few clear rules: concentrate the dose, leave zero days, take a break instead of escalating. Plus a 12-minute explainer video.
The phenomenon
The more coffee you have, the less it works. The explanation, though, isn’t that receptors “wear out”: it is the exact opposite. Caffeine blocks the A1 and A2A receptors for adenosine, the signal we build up while awake that pushes us towards sleep. The brain reads chronic blockade as a lack of signal and makes more receptors. With more receptors, the same dose occupies a smaller fraction of them: that is tolerance. When you stop, the extra receptors fill up with adenosine and the rebound arrives, with headaches and fatigue.
The model
Doses (mg, time, days)
↓ [1] PHARMACOKINETICS one compartment + absorption (t½ ≈ 5 h, ka = 2.5/h)
C(t)
↓ [2] BLOCKADE mass action on the A2A and A1 affinities
f(t)
↓ [3] MEMORY exponential moving average, τ = 36 h
S(t)
↓ [4] ADAPTATION up/down-regulation of receptor density
R(t)
↓ [5] EFFECT with receptor reserve: intact while R stays below threshold
E(t)
The parameters are calibrated with a grid search on the data from Lara and colleagues (2019, PLOS ONE), 3 mg/kg per day for 20 days, and checked against two more anchors: sensitivity returning after two weeks of abstinence, and PET studies on the reversible increase of brain A1 receptors.
What I found
- The daily threshold. One espresso a day (70 mg) keeps 100% of the effect after 12 weeks; 150 mg drops to 76%; from 200 mg up it plateaus around 68–70%.
- The pattern beats the dose. With the same weekly caffeine, every other day keeps the full effect, while spreading the dose across three coffees a day is the worst choice (47%).
- Escalating is a losing strategy. Chasing the same effect would take 274 mg on day 7, 522 on day 15, more than 800 on day 30.
- The reset. One week off is enough to get back close to 100%; the biological return of the receptors takes 13–16 days.
I wrote about them at length in a note.
The web app
Caffeine Lab brings the same model to the browser, through a JavaScript port checked against the Python results:
- Caffeine now: how much is circulating, as a range (it depends on the form you took it in and how fast you metabolise it), with the time left until you drop below 50 mg;
- Receptor status: mark the days you had caffeine and see sensitivity, receptor density and the break you need, with Monte Carlo bands.
Epistemic honesty
The parameters are phenomenological, not direct physiological measurements; every prediction is reported with its uncertainty band. The next step is an N-of-1 model: updating the parameters with one person’s data, the Bayesian way. It is not medical advice: it is a study tool.