Developing new medicines isn’t for the faint of heart. On average, it takes about a decade of research — and an expenditure of $2.6 billion — to shepherd an experimental drug from lab to market. And because of concerns over safety and effectiveness, only about 5 percent of experimental drugs make it to market at all.

But drug makers and tech companies are investing billions of dollars in artificial intelligence with the hope that AI will make the drug discovery process faster and cheaper.

“I believe that AI is a sleeping giant for healthcare in general,” Eric Horvitz, director of Microsoft Research Labs in Redmond, Washington, said last month at the annual meeting of the American Association of the Advancement for Science in Austin, Texas. He said Microsoft was investing in AI for drug design and pharmacology, which studies how drugs act in the body, and called the technology a “tremendous opportunity.”

Microsoft is far from alone in its AI bet. As of late February, the Toronto-based biotech company BenchSci had counted 16 pharmaceutical companies and more than 60 startups using AI for drug discovery.

Biggest bottlenecks

The biggest bottlenecks in drug development usually lie within the early stages of research, especially in the time needed to go from identifying a potential disease target (typically a protein within the body) to testing whether a drug candidate can hit that target.

The most ambitious AI groups, including a private-public consortium dubbed ATOM, are aiming to compress that process — which can take four to six years — into a single year.

Since only 5 percent of experimental drugs make it to market, AI could help improve the long and labor-intensive drug discovery process. KTSDESIGN/Science Photo Library / Getty Images

That lofty goal hasn’t yet been reached, of course. But London-based BenevolentAI, billed as Europe’s largest private AI company, said it had dramatically reduced the amount of trial and error needed to design a drug candidate once a promising disease target had been identified. So far, the company estimates that it can cut the associated costs by 60 percent and reduce the drug design timeframe from three years to one.

Other early gains in AI-directed drug development include more effective combination therapies for HIV, hypertension, infectious diseases, and cancer.

Get the mach newsletter. This site is protected by recaptcha

Predicated on failure

With the odds of successfully developing a new drug so poor, the pharmaceutical industry is “pretty much predicated on failure,” said John Baldoni, head of the new Baltimore-based AI drug discovery unit for the U.K.’s GlaxoSmithKline. But the same testing that weeds out some drug candidates, he said, often contains valuable data that could give other efforts a head start.

From searching through his company’s database, for example, Baldoni and colleagues found more than 230,000 drug candidates that had been designed to hit disease targets in the brain. None of the molecules was a good fit for Baldoni’s project, which is focused on other disease targets, he said. Even so, AI algorithms helped reveal the common features of chemical structures that were able to get into the brain.

Baldoni’s group is now using other AI programs to model how such molecules can be put together in new ways and to predict which parts might help penetrate the brain to hit a disease target — and which might prove toxic.

BenevolentAI has expanded its own repertoire to include more than 20 drug programs targeting rare cancers as well as inflammatory, neurodegenerative, and central nervous system diseases. In an email to NBC News MACH, company chairman Ken Mulvany said the company’s computers are trained to understand biomedical language and look for relationships among drugs, diseases, and proteins in the body.

One of the company's clinical trials is now testing the effectiveness of a failed drug known as bavisant against excessive daytime sleepiness in patients with Parkinson’s disease. When bavisant flopped in a 2012 clinical trial aimed at adults with attention deficit hyperactivity disorder, researchers observed that insomnia was one of its side effects. Modeling work by the company’s AI algorithms confirmed the compound’s potential effect on wakefulness, leading to the clinical trial for Parkinson's-related sleepiness.

BenevolentAI has used other AI computer algorithms to explore new treatment options for amyotrophic lateral sclerosis, or ALS, a degenerative nervous system disease. In 2016 the company identified five drug candidates for ALS within a week. Without AI, the process could have taken years.

Watson takes a hit

Not everyone is convinced that AI will transform drug development, and the “Jeopardy!”-winning machine-learning system known as IBM Watson has attracted more than a bit of negative press in recent months.

In 2016, IBM and Pfizer inked a widely publicized deal to use Watson to accelerate drug discovery in the red-hot field of immuno-oncology, which harnesses the body’s immune system to fight cancer. But many experts have questioned whether Watson is sophisticated enough to make sense of complex medical data.

Although AI is becoming an important tool for drug researchers, some attempts, like the use of Jeopardy's Watson, are becoming less popular. Photographer is my life. / Getty Images

Dr. Alan Aspuru-Guzik, a Harvard University chemist who has developed AI applications for materials science and is now turning toward drug discovery, agreed that the field has seen no shortage of hype. Even so, he believes that “grumpy” naysayers have had little to show for their own efforts and that the field will sort itself out. “It’s always at the interface between fields where exciting things happen, and where there’s a lot of friction too,” he said.

One major challenge is collecting enough reliable information to properly train Watson and other AI systems. “AI is as good as the data,” Aspuru-Guzik said.

Based on one of his own AI strategies for designing molecules for industrial use, he explained how a computer could be better trained in drug design as well. First, he feeds information about hundreds of thousands of druglike molecules into an AI algorithm to help it learn their common features. Eventually, the computer becomes smart enough that it starts churning out predicted drugs on its own.

“Many, many, many times, it’s going to guess garbage,” he said. But scientists can train the computer and improve its accuracy by devising ways to weed out bad guesses and reward good ones.

One method for doing this, called a generative adversarial network (GAN), involves creating a sort of competition between two AI networks. One network, called a generator, guesses at druglike molecules. The other, called the discriminator, says yes or no after each guess. “Both start training as absolutely stupid,” Aspuru-Guzik said. Over time, though, the networks learn from each other to become smarter.

Computers can still be fooled in ways that humans are not, of course, as anyone whose GPS has led to a dead-end or temporary road closure can attest. Aspuru-Guzik believes that artificial intelligence will enhance human abilities but never replace them. “AI will give us all of these superpowers,” he said, “but ultimately a human has to control them and use them.”

FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.