You only needed to know one thing over the last year to make a lot of money investing: Buy large-cap artificial intelligence (AI) stocks. Nearly all of them have delivered sizzling returns.

Chipmakers Advanced Micro Devices (AMD 2.37%) and Nvidia (NVDA 6.18%) have been especially big winners. Cloud services providers Amazon (AMZN 3.43%), Google parent Alphabet (GOOG 9.96%) (GOOGL 10.22%), and Microsoft (MSFT 1.82%) have also taken off.

But those performances are now history. Which AI stock is Wall Street most bullish about going forward: AMD, Amazon, Alphabet, Microsoft, or Nvidia?

Analysts give a thumbs down to these AI stocks

We can quickly eliminate two of these big AI stocks. Wall Street doesn't have great expectations for AMD or Nvidia over the near term.

The average analyst's 12-month price target for AMD reflects a small decline from the current price. That's not too surprising, considering the stock has skyrocketed more than 130% over the last 12 months. Many analysts seem to think that AMD is due for a breather.

It's a similar story with Nvidia. The stock has nearly tripled over the last year, thanks to surging demand for the company's graphics processing units (GPUs). But while that demand doesn't appear to be waning, the consensus on Wall Street is that Nvidia's shares don't have much more room to run. The average price target is a little lower than the current share price.

Not every analyst gives a thumbs down to these two AI chipmakers, though. The most optimistic analysts think that AMD and Nvidia can still soar nearly 40% and 60%, respectively, over the next 12 months.

The contenders

Wall Street is more optimistic about Microsoft. The average price target for the tech giant reflects an upside potential of more than 10%. One analyst predicts that Microsoft's shares could jump more than 30% over the next 12 months.

Microsoft stands to profit from the AI boom in two key ways. The company has integrated OpenAI's GPT-4 large language model throughout its software applications. This added functionality will likely attract more customers.

The company is also the second-biggest cloud services provider with its Azure platform. Organizations are flocking to the cloud to build and deploy AI apps, especially ones focused on generative AI.

However, analysts think Alphabet could outperform Microsoft, AMD, and Nvidia over the near term. The average 12-month price target for the stock is roughly 15% above the current price. The most bullish analyst expects Alphabet stock to vault nearly 30% higher.

What about the recent embarrassment for Alphabet with Google Gemini creating inaccurate images of historical figures? Wall Street doesn't believe it will be more than a temporary speed bump. Like Microsoft, Google has integrated generative AI throughout many of its products. Google Cloud should also continue to benefit from the adoption of AI.

Wall Street's favorite

That leaves one big AI stock Wall Street likes the most. Amazon's average 12-month price target reflects an upside potential of nearly 17%. The company's biggest fan in the analyst community thinks the stock could move close to 30% higher.

AI stands out as one key growth driver for the company. Amazon Web Services (AWS) holds the leading market share in cloud services and enjoys the same AI tailwind as Microsoft Azure and Google Cloud.

Analysts also recognize how much Amazon's focus on improving profitability and free cash flow is paying off. The e-commerce and cloud services giant's Q4 earnings jumped to $10.6 billion from $0.3 billion in the prior-year period. Free cash flow improved to $36.8 billion for the trailing 12 months, compared to negative free cash flow of $11.6 billion in the 12 months ending Dec. 31, 2022.

Is Wall Street right that Amazon will be the biggest winner of these five AI stocks over the next 12 months? Maybe. I agree that Amazon's momentum should continue.

Over the long run, though, I expect that AMD, Amazon, Alphabet, Microsoft, and Nvidia will keep up their winning ways. We could look back 20 years from now and still be able to say that the one thing investors needed to know to make a lot of money was to buy large-cap AI stocks.