Can an AI beat the S&P 500? – Composer

Can an AI beat the S&P 500?

Can AI beat the S&P 500?

This is a sincere question. This isn’t an advertisement to beat the market using AI. I actually want to know the answer: using off the shelf LLMs, can we construct an index that outperforms the S&P 500, using the current components of the index as our investable universe? That is, can we select and weight the assets in the S&P 500 better than the Standard and Poors committee can?

Motivation

LLMs are getting better and better. I’ve been pretty blown away by o3 in particular, especially when it comes to deep research. While I remain a bit skeptical of AI when it comes to creative endeavours -eg creating new information - I’m pretty convinced that AI is amazing at compressing and summarizing existing information. They can process any publicly available information and distill it down with remarkable efficiency - and increasingly better accuracy. In an especially mind-bending piece, Ben Thompson predicts that Deep Research will be able to find and present any relevant public information on a topic, regardless of its obscurity:

There is a good chance that Deep Research, particularly as it evolves, will become the most effective search engine there has ever been; it will find whatever information there is to find about a particular topic and present it in a relevant way. It is the death, in other words, of security through obscurity. Previously we shifted from a world where you had to pay for the news to the news being fed to you; now we will shift from a world where you had to spend hours researching a topic to having a topic reported to you on command.

The implications for financial markets are fairly obvious: anything about a company that is publicly disclosed and indexed on the internet can be neatly summarized by AI. Since public companies are subject to extensive disclosure requirements, it seems that AI-powered search would be especially well suited to the task of public equity research - particularly for the well known, large cap equities that make up the S&P 500. This was certainly the conclusion from a recent study out of Stanford GSB, in which a team of researchers used AI to beat human managers over 30 years of data:

“It was stunning,” deHaan says. Between 1990 and 2020, fund managers had generated $2.8 million of alpha, or benchmark-adjusted returns, every quarter. When the researchers’ AI analyst readjusted the human managers’ portfolios, it generated $17.1 million per quarter on top of the actual returns. In short, deHaan says, “AI beat 93% of managers over a 30-year period by an average of 600%.”

While methodological concerns have been raised about the Stanford study, it was certainly enough to pique my curiosity. Given that we had just released our new MCP server at Composer, I decided to try to create an AI workflow that consisted of AI research constructing a Composer “AI 500” portfolio. This way we could track the live, out-of-sample efforts by AI to beat the index.

Approach

The first step was to construct a prompt for the research process. I needed the LLM to return a subset of equities from those currently held in the S&P 500, with the goal of outperforming the market over a specific time horizon. I then needed to weight these equities according to the model’s conviction, with the weights totaling 100%. There are limitless ways to assign an LLM with this task, and it’s hard to know which way is best - particularly without a live track record. Based on intuition and a qualitative assessment of the output, here is the following prompt I landed on after quite a bit of iteration:

You are head of research at a large hedge fund, tasked with creating a superior index that is a subset of the S&P 500. Your research relies on individual company’s financial reports, your world model, and latest news and events. You are looking to identify companies that are likely to outperform in the next 12 months, by evaluating both quantitative and qualitative factors, with special attention paid to EPS revisions and earnings forecast beats. You select the top 4-5 companies within each of the following sectors, using the current holdings in the S&P 500 as your investment universe:

Once you have returned a list of the top companies for each sector and combined the results into one list, you score each company on a scale of 1-10, with 10 representing the highest likelihood of outperformance over the next year. Lastly, you then weight each company in proportion to its score, by taking its score/sum(all scores). The weights should sum to 1.0. You use these weights to construct a Composer symphony that uses specified weights according to the weights returned in the previous step.

I found the best results when feeding this prompt to OpenAI’s o3 pro. The model chugged away for 11 minutes, then returned 44 stocks out of the total S&P 500 universe, each with a target allocation corresponding to o3 Pro’s level of conviction. The model was most bullish on Nvidia (NVDA) and Eli Lilly (LLY), with Amazon (AMZN), Google (GOOGL), Meta (META) and Berkshire Hathaway (BRK.B) not far behind. You can see what the full output from chatgpt looks like here. And if you want to skip right to seeing the holdings, you can check them out in a google sheet.

Now that I had my list of tickers and their corresponding weights, I needed to construct a Composer symphony. For this step I fired up Claude desktop, where I already had the Composer MCP server installed. I used the following prompt, along with a CSV with weights and tickers from the previous step:

Using the attached csv, use the tickers and weight columns to construct, save and backtest a Composer symphony

Short and sweet - and it worked! Here’s what the response looks like. And here’s the symphony I created.

We can see from the backtest stats that our AI generated index tracks the S&P 500 well in terms of beta and correlation, while generating material alpha over the last three years:

Of course, a backtest says nothing about future performance, which brings us to our final step.

Following along

I’m eager to see how this AI constructed index fares relative to the S&P 500 on real out of sample data. Now that we’ve drawn a line in the sand on July 10, 2025, we can track live performance going forward. Our prompt specified outperformance over the next year; we can now look at both cumulative return and Sharpe ratio relative to SPY over the next 12 months as our concrete evaluation criteria. You can follow the symphony in Composer, or you can follow our twitter handle @TheAI500, where we will post periodic updates on how it does. I’m not really sure if I’m rooting more for AI or the humans over at S&P, but I’m excited to know the outcome regardless.