Are You Drinking Coffee Right? Army Scientists Create Algorithm for the Perfect Caffeine Hit

6_7_Coffee Cups
When taken at just the right time, in just the right dose, coffee can keep you alert when you’re short on shut-eye. But exactly how much coffee should you be drinking? Getty Images

Perhaps you drink coffee for the smooth, rich taste. Or maybe you crave the surge of energy from a solid caffeine hit. However you take your cup of joe, the stimulant can run riot through your system—speeding up your heartbeat and even giving you the shakes.

But, when taken at just the right time, in just the right dose, coffee can keep you alert when you're short on shut-eye. Now, U.S. Army scientists have developed an algorithm to harness the power of the nation's favorite tiredness-targeting stimulant.

"About 40 percent of U.S. Service members sleep less than five hours per night on a regular basis, while the required sleep to fully restore one's mental acuity is between 7 and 8 hours per night," Jaques Reifman, a senior research scientist at the U.S. Army Medical Research and Materiel Command at Fort Detrick, Maryland, told Newsweek. "Nevertheless, many military tasks requires considerable vigilance."

His team wanted to make full use of the "restorative effects" of caffeine to combat the fatigue of sleep deprivation, he explained.

"We found that by using our algorithm, which determines when and how much caffeine a subject should consume, we can improve alertness by up to 64 percent, while consuming the same total amount of caffeine," Reifman said in a statement.

The research also showed the java-shy could cut their caffeine consumption by up to 65 percent and still experience a similar increase in alertness.

Related: The world's most expensive cities for a cup of coffee

Scientists built their algorithm by evaluating caffeine dosing strategies detailed in a number of experimental sleep loss studies. The algorithm used this data to model the effects of caffeine and sleep deprivation on participants' success in certain "psychomotor vigilance" tasks. PVTs include tasks like pressing a button as fast as you can when a light appears on a screen.

Users feed the algorithm with their sleeping schedule, as well as an overall caffeine limit. In return, the program provides personalized caffeine dosing recommendations.

"Our algorithm is the first quantitative tool that provides automated, customized guidance for safe and effective caffeine dosing to maximize alertness at the most needed times during any sleep-loss condition," Reifman said in the statement.

Researchers are currently integrating the optimization algorithm into the publically-available 2B-Alert App, which aims to understand and predict a user's responses to caffeine and sleep deprivation. Reifman said the technology could be particularly useful for shift workers like airline pilots and doctors.

Related: Tea leaf nanoparticles destroy up to 80 percent of lung cancer cells

Reifman is principal investigator for the research, which was presented at this week's SLEEP 2018 conference in Baltimore and written up in the journal Sleep. A full research paper is set for publication in the Journal of Sleep Research.

This is the latest update in what's been a big week for coffee news. Scientists with the Institute for Scientific Information on Coffee have published a report on the ins and outs of caffeine sensitivity, and an Australian government agency has found a way to enhance the coffee experience with an ingredient you might not expect: broccoli.

Updated | This article has been updated to include comment from Jaques Reifman