The release of ChatGPT, a generative chatbot developed by the company OpenAI, caused quite a stir. It moved the artificial intelligence (AI) conversation from the tech world to the mainstream seemingly overnight. AI is making headlines, and investors wonder which companies have the upper hand in the arms race.

ChatGPT is innovative because of its ability to communicate using natural language processing and because it is generative, capable of producing various types of content. You've probably experienced basic customer service bots that can give canned responses to limited queries. But generative chatbots can develop original responses. Its capabilities include answering questions, assisting with composition, summarizing content, and more. This is why Microsoft (MSFT -0.49%) has made a multiyear and multibillion-dollar investment in OpenAI. 

Microsoft bets big on AI

The reason is simple. Microsoft is eying the vast search advertising market currently dominated by Alphabet's (GOOG 0.89%) (GOOGL 0.97%) Google Search, as shown below. It is using ChatGPT tech to get there.

Search engine market share

The chasm between Google Search and Microsoft Bing is vast, so Microsoft has everything to gain. After all, Google Search brought in $160 billion in revenue for Alphabet in 2022, 80% of Microsoft's total fiscal 2022 sales. 

Bing isn't Microsoft's only AI initiative. The company's comprehensive cybersecurity offerings leverage AI to fight against bad actors, and Microsoft CoPilot embeds into Microsoft Office apps to generate presentations, draft emails, and summarize texts. CEO Satya Nadella appears to be all-in on AI.

Microsoft's results for the fiscal third quarter of 2023 are simply outstanding: $52.9 billion in sales on 7% growth. Operating income for the quarter was $22.4 billion (up 10%), with a fantastic 42% margin.

The stock does not come cheap, as you'd probably expect. It trades near its 52-week high, and its price-to-earnings (P/E) ratio over 32 is higher than its single-year and three-year averages. Because of this, it might behoove new Microsoft investors to keep an eye out for a pullback in the stock price. 

Microsoft is making dynamic moves in AI, but don't write off Alphabet just yet.

Alphabet stock may be more attractive

Some were quick to declare Microsoft the AI leader with its investment in ChatGPT, but this is like declaring a winner after the first inning of a baseball game. For years Alphabet has developed its own AI tools, including its answer to ChatGPT, named Bard. I tested Bard to inquire about Alpabet's other AI initiatives, like better translation services, search by photo, speech recognition, and others. 

Google Lens is an excellent example of a practical application of AI. This allows the user to search from a cellphone camera. For example, users can translate a menu written in another language just by pointing their camera at it. Other applications include copying text or identifying unknown objects.

Alphabet just announced it is combining its Google Brain and DeepMind research programs into one entity called Google DeepMind. Both have been studying AI for years with some of the most brilliant minds in the business. The push from Microsoft might create urgency for Alphabet to kick these initiatives into high gear.

The slowing economy has investors concerned that Alphabet's advertising revenue will suffer. But first-quarter earnings announced on April 25 had many breathing a sigh of relief. Revenue rose to $69.8 billion on 3% growth (6% growth in constant currency). Operating income fell from 20.1 billion to $17.4 billion; however, $2.6 billion of the dip is due to one-time charges relating to layoffs and office space reductions. CEO Sundar Pichai expressed on the earnings conference call a commitment to reining in costs moving forward.

Alphabet's stock is more than 10% off its 52-week high and more than 25% below where it stood at the beginning of 2022.

GOOG Chart

GOOG data by YCharts

The company uses the share price reduction to benefit stockholders by aggressively repurchasing shares. A total of $73.8 billion of shares (5.5% of the current market cap) was retired in 2022 and Q1 2023. And another $70 billion was authorized with this earnings release. 

The encouraging results do not mean the company is out of the woods. The economy is an ongoing headwind, YouTube sales were down in Q1 year over year, and Microsoft's search competition will be a test. But investors don't beat the market by buying only when everything is rosy. They need to look beyond current challenges to identify long-term potential. This potential is why Alphabet's beaten-down stock could make investors higher long-term profits.