Late last year, Open AI's ChatGPT introduced the wider world to the immense power of artificial intelligence (AI). However, pharmaceutical companies have been experimenting with various forms of next-generation AI since the middle of the last decade. These AI systems can help accelerate drug discovery, optimize clinical trials, and improve patient outcomes. This tool opens up new possibilities for creating novel therapies that can improve the lives of millions of patients.

AI is thus poised to radically transform the pharmaceutical industry. Two of the leading players in this field are Eli Lilly (LLY 1.19%) and GSK (GSK 0.49%), both of which have invested heavily in AI technologies and partnerships. But which of these two stocks is a better buy for investors who want to capitalize on the AI revolution in pharma? Here is a brief comparison of their strengths and weaknesses. 

The case for Eli Lilly

In a recent deal worth $250 million, Chinese AI company XtalPi partnered with Lilly to leverage its cutting-edge AI and robotics technology for drug discovery and development. XtalPi's AI platform can accelerate the identification and optimization of novel drug candidates for various diseases. The specific disease area and the target of the joint project were not revealed by Lilly, but the company expects to initiate clinical trials of the new drug soon. This partnership could potentially transform the way big pharma companies approach drug discovery for unmet medical needs.

Besides its newly minted AI venture, Lilly sports top-tier franchises in cardiovascular care, cancer, diabetes, neuroscience, immunology, and pain management. Lilly's stock has been soaring in recent years, fueled by the high hopes for its potential treatments for obesity and Alzheimer's disease.

However, the company's valuation is very high compared to its peers, as it trades at more than 52 times projected earnings. To put this valuation metric into the proper context, the average forward-looking price-to-earnings ratio among big pharma stocks is currently 20.2. Lilly's future valuation thus depends heavily on its ability to succeed in these two highly competitive drug markets.

The case for GSK

GSK is a pioneer in applying AI to the pharma industry. The company has developed its own AI and machine-learning expertise and has also partnered with leading players in the field to boost its clinical pipeline. For instance, GSK teamed up with Tempus, a precision medicine company, last year to leverage its AI-powered platform to improve clinical trial design, patient recruitment, and target discovery. Moreover, these kinds of novel platform investments have resulted in a twofold increase in the number of early-stage compounds in GSK's pipeline since 2017, according to the company.

This is good news for investors. GSK has fallen behind the industry in terms of innovation in several important therapeutic areas -- especially in cancer. Consequently, its shares have significantly underperformed the broader markets, as well as most of its big pharma peers over the past 10 years. GSK also has one of the lowest valuations in the sector, with its shares trading at less than 10 times projected earnings at the moment.

Therefore, GSK may rely on AI more and more in its attempt to turn things around.

The verdict

Which of these AI pharma stocks is the better buy right now? Lilly is a high-priced stock with promising prospects in obesity and Alzheimer's disease. However, the drugmaker's high valuation may be reasonable even without considering the possible impact of AI on its drug discovery and development efforts, as discussed here.

On the other hand, GSK is a company undergoing changes, with AI as a potential catalyst for its growth. However, GSK has not yet persuaded the market that its AI investments are indeed capable of driving a turnaround. Therefore, Lilly appears to be the more appealing option of these two AI-pharma stocks right now.