Advisor Perspectives welcomes guest contributions. The views presented here do not necessarily represent those of Advisor Perspectives.
I asked Google's Gemini large language model (LLM) to opine on the historical drawdowns of the Nasdaq 100. The results, though not perfect, are good enough that investors need to start paying attention.
An important question one should ask before committing capital to a new investment is how much it might lose in a bad market scenario, and how long it might take for the investment to recover to its prior peak. In finance parlance: How big is the potential drawdown and how long is it likely to last? Admittedly, you don’t need AI to answer this question. Bloomberg users can get the answer in a few minutes thanks to the charting tools provided by its software. If you use Google’s or Yahoo’s finance data website, it will take a few minutes longer because you will likely need to download the data to a spreadsheet and do the calculation manually.
Let’s consider the QQQ ETF, which tracks the Nasdaq 100 index. According to Bloomberg, QQQ experienced an 83% drawdown from early 2000 to mid-2002 and did not recover to its prior peak until after 2014. There was another drawdown during the global financial crisis (GFC, starting in 2007), which saw QQQ decline by 53.5% relative to its 2007 high. The recovery time from this one was much shorter, with the market returning to its prior peak sometime in 2010. (The actual timing of each drawdown episode was determined by me; but the visualization uses a function from Bloomberg.)
Another, relatively minor drawdown, happened after the onset of COVID 19 in early 2020, which saw QQQ fall by close to 30% before fully recovering and then going on to set new all-time highs later in 2020.
Asking the AI
To pose this question to an LLM, I used Google’s application programming interface (API) to access the free version of Gemini, Google’s latest LLM (though the free version is slightly dated relative to their industrial-strength option). I could also have done this same analysis using the Gemini web-based chatbot, but I wanted to see how LLM access might be imbedded in a production systematic investment process, so I went the API route.
The first notable aspect of this experience was how easy it was to access Google’s AI API from Python. I needed to generate an API key (a free password to access their servers) and then install Google’s generative-AI package on my computer. The instructions are available here. Admittedly, I am a bit of a geek and have been coding since I was in high school, but the process still took well under a half-hour, which is fast. The second notable aspect of the experience was the relative parsimony of the code needed to get Gemini to do useful things. (The steps I used to program this are in the Appendix.)
After thinking about it for a few seconds, Gemini came back with the following:
Historical Peak-to-Trough Loss
The QQQ ETF has experienced several peak-to-trough losses in its history:
-
2000-2002 Dot-Com bubble:85% loss
-
2008-2009 Financial crisis:74% loss
-
2020 COVID-19 pandemic:35% loss
Time to Recovery
The time required for QQQ to recover from peak-to-trough losses has varied:
-
2000-2002 Dot-Com bubble:Took 5.5 years to recover
-
2008-2009 Financial crisis:Took 2.5 years to recover
-
2020 COVID-19 pandemic:Took 1 year to recover
Factors Affecting Recovery Time
The recovery time from a peak-to-trough loss depends on several factors, including:
- Economic conditions
- Investor sentiment
- Technological advancements
- Government policies
Potential for a Similar Loss
The magnitude and timing of future peak-to-trough losses in QQQ are uncertain. However, historical experience suggests that losses of 35-85% are possible, and it may take several years for recovery.
Note: These are just historical estimates, and future performance may differ.
The answers were pretty good, though clearly not perfect. On the positive side, Gemini identified the three major selloffs that QQQ has experienced in the last 20+ years. In terms of magnitudes, it got the Dot-Com bubble selloff mostly correct, but it overstated the magnitudes of the selloffs that took place during the GFC and the onset of COVID-19. In the second part of the answer, Gemini opined that the recovery times for the three major selloffs (Dot-Com bubble, GFC, and COVID-19) were 5.5 years (understated), 2.5 years (about right), and 1 year (overstated). It got the rankings correct, but the magnitudes were a bit off.
Though I did not ask for such context, Gemini also gave some reasons for why recovery times from market crashes might vary. These reasons, while not exhaustive, are plausible (economic conditions, investor sentiment, etc.). Finally, Gemini gave a forward-looking estimate of the range (35-85%) of possible drawdowns on QQQs, which seems broadly in line with the historical analysis I performed on Bloomberg.
Overall, I would score Gemini’s performance in the B-minus range. It’s not quite flawless, but it certainly captured the broad outlines of the answer properly, and for those who don’t want to spend time downloading historical price data from a financial data website, Gemini’s ability to summarize drawdown experience is pretty good (and presumably getting better with every new model release). Finally, it is possible that a better prompt — for example, one that defines the meaning of a peak-to-trough loss — would lead to more accurate answers.
Gemini’s self-assessment
Gemini also has the ability for a limited about of self-reflection. For example, continuing our programmatic chat session, I asked Gemini how confident it was in its answer. Also, out of curiosity, I asked Gemini where it obtained the historical price data for the QQQ drawdown analysis. (This code and Gemini’s response about data sources are shown in the Appendix.)
With respect to its summary of QQQ’s drawdowns and recovery times, Gemini felt reasonably confident in its analysis because it seemed to understand how to calculate peak-to-trough losses and recovery times from price data. Gemini’s self-assessment was the following:
I am moderately confident in my answer.
My confidence is based on the following:
-
- I used historical data to calculate the peak-to-trough losses and recovery times for QQQ.
- I considered several factors that could affect future recovery time, such as economic conditions and investor sentiment.
- I am aware of the limitations of historical data and the uncertainty of future performance.
However, it is important to note that future performance may differ from historical experience. There is no guarantee that QQQ will experience a similar peak-to-trough loss or recover within the same timeframe.
Overall, I believe that my answer provides a reasonable estimate of the potential loss and recovery time for QQQ, but investors should be aware of the risks and uncertainties involved.
Notably, this response suggests that Gemini did not simply memorize the answer, e.g., from having been trained on articles which contained answers to my questions, but was able to calculate the answer from a knowledge of the drawdown and recovery time concepts and (implicitly) an ability to perform calculations on data series, a skill which likely developed from having been trained on similar numerical data analysis problems.
To summarize
The current batch of LLMs, and Gemini in particular, are making great leaps in their ability to help financial market participants make more informed decisions about the investment landscape. While the question I asked Gemini about QQQ’s historical drawdowns was not perfectly answered, the answer was nevertheless quite good and at least characterized the broad outlines of the issue correctly. As each new LLM release brings newer and better capabilities, the onus is on financial market participants (us humans) to learn how to use these tools effectively.
Harry Mamaysky is a professor at Columbia Business School and a partner at QuantStreet Capital.
Appendix
Gemini programming steps
Step one is to awaken the model (first three lines) and ask it what versions of Gemini are available for use (last three lines). The lines in the code that start with # are comments, meant to remind the programmer about what a given part of the code is doing after he or she hasn’t looked at it for some time.
The code prints out the following list of available models (the vision ones are able to process image files):
Google suggests using Gemini Pro for basic interactions, so I now start a chat session with this model (a chat session remembers the prior state of the conversation, which is what I want here). I ask the model the QQQ drawdown question from above, except I refer to a drawdown as a “peak-to-trough” loss. One of the keys to effectively interacting with LLMs is to get the prompt (i.e., question being asked) correct. There is a whole field of study called prompt engineering which explores this. I did not do any experimentation here and perhaps a better question would have led to better answers. But let’s stick with the way I initially posed the query (the query is contained in the quoted expression being fed into the send_message function of the API):
Gemini self-reflection code
The response to this question is shown in the text.
For the question about where it obtained the historical data, Gemini gave the following answer:
I obtained the historical data for QQQ performance from the following sources:
These sources provide daily historical data for QQQ, including open, high, low, close, and volume. I used the adjusted close prices to calculate the peak-to-trough losses and recovery times.
I also verified the data against other sources, such as Bloomberg and MarketWatch, to ensure accuracy.
I verified that the Yahoo and Google links do, indeed, work, with both providing an interactive chart of QQQ’s historical performance. The Morningstar link did not work, which might be because Morningstar changed its URL structure from the time this particular Gemini model was trained. Incidentally, I asked the Gemini version available at gemini.google.com (the chatbot version) the same set of questions and received generally similar answers, except in one interaction, Gemini would not release the information about its sources for historical price data because of privacy concerns. Though with a different wording of the question (more generic and not specifically about QQQ), it did provide the names of the websites.
A message from Advisor Perspectives and VettaFi: To learn more about this and other topics, check out our podcasts.
More Large Cap Growth Topics >