For more than three decades, investors have consistently had a game-changing innovation or next-big-thing trend to captivate their attention. Over the last two-plus years, artificial intelligence (AI) has been the innovation investors simply can't get enough of.

With AI, software and systems are empowered with the tools to make split-second decisions without human oversight. The capacity for software and systems to become more proficient at their assigned tasks over time, and potentially learn new skills, leads to a virtually limitless long-term ceiling for this technology. In Sizing the Prize, the analysts at PwC estimated a $15.7 trillion global addressable market for AI by the turn of the decade.

A hologram of a rapidly rising stock chart coming from the upward-facing palm of a humanoid robot.

Image source: Getty Images.

While the monstrous size of this pie should lead to numerous winners, it doesn't necessarily mean all artificial intelligence stocks are worth buying. Among the spectrum of companies playing a key role in the evolution of AI is a business whose stock is historically pricey, as well as a well-known industry leader whose shares are currently trading at a decisive bargain.

This scorching-hot AI stock is making history for all the wrong reasons

There is no shortage of public companies whose shares have soared as excitement for the AI revolution has grown. However, AI-driven data-mining specialist Palantir Technologies (PLTR 6.38%) is in a class of its own.

Since the end of 2022, shares of Palantir Technologies have skyrocketed by almost 2,000%! The primary reason Palantir stock has been unstoppable is its sustainable competitive advantage.

Its AI-fueled Gotham platform, which helps federal governments plan and execute military missions, and its AI- and machine learning-propelled Foundry platform that assists businesses in streamlining their operations by better understanding their data, have no one-for-one, large-scale replacements. When Palantir lands a customer (governmental or enterprise), it rarely has to worry about competitive pressures.

Palantir Technologies is also recurringly profitable, which validates that its two-platform operating model works. It began generating recurring profits well ahead of Wall Street's expectations.

But in spite of Palantir's overwhelming success, it's the AI stock I'd strongly urge investors to steer clear of in June, and perhaps well beyond.

There are three direct headwinds that stand in the way of additional upside in Palantir stock.

To begin with, Gotham's runway is clouded in the years to come. Even though Republicans have traditionally favored a lofty defense budget, President Donald Trump's administration has sought ways to make the U.S. government more efficient. This may include future reductions in defense spending.

To build on this point, Gotham's prospective pool of clients is limited. Considering that only the U.S. and its allies can access Palantir's AI-powered platform, Gotham's long-term sales growth rate should taper.

The second issue for Palantir Technologies is that history and next-big-thing trends rarely mix well. Since (and including) the advent of the internet in the mid-1990s, every next-big-thing trend and game-changing innovation has navigated an early innings bubble-bursting event. Without fail, investors have overestimated the early stage utility and mainstream adoption of a new technology. More than likely, we're witnessing the same thing happen with AI.

The good news for Palantir is that its government contracts are typically spread out over multiple years, and Foundry is a subscription-based service. Though this should thwart any immediate drop-off in sales if the AI bubble bursts, investor sentiment would be expected to weigh heavily on leading AI businesses.

The third and, arguably, biggest issue for Palantir is its valuation. While companies with sustainable moats do deserve some level of valuation premium, Palantir closed out the month of May with a trailing-12-month (TTM) price-to-sales (P/S) ratio of 105!

To put this into perspective, market leaders of previous next-big-thing trends saw their bubbles burst around TTM P/S ratios of 30 to 40. No megacap stock on the leading edge of a next-big-thing trend has ever been able to sustain a P/S ratio of 30 to 40, let alone 105.

A person writing and circling the word buy beneath a dip in a stock chart.

Image source: Getty Images.

This market leader might be the best bargain in the AI arena

Although the stock market remains historically pricey, and some companies, like Palantir, are truly pushing the envelope, select bargains can be found in the artificial intelligence space. Perhaps no market-leading business stands out as a more enticing bargain in June than Google parent Alphabet (GOOG 3.04%) (GOOGL 3.24%).

Even the most attractive stocks on Wall Street contend with headwinds, and Alphabet is no exception. In 2025, Alphabet stock has been weighed down by two potential issues.

First, there's the legal uncertainty tied to the U.S. Justice Department's recommendation that Alphabet be broken up. Specifically, the Justice Department believes Google's ad dominance has stifled innovation and thwarted competition. It may force the sales of the Chrome browser and/or Android operating system. Put simply, Wall Street doesn't like uncertainty (legal or not).

The other concern weighing on Alphabet's shares this year is the prospect of large language model (LLM) chatbots siphoning away its search market share. If LLM chatbots become more proficient at answering queries, users may opt to avoid Google, which would harm Alphabet's superior ad-pricing power.

While these are tangible concerns, neither are likely to meaningfully impact Alphabet's long-term growth outlook.

For example, we haven't witnessed an observable drop-off in global internet search market share for Google spanning more than 10 years. Even with the emergence of a handful of popular LLMs, Google has accounted for between an 89% and 93% share of worldwide internet search. Businesses view Google as the premier avenue to target users with their message(s), which means Alphabet should have little issue sustaining its strong ad-pricing power.

Furthermore, advertising-based businesses -- Alphabet generated 74% of its net sales in the March-ended quarter from ads -- benefit from nonlinear economic cycles. Whereas the average U.S. recession has lasted just 10 months since the end of World War II, the typical period of expansion has endured for roughly five years. Long-winded expansions strongly favor ad-driven operating models.

But when looking out multiple years, it's Alphabet's cloud infrastructure service platform that'll do most of the heavy lifting. Google Cloud is the world's No. 3 cloud infrastructure service platform by spending, and the incorporation of generative AI solutions into the platform has the potential to accelerate growth.

Google Cloud is generating roughly $49 billion in sales on an annual run-rate basis. More importantly, this segment produces superior margins to advertising. As Google Cloud becomes a larger piece of Alphabet's pie, growth in its cash flow and earnings per share should accelerate.

Alphabet is also sitting on an enviable pile of capital. It closed out the first quarter with more than $95 billion in combined cash, cash equivalents, and marketable securities. Not only does this cash allow Alphabet to aggressively repurchase its stock, but it's funding the AI innovation that'll fuel growth for Google Cloud.

The icing on the cake for prospective Alphabet investors is that its stock is historically inexpensive. The company's forward price-to-earnings (P/E) ratio of 16.9 marks a 24% discount to its average forward P/E multiple over the trailing five-year period.