The stock market has recovered nearly all the losses that were sparked by fear of a new trade war. The benchmark S&P 500 index finished June 25 less than a percentage point below its all-time high.
Despite a big recovery for the overall stock market, several top tech stocks with a hand in the artificial intelligence (AI) revolution have been trading for attractive valuations. Demand for AI-related products hasn't translated into profits for the most popular large language model (LLM) providers, but sales of semiconductors and equipment required to produce those LLMs keep surging.
Lately, Nvidia (NVDA 1.74%), Lam Research (LRCX 0.37%), and ASML Holding (ASML -0.32%) have been trading at attractive valuations. If you have $1,000 -- or any amount -- available to invest in these stocks now, there's a good chance you'll realize market-beating gains over the long run.

Image source: Getty Images.
1. Nvidia
If you follow the AI space, you probably heard that DeepSeek in China ignored CUDA, Nvidia's software development kit (SDK), to produce a competitive LLM using inferior graphics processing units (GPUs). The important thing for everyday investors to take from this event is that the vast majority of AI application developers aren't as capable and all but a handful of developers still rely on CUDA to build AI applications.
Nvidia's software advantage allowed its fiscal first-quarter sales to surge 69% year over year to a whopping $44.1 billion. With demand for AI computing on the rise, and a software advantage that keeps competitors at bay, several more years of rapid growth isn't a wild expectation.
On the surface, Nvidia stock looks expensive at 36 times earnings expectations. But once you consider how fast earnings are growing, the stock actually looks like a bargain right now.
The forward price/earnings-to-growth (PEG) ratio divides the trailing price-to-earnings ratio by the rate of earnings growth Wall Street expects in the year ahead. Anything below a 1.0 is considered undervalued, so Nvidia's recent forward PEG of 0.79 suggests now is a good time to buy.
2. Lam Research
AMD and Intel are furiously trying to overcome Nvidia's software advantage. But even if they succeed, they'll still likely employ advanced etch and deposition equipment from Lam Research, a leader in the space.
Now that advanced semiconductors are spacing nodes just a few nanometers apart, stacking semiconductor components is the way forward. As a leader in the verticalization processes, Lam Research could remain a vital equipment provider in the decade ahead. Its equipment is used to manufacture high bandwidth memory (HBM), which is an increasingly important component of AI processing.
Strong demand from Nvidia helped Lam Research report first-quarter earnings that rose 12% year over year. Even if Nvidia unexpectedly loses its software advantage in the years ahead, the next leader in the semiconductor space will likely employ Lam's etch and deposition equipment to produce HBM, too.
Shares of Lam Research have been trading for just 24 times earnings estimates. This valuation is extremely low for a highly profitable company that could continue raising earnings at double-digit percentages for many years to come.
3. ASML Holding
With $1,000, you could buy many shares of Nvidia or Lam Research. Advanced lithography system producer, ASML Holding is more than 25% off its previous peak, but you'll need at least $815 to buy one share at recent prices. (Don't get hung up on price, though. Price and value aren't the same thing, and fractional shares are available.)
Like Lam Research, ASML is a niche producer of semiconductor manufacturing equipment. Its enormous lithography machines contain hundreds of thousands of components and require months to ship and assemble. When it comes to advanced chips that AI applications rely on, an ASML lithography machine is the only option.
ASML's already entrenched business requires heaps of capital, engineering knowledge, and relationships with semiconductor manufacturers. These sustainable advantages allowed earnings per share to rise by 16% annually over the past five years, and the gains could continue. At the midpoint of management's guided range, top-line sales are expected to climb by 14.8% this year. Without any competitors capable of marketing similar equipment, continued growth at a double-digit annual percentage seems likely.
A stock market aware of ASML's competitive position rarely allows its stock price to fall into deep value territory. At recent prices, it's been trading for about 30 times forward-looking earnings expectations. This is a steep valuation, but it isn't one that ASML can't grow into. Adding some shares to a diversified portfolio to hold over the long run looks like a smart move for most growth-oriented investors right now.