Artificial intelligence (AI) has become the hottest investing trend in 2023. This has caused many investors to pile into stocks like Nvidia or C3.ai. However, picking one winner in this race isn't a smart investment strategy.

There are multiple ways you can invest in AI, and loading up on one just because you're convinced it will come out on top could be disastrous. So if you're looking to invest in AI, consider this advice.

The AI run-up looks a lot like another trend investors recently saw

The winner isn't always who you think it will be. Take a look at Nvidia; the company's GPUs (graphics processing units) power the computers necessary to create AI models. It will benefit from an AI rollout, but how much more can the stock increase in value?

NVDA PS Ratio Chart

NVDA PS Ratio data by YCharts

The stock has already reached an all-time high price-to-sales (P/S) valuation, and Nvidia must execute flawlessly for that price tag to make sense. Should Nvidia not post market-crushing results or guidance each quarter, the stock will get slammed.

This scenario sounds like another company and another trend that happened three years ago.

Zoom Video Communications was the pinnacle work-from-home and COVID-19 stock. It was the clear no-brainer winner, so investors bid up the stock, and the company also posted solid results. However, Zoom's growth slowed significantly once that catalyst was complete, and the company's valuation and stock price tumbled.

ZM PS Ratio Chart

ZM PS Ratio data by YCharts

Now, the stock sits nearly 90% off its all-time high. While I'm not saying the same thing will happen with Nvidia, I am warning investors that it might. The same could be said for other high-flying AI stocks like C3.ai.

Still, many investors (including myself) don't want to miss out on a huge business shift by ignoring AI companies. So what can they do?

The S&P 500 has become an AI-heavy index

What are the largest AI companies? Microsoft, Alphabet, Nvidia, Tesla, and Meta Platforms all spring to mind. However, if you look at the S&P 500 makeup, these companies already comprise 16% of the index. So just by purchasing a basic S&P 500 index fund like the SPDR S&P 500 ETF (SPY 0.35%), you've already levered your portfolio heavily to some of the biggest AI names.

Because of this, you don't even have to invest in one company to do well if AI becomes a serious business change. On the flip side, if it busts, there are hundreds of other companies to balance out these five should AI not pan out as many investors think.

There are also other smaller companies that aren't included in the index, and if their AI product takes off could provide massive returns. Obviously, investors want a taste of these companies, too, and a basket approach is a great way to spread out risk.

By devoting a small chunk of your portfolio specifically to AI stocks (say 5%), you can purchase a diversified basket of stocks with the potential for a strong return. If you can identify five to 10 promising stocks, then you purchase these companies equally and wait for the market to determine your winner. Some companies within the basket will likely bust, others will return the market average, but one or two may shoot through the roof and carry the entire basket.

By using an index fund and a basket approach, investors can spread out the risk of investing in a trend like AI. This allows you to significantly profit if the returns continue, but it also protects you from the downside should the trend blow up. While this approach works for AI right now, it can also be used in other stock market areas as market conditions change.