It's funny how fast investor sentiment can do a complete 180-degree turn. Late last year, Wall Street was extremely pessimistic on technology stocks. Shares of popular names like Amazon, Tesla, and Meta Platforms were down more than 50% in less than a year after going on an incredible bull run the past decade-plus.

In the first few months of 2023, most of these losses have been reversed. We have the artificial intelligence (AI) hype train to thank for this, as everyone seems enamored with the recent breakthroughs from companies like OpenAI and Alphabet, which have the potential to supercharge growth in the technology sector yet again.

But that's all it is right now: potential. If you look historically, most new technologies or industries end up being overhyped initially, causing a stock market bubble to form, and investors who buy at the top lose money. With shares up close to 40% this year, are technology stocks -- specifically ones in the Invesco QQQ ETF (QQQ 1.24%) exchange-traded fund (ETF) -- in an AI-driven bubble? Let's investigate. 

How does it compare to the dot-com bubble?

The Invesco QQQ ETF has over $200 billion in assets under management and tracks the Nasdaq-100 Index, which holds the 100 largest technology companies in the world, weighted by market capitalization. This makes it an ideal proxy for tracking tech stocks.

As of this writing, the Invesco QQQ is up 38.4% year to date, greatly outperforming the S&P 500, which is "only" up 15.6%. This has driven the ETF's price-to-earnings ratio (P/E) up to 30, compared to the S&P 500's earnings multiple of 25.

How does this compare to the dot-com hype 25 years ago, one of the quintessential stock market bubbles? Pretty favorably, actually. During the peak of the dot-com bubble in 2000, Nasdaq stocks traded at an absurd P/E of 200, or more than six times today's level, while the S&P 500 traded at a P/E of close to 45.

Even though technology stocks have jumped aggressively higher this year, they are far from the levels of the internet bubble. This does not necessarily mean tech stocks are the best bet for investors today (which we will discuss below), but they are not crazy expensive, either.

The one reason technology stocks might still do well

There is one thing that can save tech stocks, and the only reason they will continue to do well over the long term: fast earnings growth in the long run.

If you buy a stock -- or a group of stocks, in this case -- at an elevated P/E, the only way to outperform the market is if forward earnings are much higher than today, growing faster than the overall market.

Investors are clearly betting that AI and other factors will drive strong earnings growth for Nasdaq-100 stocks this decade. If you agree with this sentiment, then it could be smart to buy the Invesco QQQ ETF at today's high P/E.

Even if it's not a bubble, there are still better options today

Tech stocks are nowhere near the nosebleed levels of the dot-com bubble, and forward returns could still be strong if the promise of AI has a lot of bite to it. But what about investors who are hesitant about buying stocks with a high earnings multiple?

If you are one of them, it might be smart to diversify your portfolio into other asset classes. With the Federal Reserve raising interest rates, short-term Treasury bonds yield more than 5% and offer risk-free returns. The iShares Short-Term Treasury Bond ETF (SGOV 0.02%) is an easy way to get exposure to Treasury bonds and currently yields 5.1%.

Another option is the Vanguard Small-Cap Value ETF (VBR 0.03%). As the name suggests, this ETF tracks a list of nearly 900 value-priced stocks with small market caps. The ETF currently has a dirt cheap P/E of 9.8 and just 6.4% of its assets in technology stocks. Unless the Nasdaq-100 components grow their earnings incredibly quickly over the next 10 years, I think it is likely that this value ETF produces a better return for shareholders in this decade.