As artificial intelligence (AI) investing picks up steam, the trend is beginning to look more and more like other bubbles that have burst. It's common to hear: "This time, it's different!" The reality is that history doesn't often repeat itself, but it does rhyme.

So if you're going to invest in AI stocks, you must be aware of the bubble risk and how to handle it should a company you invest in get caught up in the boom.

Considering the case of Zoom Video

The most challenging task for many investors during a bubble is understanding when a company is executing and driving stock performance versus just expectations. Even more confusing are companies that are firing on all cylinders yet trade at such a ludicrous valuation that there is no way for the investment to make money.

Let's look at a work-from-home stock that saw this same action in 2020 and 2021 before tumbling down to Earth in 2022. The epitome of work-from-home was Zoom Video Communications (ZM 1.57%). After the pandemic forced companies to adopt remote work practices, Zoom saw skyrocketing demand. As the company turned that interest into revenue, the company's valuation remained elevated.

ZM PS Ratio Chart.

ZM PS Ratio data by YCharts.

In mid-2021, with the company trading around 35 times sales and sporting around a 30% profit margin, it would need to increase its sales by 250% over the next five years just to achieve a usual software company valuation of 30 times earnings. While that wouldn't be impossible, it isn't easy to achieve. However, if Zoom did achieve that, its stock price wouldn't have increased -- that was the expectation baked in.

Understanding a stock's valuation is critical as it tells you what expectations are for the stock. Then, you need to estimate the time frame for these goals. If you're giving up a year or two of returns in exchange for greater upside after that, a stock can make sense to invest in. However, if you must weather five years of rapid growth just for the stock to reach a reasonable valuation, then it likely has too much hype built into it.

Nvidia has sky-high expectations built in

Unfortunately, we're already seeing this from many AI-centric stocks now. With Nvidia (NVDA 6.18%) trading at 41 times sales, it's nearly in the same boat as Zoom was in. Although the company projects an incredible 64% growth for the second quarter of fiscal 2024, it must continue that growth far beyond this year for the valuation to make sense.

Should Nvidia achieve the analyst's average revenue estimate for fiscal 2025 (ending in January 2025) of $54.5 billion, it would still trade at 19 times sales. Should Nvidia return to peak profitability of a 35% profit margin, that would price shares at 54 times earnings -- still an expensive valuation.

Furthermore, it's in a bit more precarious of a situation now. While Zoom operates on a subscription model -- offering a degree of business continuity -- Nvidia's products are more discretionary in nature. Yes, Nvidia has some aspects of a subscription business, but once customers build out their AI infrastructure, it's unlikely they will continue to buy Nvidia's GPUs at the same pace they are now.

So if you're considering investing in AI stocks, run your prospective company through a valuation analysis to understand what kind of growth and profitability a company must achieve in a specific time frame for the investment to make sense.

You'll almost always pay some premium for a growth company, but the question is how much is reasonable. That's different for every investor (as we all have different return goals and time frames), but expecting positive returns after two or three years seems like the bare minimum for me.

Keep this in mind when investing in AI as a few companies will emerge as long-term winners, but a lot of others will not live up to expectations championed by their management. There are plenty of great AI investments out there, but you must do your homework first before investing.