Artificial intelligence (AI) is advancing rapidly -- and it's perhaps doing so more quickly than many realize.

Nvidia (NVDA 6.18%) CEO Jensen Huang has an unparalleled view of the breakneck AI changes that are underway. His company's chips are the gold standard for powering AI apps. Huang spoke at The New York Times DealBook summit on Nov. 29 and told the audience that AI will rival human capabilities in as few as five years.

AI gaining on humans

There's been a lot of talk in recent months about advances in creating artificial general intelligence (AGI). Some refer to AGI as the "holy grail" of AI. It's a stage of AI where computers can learn, reason, and solve problems at a similar level as humans.

AGI doesn't exist at this point. Large language models such as OpenAI's GPT-4 represent a major leap forward, but they still fall far short of achieving the reasoning and problem-solving capabilities that humans have.

Huang said at the DealBook summit that "everybody's working" on the advanced reasoning needed to achieve AGI. He added, "There's no question that the rate of progress is high."

And the Nvidia CEO doesn't think that AGI is far off -- at least not using one definition of the term. Huang brought up the view that any system that can complete tests in a "fairly competitive" way as humans qualifies as AGI. He predicted that "within the next five years, you're going to see, obviously, AIs that can achieve those tests."

Four stocks to buy if Huang is right

If and when AGI is achieved, the ramifications would be enormous. Multiple industries could be radically changed, as computers could be used to perform tasks that only humans could do in the past.

Which stocks would be the most likely winners if Huang is right that AGI is on the way within the next five years? I think four stocks especially stand out.

Huang's own Nvidia is an obvious pick. Demand for the company's graphics processing units (GPUs) has skyrocketed this year with the boom in generative AI. AGI could provide an even greater catalyst for Nvidia. Any concerns about Nvidia's current valuation would no doubt evaporate in the wake of what would likely be a game changer for the chipmaker.

We don't know which company might become the first to develop AGI. However, OpenAI is certainly a top contender. You can't invest directly in OpenAI. But buying shares of Microsoft (MSFT 1.82%) is the next best thing, since the tech giant owns 49% of the AI pioneer.

Alphabet's (GOOG 9.96%) (GOOGL 10.22%) Google DeepMind could also be in a strong position to achieve AGI. Google has been a longtime leader in AI. It plans to launch a new AI technology called Gemini next year that is reportedly five times more powerful than GPT-4.

I also wouldn't count out Amazon (AMZN 3.43%). Like Google, Amazon is investing heavily in AI. The company has its own GPT-4 rival, code-named Olympus, in development.

What if Huang is overly optimistic?

Now for a reality check: Huang's prediction could prove to be wrong. It could take much longer than five years for AGI to be developed. So does the possibility that he's overly optimistic change the dynamics for investors? Not much, in my view.

Alphabet, Amazon, and Microsoft don't depend entirely on AI advances to continue growing robustly. All three companies operate cloud services platforms. I think that IT spending will shift increasingly to the cloud, whether AGI is achieved or not.

Nvidia's fortunes hinge more heavily on AI. Still, though, the company's growth prospects aren't diminished if AGI is farther in the future than Huang thinks it is.

I suspect that Nvidia could be the most likely of these four stocks to experience a significant pullback. Even a hiccup in demand for its GPUs would probably be enough to spur a sell-off. However, Nvidia -- along with Alphabet, Amazon, and Microsoft -- should continue to be a big winner for long-term investors.