The S&P 500 (SNPINDEX: ^GSPC) has rocketed 19% higher this year amid cooling inflation and better-than-expected corporate earnings. But some credit goes to recent breakthroughs in generative artificial intelligence (AI), a technology that uses simple prompts to create content and automate various business processes. Generative AI promises to bring a step-function improvement to labor productivity, and the implications on corporate profits have whipped Wall Street into a frenzy.

Several strategists have set lofty S&P 500 price targets to account for market sentiment and the potential benefits of AI. For instance, Goldman Sachs analyst David Kostin says the S&P 500 could climb another 9% to 4,975 this year. Yardeni Research president Ed Yardeni sees the index rising 18% to 5,400 by the end of next year. And Capital Economics strategist Thomas Mathews sees the S&P 500 soaring 42% to 6,500 by the end of 2025.

Those forecasts make a strong case for buying AI stocks, but investors should also consider hedging their bets with an S&P 500 index fund like the Vanguard S&P 500 ETF (VOO 1.00%). Here's why.

Warren Buffett recommends an S&P 500 index fund

The Vanguard S&P 500 ETF tracks the performance of 500 large-cap U.S. companies. Its constituents comprise growth stocks and value stocks from all 11 market sectors, providing investors with diversified exposure to many of the most influential businesses in the world.

In doing so, the Vanguard S&P 500 ETF mitigates risk that would otherwise be present in a smaller, more concentrated portfolio of individual stocks. The weighted exposure of its 10 largest holdings are detailed below:

  1. Apple: 7.8%
  2. Microsoft: 6.8%
  3. Alphabet: 3.6%
  4. Amazon: 3.1%
  5. Nvidia: 2.8%
  6. Tesla: 1.9%
  7. Meta Platforms: 1.7%
  8. Berkshire Hathaway: 1.6%
  9. UnitedHealth Group: 1.2%
  10. ExxonMobil: 1.2%

In a sense, the Vanguard S&P 500 ETF makes it possible for investors to take a stake in the U.S. economy, and many trustworthy figures in the financial world see that as a compelling investment thesis. Indeed, JPMorgan Chase CEO Jamie Dimon says the U.S. is the largest, most prosperous, and most innovative economy the world has ever seen. And Berkshire CEO Warren Buffett has warned investors not to bet against America.

More to the point, Buffett wrote the following in his 2013 shareholder letter:

The goal of the non-professional should not be to pick winners -- neither he nor his "helpers" can do that -- but should rather be to own a cross-section of businesses that in aggregate are bound to do well. A low-cost S&P 500 index fund will achieve this goal.

The S&P 500 has been a good investment throughout history

Investors don't have to choose between owning individual stocks and owning an S&P 500 index fund. I personally own dozens of stocks, but I also keep a good portion of my portfolio in the Vanguard S&P 500 ETF. I see the individual stocks as opportunities to make a significant amount of money and view the index fund as a sort of safety net.

As a caveat, there is always risk involved where the stock market is concerned, even if the stock market exposure comes from an index fund. But the S&P 500 has never failed to produce a positive return over any 20-year period in history, meaning investors are virtually guaranteed a profit if they hold the Vanguard S&P 500 ETF long enough.

Moreover, the S&P 500 returned a total of 580% over the last two decades, which is the same as 10.05% annually. That rate of return may pale in comparison to some individual stocks, but an S&P 500 index fund can still transform small sums of money invested regularly into a million-dollar portfolio. Indeed, assuming returns of 10.05% annually, $150 invested weekly in the Vanguard S&P 500 ETF would be worth $1.5 million in three decades' time.

Investors don't need to buy AI stocks to benefit from AI

Enthusiasm surrounding AI has undoubtedly played a role in the ongoing stock market rally, and that trend will likely continue in years ahead. Indeed, 110 of the S&P 500 companies discussed AI during their earnings calls for the quarter ended March 31, and some of those companies will see their share prices soar as AI brings greater efficiency and productivity to their businesses in the future.

However, investors don't need to buy AI stocks to benefit. AI is the latest in a long line of trends that have driven the stock market higher throughout history -- think about how the advent of the internet has impacted the stock market -- and investors can capitalize on the growing demand for AI software and services (or any other trend that may arise) by simply buying an S&P 500 index fund like the Vanguard S&P 500 ETF.