Artificial intelligence (AI) stocks have been in the limelight in recent months after OpenAI's chatbot ChatGPT, backed by Microsoft (MSFT -0.66%), took the world by storm at the end of 2022 and quickly racked up a massive user base.

With a purported investment of $10 billion in OpenAI, Microsoft has set itself up to take advantage of the generative AI boom. The company says it aims to "accelerate AI breakthroughs to ensure these benefits are broadly shared with the world," which explains why it has extended its partnership with a multibillion-dollar investment.

This looks like the right thing to do, as Polaris Market Research expects the global generative AI market to clock 34.2% annual growth over the next decade and create $200 billion in annual revenue by 2032.

And Microsoft is not the only company that could win big. Nvidia (NVDA -3.87%) has emerged as one of the top AI stocks thanks to the role its chips play in powering the data centers where the AI workloads will be handled.

But if you had to invest in only one of these two stocks, which one should it be? Let's find out.

The case for Microsoft

Microsoft has already started monetizing ChatGPT. OpenAI recently released the latest and most advanced version of its chatbot, known as GPT-4, claiming that it can solve difficult problems with higher accuracy, allowing users to compose songs, write screenplays, and even carry out tasks such as scheduling meetings with its advanced reasoning capabilities.

OpenAI has made GPT-4 available only to users of ChatGPT Plus, a subscription-based plan costing $20 a month. Paid users can access ChatGPT even during peak usage when servers are likely to be at full load, they can get a faster response to their queries, and they will have early access to new features.

The free tier will continue to be there, but it looks like only the paid subscribers will have access to more-advanced features.

ChatGPT had surpassed 100 million users in January after being launched at the end of November 2022, so Microsoft and OpenAI already have a huge user base that they can monetize. At the same time, OpenAI is collaborating with multiple brands to make custom solutions for them using GPT-4.

Morgan Stanley, for instance, has developed an internal chatbot using GPT-3, and now GPT-4, which will allow its wealth management professionals to quickly locate any specific information they might need from a huge data pool.

Such enterprise applications are the reason the chatbot market is expected to produce annual revenue of roughly $19.5 billion by 2027 compared to just $2.5 billion in 2019. Also, Microsoft has launched ChatGPT on the Azure cloud platform. This move will allow developers and organizations to integrate the ChatGPT algorithm, along with other large-language AI models such as Dall-E, Codex, and GPT-3.5 to make custom conversational AI applications and chatbots that they can integrate into their own services.

Microsoft has priced the Azure OpenAI service at $0.002 per 1,000 tokens (roughly 750 words). It started billing customers for this service on March 13. So its early mover advantage in this space could help it corner a nice chunk of the multibillion-dollar chatbot market, in addition to bolstering its presence in the search engine space with its AI-powered Bing.

The case for Nvidia

Nvidia has been crucial to the success of ChatGPT because the chatbot is powered by thousands of graphics processing units (GPUs) from the semiconductor maker, according to a recent blog post by Microsoft. By some estimates, ChatGPT may require at least 30,000 Nvidia GPUs, and it could contribute heavily to the company's top line. CEO Jensen Huang believes that the company could get a large portion of its revenue from generative AI applications, up from a single-digit percentage in the past year.

That won't be surprising. The company's graphics cards are the building blocks for generative AI applications because they can process huge amounts of data in a parallel process and are especially useful for training AI models. This explains why Microsoft and OpenAI turned to Nvidia to power their chatbot, and they aren't the only companies doing so.

Nvidia is partnering with Alphabet's Google Cloud to deploy a generative AI platform that will help developers and companies build custom applications in a fast and cost-efficient manner. Amazon Web Services has deployed a cloud function powered by Nvidia GPUs for training large language models and developing generative AI applications.

And Nvidia is looking to democratize the development of generative AI applications with the recently launched DGX Cloud. According to the company, this is "an AI supercomputing service that gives enterprises immediate access to the infrastructure and software needed to train advanced models for generative AI and other groundbreaking applications."

This service can lower the entry barrier for companies looking to develop generative AI applications since they won't need to invest in expensive hardware and can simply rent the infrastructure from Nvidia for a monthly fee. As a result, the company's chips could become the driving force behind the growth of generative AI applications.

Nvidia's dominant position in the enterprise GPU market, with a share of 91%, explains why the major cloud service providers and tech giants are leaning on its chips to power their generative AI initiatives. All this indicates that Nvidia could be a top AI stock in the long run as multiple companies are banking on it to tap into the generative AI opportunity.

The verdict

Nvidia has turned out to be the bigger AI winner so far in 2023, with its shares jumping a whopping 90%. That's way higher than Microsoft's 16.5% gains. The discussion above indicates why Nvidia has accelerated rapidly this year amid the AI craze.

While Microsoft will have to compete with other tech giants, such as Alphabet and Amazon in the generative AI market, Nvidia's monopoly like position in enterprise GPUs means that it could very well become the supplier of choice for multiple companies looking to make the most of this opportunity. As such, Nvidia could continue outpacing Microsoft amid the boom and remain a top AI stock for years to come.

Investors will have to pay 59 times next year's earnings to buy Nvidia stock now, compared to Microsoft's forward-earnings multiple of 25. But Nvidia could justify that rich multiple since it is in a better position to tap the AI market's secular and rapid growth thanks to the lack of stiff competition in the GPU market.