Artificial intelligence (AI) has the potential to make products and services more effective and efficient. But that won't come at the flip of a switch. Companies will need to invest heavily in those opportunities to take advantage of them. Ramping up AI infrastructure to tap into those capabilities will cost lots of money. And big tech companies such as Microsoft (MSFT 1.82%) and Alphabet (GOOG 9.96%) could be in the pole position when it comes to that.

AI is a huge opportunity, but it will take work

According to estimates from Grand View Research, the global AI market was worth $136.6 billion last year. But the growth opportunities are in their early stages; analysts believe the market will expand at a compound annual growth rate of 37.3% until the end of the decade. For investors, tapping into a market that's growing so fast could mean significant returns. 

While the opportunities will be there to revolutionize many industries and change the way people use products and services, the infrastructure will need to be in place to support it. That means companies also need to have money to invest to take advantage of all that potential growth.

Microsoft has invested $13 billion into ChatGPT maker OpenAI. And on top of that, the company is still spending more on AI infrastructure to help build out its capabilities. On the company's fourth-quarter earnings call, Microsoft said its capital expenditures totaled $10.7 billion for the period ended June 30, which included a greater outlay for AI infrastructure. Over the years, Microsoft has continually ramped up its spending, which has allowed it to remain a dominant force in tech.

MSFT Capital Expenditures  (Annual) Chart

Data source: YCharts

For smaller AI companies, it's going to be a big hurdle to compete with giants such as Microsoft and Alphabet, which also has a chatbot -- Bard. 

Microsoft and Alphabet are money-making machines

Both Alphabet and Microsoft generate tens of billions of dollars in free cash flow each year. They are well equipped to handle the necessary investments in cloud software and hardware capabilities to support AI developments.

MSFT Free Cash Flow Chart

Data source: YCharts

By comparison, companies such as C3.ai and Upstart Holdings that are involved with AI and that investors have been buying up feverishly this year (their shares are up more than 250% year to date) have more challenging financials:

AI Free Cash Flow Chart

Data source: YCharts

Although these businesses may not be competing head-on with Alphabet or Microsoft, the above chart offers a sobering reminder that these companies may face some big challenges in expanding their AI capabilities and businesses unless their cash flow improves.

Microsoft and Alphabet are mature businesses with strong financials, putting them in the driver's seat when it comes to these kinds of opportunities.

Should investors avoid cash-burning AI stocks?

The benefit of investing in smaller businesses, including C3.ai and Upstart Holdings, is that there's more potential for high returns given their more modest market caps. While Alphabet and Microsoft have big advantages, they're not nearly as likely to double or triple in value, even if AI proves to be a huge growth opportunity for their businesses.

Investors don't need to necessarily avoid all risky AI stocks, but they should consider the dangers of allocating too much money to a business that may need recurring stock offerings to stay afloat. If you're comfortable with the risk, then these stocks can still make for good investments, but it's always important to temper your expectations, and not every AI stock will provide a great return.