June 6, 2018 2 min read

For those with demanding schedules that frequently infringe upon a full night’s sleep, chugging coffee or energy drinks is often the cure to drowsiness. You’ve probably poured yourself a third, fourth, fifth cup of joe at some point and thought, is this even helping?

You might associate coffee binges with office workers or business leaders rushing from meeting to meeting, but members of the military also run on the stuff. That’s why U.S. Army researcher Jaques Reifman has set out to crack the code of how much coffee we truly need when we’re sleep deprived -- and at what intervals.

His research, summarized by the American Academy of Sleep Medicine, shows promise for optimizing caffeine intake, taking into account metabolic or other physiological differences from person to person.

Related: Is Caffeine Boosting or Sabotaging Your Productivity?

Reifman studied how sleep loss and caffeine consumption influence performance on “psychomotor vigilance tasks” -- tasks which measure response time, or alertness. He then devised an algorithm to inform individuals of how much caffeine to consume, and when to consume it throughout the day, to maximize their alertness.

To use the algorithm, each person inputs information about their sleep schedule and the maximum amount of caffeine they’d like to consume or that they normally consume. From there, the algorithm tells them how much to consume and when.

Reifman has found that following the recommendations of his algorithm can increase a person’s alertness by 64 percent if they're consuming the same amount of caffeine as they normally would, but on a strategic schedule. On the other hand, for those who want to cut back, he’s also found that individuals can drink up to 65 percent less caffeine than normal, but on an algorithmically generated schedule, and experience the same level of alertness as they would with their normal dosage, sans schedule.

If you're interested in trying the formula for yourself, there’s good news: the Army intends to license the technology,reports. Right now though, only soliders in training are reaping its benefits.