Recent advances in artificial intelligence are fueling optimism over how businesses can operate more productively in the years ahead. They are also providing a big boost to the stock market. The S&P 500’s (.SPX) 9% rally this year has been driven by a handful of the index’s biggest stocks, a number of which are at the center of the AI frenzy that has spread in the wake of the chatbot sensation ChatGPT. Five stocks – Microsoft (MSFT.O), Google parent Alphabet (GOOGL.O), Nvidia (NVDA.O), Apple (AAPL.O) and Meta Platforms (META.O) – are responsible for the S&P 500’s entire year-to-date return, said Jessica Rabe, co-founder of DataTrek Research. About 25% to 50% of those gains are owed to “the buzz around artificial intelligence,” she noted. A recent Societe Generale analysis zeroed in on 20 stocks widely owned by AI-related exchange-traded funds, whose overall assets under management have grown almost 40% this year. Removing those stocks from the S&P 500 would reduce the index’s performance by roughly 10 percentage points, putting stocks in negative territory for the year, SocGen’s analysis showed. “It’s the AI-driven stocks that are getting the strongest returns,” said Manish Kabra, head of US equity strategy at SocGen. “As a secular theme, for sure, it’s attractive.” The rush of AI developments has analysts licking their lips at the profit potential stemming from new revenue opportunities and productivity improvements. Goldman Sachs strategists estimate that generative AI could create productivity gains that result in S&P 500 companies expanding profit margins by about 4 percentage points in a decade following widespread adoption. Indeed, optimism over AI is a key factor supporting a stock market facing numerous headwinds. Those include uncertainty over the U.S. Congress coming to agreement to raise the debt ceiling and avoid a default, and worries the economy may be on the verge of a downturn, as the Federal Reserve’s interest rate hikes filter through the economy. “We are strongly of the view that AI will change the world,” Jim Reid, strategist at Deutsche Bank, said in a note titled, “Will ChatGPT prevent the US recession?” The AI excitement has helped propel hefty gains for some stocks. For example, shares of Microsoft, the second-largest U.S. company by market value, have climbed 32% this year. The software giant has grabbed headlines with its partnership with ChatGPT creator OpenAI and sprucing up its Bing search engine with AI. Shares of Nvidia, the fifth-biggest U.S. company by market value whose chips are central in the AI excitement, have soared 110% this year. The Global X Robotics & Artificial Intelligence ETF (BOTZ.O) has jumped nearly 30% this year. Investors next week will be keeping an eye on developments regarding the U.S. debt ceiling, as well as inflation data and corporate earnings including results from Nvidia. Other factors have supported megacap stocks.