The U.S. stock market has delivered remarkable returns over the past five years, with the S&P 500 achieving double-digit gains in four of those years. While artificial intelligence (AI) and specialized semiconductor chips have largely powered this bull market, many leading tech companies now command premium valuations that may give investors pause.

Consider the market leaders: Nvidia, the semiconductor giant driving the AI revolution, trades at a forward price-to-earnings (P/E) ratio exceeding 31, while Microsoft, leveraging its OpenAI partnership to advance artificial general intelligence (AGI), carries a forward P/E above 34. These valuations significantly exceed the S&P 500's forward P/E of 24.1.

A clock with hands that read time to buy.

Image source: Getty Images.

These premium valuations have prompted savvy investors to seek growth opportunities elsewhere in the tech sector. Rather than paying top dollar for established AI giants, we've seen a wave of money move into adjacent sectors poised to benefit from AI adoption, including energy infrastructure, enterprise software, industrial automation, high-performance computing, and robotics.

This strategic shift isn't surprising. As AI technology becomes increasingly embedded in both hardware and software platforms, the standout performers of 2025 may well emerge from small and mid-cap companies pioneering innovative applications of this technology. Here are two tech stocks positioned to capitalize on the emergence of next-generation AI in 2025 and beyond.

A leader in quantum computing

IonQ (IONQ -5.72%) stands at the forefront of quantum computing, a breakthrough technology that harnesses quantum mechanics to solve complex problems beyond the reach of today's most powerful supercomputers. Shares of the quantum computing pioneer have soared by an eye-catching 173% in 2024 (as of Dec. 13) on mounting evidence that its trapped-ion approach could unlock this technology's massive commercial potential.

Speaking to this point, the quantum computing market is projected to reach $173 billion by 2040, according to McKinsey & Co. This exponential growth is expected to be driven by quantum computing's ability to revolutionize fields like drug discovery, financial modeling, cryptography, and perhaps most importantly, advanced AI.

While IonQ's $7.32 billion market cap reflects high expectations for a company still scaling revenue and developing its core technology, the sheer magnitude of quantum computing's potential makes this a risk worth considering for patient investors. After all, the company's recent string of partnerships with industry leaders and government agencies demonstrates strong interest in its trapped-ion approach.

Looking ahead, quantum computing could create unprecedented value by unlocking solutions to problems that have stumped scientists and engineers for decades. IonQ's trapped-ion technology and robust cash position of $382.8 million suggest it could emerge as a leader in this nascent field.

AI-powered urban delivery

Serve Robotics (SERV -7.65%) represents the practical application of AI in everyday life through its autonomous sidewalk robots. The company's delivery systems use advanced AI algorithms for navigation, obstacle avoidance, and route optimization-capabilities that become more sophisticated as AI technology advances.

Recent developments highlight Serve's momentum. The company raised $32.3 million in new capital during Q3 2024 and expanded its partnership with Uber Eats to deploy 2,000 robots by year-end 2025.

According to industry forecasts, the autonomous delivery robot market will reach $450 billion by 2030. Serve's ability to integrate increasingly sophisticated AI models into its robots could help it capture a significant share of this rapidly growing market.

At a market capitalization of $579 million, Serve trades at a compelling valuation considering its technology leadership, expanding Uber partnership, and massive market opportunity in autonomous delivery. The company's strategic position in urban delivery automation suggests significant growth potential, especially as AI technology advances and becomes an integral part of everyday life.

Tech meets opportunity

These two companies offer unique ways to invest in AI's expanding capabilities. IonQ's quantum computing technology could dramatically accelerate how AI systems process information, while Serve Robotics shows how AI can revolutionize everyday services like food delivery. Both companies are early in their growth trajectories but target massive markets that could reward patient investors willing to accept near-term volatility.