Copyright fool

Bubbles have formed throughout stock market history. The actual bubble, and even the circumstances causing it, can change. However, they generally go through the same sequence of events, ultimately ending in pain when the euphoria runs out and prices reverse course -- often sharply. The tricky thing about stock market bubbles, though, is that while you can often spot them, it's almost impossible to know when they will burst. There is currently a bubble in artificial intelligence (AI) -- not necessarily in all of AI as a broad idea, but in some specific companies. Some AI stocks have surged to remarkably high valuations that even the most optimistic investors would have trouble explaining. Here are two that stand out. I'm not here to tell you when the music will stop, only that holding them will probably hurt when that time comes. 1. Palantir's excessive valuation overshadows a strong business Starting with Palantir Technologies (PLTR +3.35%) could be somewhat controversial. Most people associate bubbles with lousy companies, and Palantir is anything but that. It has become arguably the leading AI software company, with surging, profitable revenue growth driven by a rapidly expanding customer base that includes both government and corporate clients. New technology often lacks a real-world utility in its early days. Not Palantir. The company develops proprietary AI software applications that have proven flexible across a wide range of use cases, including aiding military missions, optimizing supply chains, and detecting financial fraud, among many others. Yes, the business has a tantalizingly high long-term ceiling. Unfortunately, the market has gotten far too carried away with the share price. Palantir has surged to a whopping $471 billion market cap, on just $3.4 billion in trailing 12-month revenue. That's a price-to-sales (P/S) ratio of 138. Yes, Palantir is profitable, but the stock trades at over 300 times its 2025 earnings estimates! These are dubious valuations at best and are unlikely to hold over the long term. Investors shouldn't be surprised to see Palantir Technologies fall hard and fast at the first sign of slowing growth, or any loss of momentum in the broader AI bull market. Even great businesses can be terrible stocks to own at such high prices. 2. IonQ has gotten far too ahead of a slow-moving quantum opportunity Here's another example of euphoria outrunning business fundamentals. IonQ (IONQ 5.50%) is developing quantum computers for commercial use. Quantum computing leverages quantum mechanics to deliver computing power that's magnitudes greater than that of even today's cutting-edge classical computers. That means exciting innovation possibilities in the future, but quantum computing is still highly speculative at this point. Existing quantum machines are highly error-prone due to their sensitivity to environmental factors. As a result, today's quantum computers aren't suitable for much beyond research. Many experts believe that practical quantum computers could still be years away. Grand View Research estimates that the global quantum computing market will grow to just $4.2 billion by 2030. IonQ is currently selling access to its Forte quantum computer system through partnerships with cloud companies, but it has generated only $52 million in revenue over the past 12 months. That's problematic for a stock trading at a $21 billion market cap, over 400 times sales! Even as quantum computing matures -- which is not guaranteed -- it's unclear whether IonQ will lead the quantum computing market, or what its profit margins will be. Once again, it seems highly unlikely that IonQ will produce business results anywhere near what would justify the valuation investors have placed on the stock, at least not in the near future. Quantum computing sounds like an intriguing opportunity, but too much optimism too soon has put IonQ's stock at risk of a severe decline and potentially catastrophic investment losses once the hype fades.