Interest in artificial intelligence (AI) skyrocketed since OpenAI launched ChatGPT in November 2022. The industry is developing rapidly and is projected to expand at a compound annual growth rate of 37% until at least 2030. That trajectory would see the market hit close to $2 trillion before the end of the decade.

As a result, excitement over AI triggered countless tech stocks to soar over the last year. Microsoft (MSFT 1.82%) has been one of the biggest winners, with its shares up 56% in the last 12 months. The company is one of OpenAI's largest investors, a position that affords Microsoft with exclusive access to some of the start-up's most advanced AI models.

The Windows company is an exciting way to invest in AI. However, companies at slightly earlier stages in their AI ventures could have more room to run over the long term. Advanced Micro Devices (AMD 2.37%) and Amazon (AMZN 3.43%) are two attractive options. One is carving out a lucrative role in the AI chip market, while the other is leading in the software side of the industry.

MSFT EPS Estimates for 2 Fiscal Years Ahead Chart

Data by YCharts.

Microsoft's earnings could hit just under $16 per share over the next two fiscal years, while AMD's and Amazon's may reach about $7 per share. On the surface, Microsoft looks like a no-brainer.

However, multiplying these figures by the companies' forward price-to-earnings ratios (Microsoft at 35, AMD at 52, and Amazon at 41) would yield stock prices of $546 for Microsoft, $346 for AMD, and $283 for Amazon. Considering their current positions, these projections would see Microsoft's stock rise 35%, AMD's 99%, and Amazon's 66% by fiscal 2026.

These estimates show that AMD and Amazon have significantly more growth potential over the next two years. So forget Microsoft. Here are two AI stocks to buy instead.

1. Advanced Micro Devices

AMD's stock has climbed 111% year to date alongside its growing prospects in AI. The tech company is gearing up to challenge AI's leading chip supplier Nvidia with a new line of graphics processing units (GPUs) -- the hardware necessary for training AI models.

Last December, AMD unveiled its new MI300X AI GPUs, designed to compete directly with Nvidia's offerings. They've already caught the eye of some of the industry's biggest players.

In November 2023, Microsoft announced Azure would become the first cloud platform to implement AMD's new GPU to optimize its AI capabilities. Meanwhile, Meta Platforms has similarly signed on to use AMD's MI300X chips.

However, AMD isn't banking solely on stealing market share from Nvidia in GPUs. AMD is seeking to lead its own space within AI by doubling down on AI-powered PCs. According to research firm IDC, PC shipments are projected to see a major boost this year, with AI integration serving as a key catalyst. And a Canalys report predicts that 60% of all PCs shipped in 2027 will be AI-enabled.

AMD supplies chips to PC and notebook manufacturers across tech, with a 23% market share in laptop central processing units (CPUs). Consequently, AMD could significantly profit from increased demand for AI-equipped PCs, carving out its own niche in the burgeoning AI market.

2. Amazon

As the biggest name in e-commerce and cloud computing, Amazon has multiple use cases for AI and ways to bolster its business with the technology.

Since the start of 2023, Amazon responded to the rising demand for AI by expanding its cloud platform, Amazon Web Services (AWS). In September, the company debuted Bedrock, a tool offering a range of models that customers can use to build generative AI applications.

AWS also introduced CodeWhisperer, a platform that generates code for developers, and HealthScribe, a feature capable of transcribing patient-to-physician conversations.

In addition to improved cloud capabilities, AI could help Amazon better track shopping trends and effectively recommend products to customers on its retail site. Meanwhile, the company recently announced an AI shopping assistant called Rufus that will improve the customer experience.

Amazon is on a promising growth path in AI and has the financial resources to continue investing in its business and keep up with the competition. Over the last 12 months, the tech company's free cash flow has risen by 904% to $32 billion.

In Amazon's fourth quarter, revenue increased 14% year over year to $170 billion, beating analyst estimates by nearly $4 billion. Its earnings per share hit $1, compared to expectations of $0.80.

Amazon is in steep competition with Microsoft in the cloud market, with both ramping up their AI expansions. However, Amazon's leading market share in the industry potentially gives it a leg up.

Alongside massive growth potential in its earnings per share, Amazon's stock is a no-brainer buy over Microsoft's for anyone looking to invest in AI.