Experiments in AI Finance: Assessing GPT-4's Stock Forecasting Ability (2024)

Experiments in AI Finance: Assessing GPT-4's Stock Forecasting Ability (1)

  • Report this article

Max Spehlmann Experiments in AI Finance: Assessing GPT-4's Stock Forecasting Ability (2)

Max Spehlmann

M.S. Candidate in Analytics at the Institute for Advanced Analytics, North Carolina State University

Published Jan 22, 2024

+ Follow

Is it wise to rely on a Large Language Model (LLM) like GPT-4 for financial guidance? Probably not! OpenAI itself states that their model output "should not be considered professional advice."

Even so, many people are imagining new uses for LLMs, many of which involve market analysis. I embarked on a simple yet revealing experiment to evaluate GPT-4's forecasting accuracy in the stock market. The results are at once interesting and entirely predictable.

The Experiment:

GPT-4's training data does not currently include any content published after April 2023. I prompted GPT-4 to construct a portfolio that would surpass the S&P-500's performance over eight months. To my surprise, by December 31, 2023, the LLM's portfolio outperformed the S&P 500 by an impressive 20%!

However, was this genuine forecasting skill?

To investigate, I asked GPT-4 to generate three distinct portfolios:

  1. Negative Control: a portfolio that would underperform the S&P 500.
  2. Control: a portfolio that would mirror the S&P 500's performance.
  3. Experimental: a portfolio created by chaining several prompts together, providing the LLM additional pre-April 2023 data.

I tracked these portfolios from April to December 2023.

Results:

Experiments in AI Finance: Assessing GPT-4's Stock Forecasting Ability (3)

All three portfolios, including the negative control, outperformed the S&P 500 by approximately 20%! The additional information provided to the LLM, seemed to have no effect on the LLMs forecasting ability. In fact, the negative control yielded the strongest portfolio, indicating that the LLM was not exhibiting any skill whatsoever.

Implications:

The results hint that the LLM did not meaningfully “understand” the prompts. While it could generate portfolios, there seemed to be no strategic reasoning behind its choices. Instead, it appears GPT-4 favored stocks frequently mentioned in its training data. This was further evidenced when I asked the LLM for stock tickers it felt most confident discussing; the response included fifteen tickers, all of which appeared in every portfolio generated.

AI language models like GPT-4 can certainly offer valuable market insights, but their current iteration is probably not suited for independent financial decision-making.

Closing Thoughts:

There are anecdotes of individuals using tools that leverage LLMs to sift through financial data and “turbocharge” their portfolios. While these tools might be helpful, the inherent biases in an LLM's training data should not be ignored. One should consider questions like, if an LLM processed thousands of articles with a positive view of a particular company, would it be likely to advise against investing in that company?

As we move further into an era where both physical and cognitive tasks are becoming subject to automation, it's wise to ponder these questions. Especially since the internal mechanics of these AI entities, as of now, remain largely elusive.

Source Code:

This project was created with help from Joshua Cooper, a fellow master’s student at the Institute for Advanced Analytics at NCSU. The code was written in Python and used the OpenAI and Pandas packages. Please feel free to explore, modify, and adapt the code by following this link to a Google Colab document.

Thank you for reading!

Help improve contributions

Mark contributions as unhelpful if you find them irrelevant or not valuable to the article. This feedback is private to you and won’t be shared publicly.

Like
Comment

34

6 Comments

David Gohl

Managing Risks and Ensuring Compliance at Amazon.

2mo

  • Report this comment

Great concept and article! Risk assessments of geo-political and volatile market conditions are not in the training data of LLMs. They fall behind. Maturity of LLMs needs to happen first; however, I see this technology playing a major role in finance, especially if training data is current and accurate, and prompts are on point. Once again, great concept!

Like Reply

1Reaction 2Reactions

Piotr Malicki

NSV Mastermind | Enthusiast AI & ML | Architect AI & ML | Architect Solutions AI & ML | AIOps / MLOps / DataOps Dev | Innovator MLOps & DataOps | NLP Aficionado | Unlocking the Power of AI for a Brighter Future🌌

2mo

  • Report this comment

Interesting findings! Can't wait to learn more about your experiment. 👍

Like Reply

1Reaction 2Reactions

Michelle Chen

M.S. Candidate in Analytics at the Institute for Advanced Analytics, North Carolina State University

2mo

  • Report this comment

Super interesting work, Max Spehlmann and Joshua Cooper! I’m excited to attend your presentation.

Like Reply

1Reaction 2Reactions

Sarah Egan Warren

Teaching Asst Professor, Ethical Data Storyteller, DELTA Faculty Fellow

2mo

  • Report this comment

Really looking forward to seeing your work!

Like Reply

2Reactions 3Reactions

Joshua Cooper

M.S. Candidate in Analytics, Institute for Advanced Analytics

2mo

  • Report this comment

We are looking forward to presenting this project at the annual Institute for Advanced Analytics Side Project Poster Session organized by Sarah Egan Warren.Join us via Zoom on Monday, Jan 22 at 12:15-12:45 EST using the link below:https://ncsu.zoom.us/j/5936121734Link to our poster:https://lnkd.in/egd6_uma (https://lnkd.in/egd6_uma)tinyurl.com/Poster2024 (http://tinyurl.com/Poster2024)

Like Reply

3Reactions 4Reactions

See more comments

To view or add a comment, sign in

More articles by this author

No more previous content

  • LLM-Powered Stock Market Prediction Tool: A Proof of Concept Oct 30, 2023

No more next content

Sign in

Stay updated on your professional world

Sign in

By clicking Continue, you agree to LinkedIn’s User Agreement, Privacy Policy, and Cookie Policy.

New to LinkedIn? Join now

Insights from the community

  • Data Analytics What are the top machine learning algorithms for data analysis in the financial industry?
  • Financial Technology How can you use machine learning models to improve stress testing in financial institutions?
  • Artificial Intelligence How can you build an AI algorithm portfolio for financial trading?
  • Machine Learning You want to improve Machine Learning scalability. Can creativity help you get there?
  • Algorithms You’re working with machine learning in algorithms. What do you need to know to avoid common mistakes?
  • Machine Learning How can you improve your critical thinking skills when evaluating Machine Learning models?
  • Machine Learning What do you do if you suspect biases in Machine Learning algorithms?
  • Data Analytics What are the latest developments in machine learning explainability?
  • Entrepreneurship What do you do if your business processes need optimization using machine learning algorithms?
  • Algorithms What are the most effective algorithms for predicting stock prices?

Others also viewed

  • Staying Ahead: Harnessing AI Innovation for Data Scientists in Finance Katalis.App 1mo
  • Today's Tech Digest Kannan Subbiah 6y
  • AI in Finance: Tackling Basis Risk with GPT William Webster 6mo
  • Revolutionizing Finance through Machine Learning: A Deep Dive into Data-Driven Insights and Predictive Power Trustify Technology 7mo
  • Challenges in Implementing Explainable AI in the Finance Industry Brindha Jeyaraman 10mo
  • Machine Learning for Earnings Prediction Ralf Elsas 1mo
  • Financial Machine Learning Ben Lorica 罗瑞卡 3mo
  • NeurIPS 2020, Finance and Business Analytics. Aniruddha Godbole 3y
  • Understanding Machine Learning... In Treasury 🤖💵 Corporate Treasury 101 6mo
  • The Power of Human in Loop in Finance and Artificial Intelligence Theoremlabs.io 5mo

Explore topics

  • Sales
  • Marketing
  • Business Administration
  • HR Management
  • Content Management
  • Engineering
  • Soft Skills
  • See All
Experiments in AI Finance: Assessing GPT-4's Stock Forecasting Ability (2024)
Top Articles
Latest Posts
Article information

Author: Geoffrey Lueilwitz

Last Updated:

Views: 5956

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Geoffrey Lueilwitz

Birthday: 1997-03-23

Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

Phone: +13408645881558

Job: Global Representative

Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.