Artificial intelligence (AI) was the dominant stock market theme in 2023. Nvidia experienced a surge in demand for its data center chips designed to process AI workloads, and its stock soared 239% for the year. It was the best performer in the entire S&P 500 index, and it has continued to march higher in 2024.

Shares of other popular AI companies also delivered market-beating returns, including Microsoft, Amazon, and Alphabet.

But AI is no different from any other tech revolution throughout history, in that not every company will succeed. There will be winners and losers, and the industry is already experiencing volatility. C3.ai was the world's first stand-alone enterprise AI company when it was founded in 2009, and while its stock surged 157% in 2023, it's still trading 85% below its all-time high.

But you don't need a crystal ball to make money over the long term. There's a way for investors to buy AI stocks while limiting their exposure to the inevitable failures.

A potted plant carved in the shape of an upward-trending arrow.

Image source: Getty Images.

Exchange-traded funds might be the answer

Instead of buying several individual AI stocks -- which certainly involves picking winners and losers -- investors can buy an exchange-traded fund (ETF) focused on AI. An ETF can hold up to thousands of individual stocks to give investors exposure to a specific index, sector, or strategy.

Given ETFs have many holdings, the failure of any one company shouldn't derail the entire portfolio. That protects investors from catastrophic losses, which is crucial when deploying money into any new segment of the market.

Several AI-focused ETFs have come online over the last few years. I'll explain why the Global X Artificial Intelligence and Technology ETF (AIQ 0.20%) and the Global X Autonomous and Electric Vehicle ETF (DRIV -0.50%) are two great options.

1. Global X Artificial Intelligence and Technology ETF (AIQ)

The Global X Artificial Intelligence and Technology ETF (AIQ) is one of the best options for investors who are new to investing in AI. It holds 86 different stocks, so it's one of the most diversified funds in the AI space.

However, AIQ is heavily weighted toward its top 10 positions, which account for 34.7% of the total value of its portfolio. That can lead to heightened volatility, but those positions include some of the most popular stocks in the AI industry:

Stock

Global X AI and Technology ETF Weighting

1. Intel

3.90%

2. Nvidia

3.69%

3. Meta Platforms

3.59%

4. ServiceNow

3.55%

5. IBM

3.40%

6. Salesforce

3.39%

7. Alphabet

3.36%

8. Qualcomm

3.36%

9. Amazon

3.29%

10. Adobe

3.25%

Data source: Global X ETFs. Portfolio weightings accurate as of Jan. 19, 2024, and are subject to change.

Nvidia makes the most powerful AI data center chips in the world, so its relatively high weighting in AIQ makes the ETF very attractive. Alphabet and Amazon are two other leading AI stocks, given their cloud computing platforms are distributing the technology to millions of businesses across the globe.

Companies like Meta Platforms, Salesforce, and Adobe are using AI to enhance their existing product offerings. Meta, for example, uses it to feed more relevant content to users of Facebook and Instagram. And Adobe's Firefly technology empowers users to create media content instantly thanks to generative AI, which is enhancing existing software like Photoshop.

AIQ also owns a number of other popular AI names outside of its top 10, including Microsoft, Apple, and Tesla.

The AIQ ETF delivered a whopping 55% return in 2023, more than doubling the return of the S&P 500. It has also delivered an average annual return of 14.3% since its inception in 2018, again outperforming the S&P 500's average annual return of 10.6% over the same period.

Given AIQ assigns such a heavy weighting to some of the world's largest and fastest-growing AI companies, that outperformance will likely continue.

2. Global X Autonomous and Electric Vehicles ETF (DRIV)

The Global X Autonomous and Electric Vehicles ETF (DRIV) is a good choice for investors who have a higher appetite for risk. Rather than investing broadly in AI stocks, DRIV focuses specifically on the AI opportunity around electric vehicles and self-driving technology. It holds 76 different stocks in those fields.

Like AIQ, DRIV is also quite concentrated because its top 10 holdings represent 34.4% of the total value of its portfolio. However, it assigns a higher weighting to stocks like Nvidia, Alphabet, and Tesla:

Stock

Global X Autonomous and Electric Vehicles ETF Weighting

1. Nvidia

4.59%

2. Intel

4.19%

3. Alphabet

4.17%

4. Toyota Motor

3.79%

5. Qualcomm

3.58%

6. Apple

3.57%

7. Honeywell

2.81%

8. Microsoft

2.75%

9. Tesla

2.71%

10. Hitachi

2.26%

Data source: Global X ETFs. Portfolio weightings accurate as of Jan. 19, 2024, and are subject to change.

While most investors focus on Nvidia for its data center chips, the company has an entire automotive segment. Its Drive platform offers all the hardware and software necessary for car manufacturers to develop autonomous vehicles. Similarly, Alphabet isn't just an internet and cloud computing company -- it's also home to Waymo, an early mover in self-driving technology.

Apple might seem out of place in the DRIV ETF, but rumors have swirled for years that it's developing a self-driving vehicle. Some reports even suggest it could be announced this year.

Tesla is the most obvious candidate for the DRIV ETF. It's one of the largest manufacturers of electric vehicles in the world, and it has designed a production process that relies heavily on robotics and automation to reduce costs. Plus, its self-driving software is possibly the most advanced in the world, considering it has logged over 300 million miles in the real world during its beta phase.

The DRIV ETF delivered a return of 24% in 2023, matching the S&P 500. The ETF was weighed down by poor performances from Lucid Group, Nikola, and Plug Power, which collapsed in value last year as the demand for electric vehicles slowed. A high concentration in a specific industry carries risk, but last year's result highlights the benefit of owning an ETF -- despite substantial declines in some stocks, DRIV still delivered a solid return for investors.

Long term, electric and self-driving vehicles have the potential to grow into gigantic industries, and that bodes well for this ETF.