Assessing Look-Ahead Bias in Stock Return Predictions Generated By GPT Sentiment Analysis (2309.17322v1)
Abstract: LLMs, including ChatGPT, can extract profitable trading signals from the sentiment in news text. However, backtesting such strategies poses a challenge because LLMs are trained on many years of data, and backtesting produces biased results if the training and backtesting periods overlap. This bias can take two forms: a look-ahead bias, in which the LLM may have specific knowledge of the stock returns that followed a news article, and a distraction effect, in which general knowledge of the companies named interferes with the measurement of a text's sentiment. We investigate these sources of bias through trading strategies driven by the sentiment of financial news headlines. We compare trading performance based on the original headlines with de-biased strategies in which we remove the relevant company's identifiers from the text. In-sample (within the LLM training window), we find, surprisingly, that the anonymized headlines outperform, indicating that the distraction effect has a greater impact than look-ahead bias. This tendency is particularly strong for larger companies--companies about which we expect an LLM to have greater general knowledge. Out-of-sample, look-ahead bias is not a concern but distraction remains possible. Our proposed anonymization procedure is therefore potentially useful in out-of-sample implementation, as well as for de-biased backtesting.
- Charles W Calomiris and Harry Mamaysky “How news and its context drive risk and returns around the world” In Journal of Financial Economics 133.2 Elsevier, 2019, pp. 299–336
- “Extracting Training Data from Large Language Models” In 30th USENIX Security Symposium (USENIX Security 21) USENIX Association, 2021, pp. 2633–2650
- “ChatGPT Informed Graph Neural Network for Stock Movement Prediction” In SSRN Electronic Journal Elsevier BV, 2023 DOI: 10.2139/ssrn.4464002
- Sanjiv R Das and Mike Y Chen “Yahoo! for Amazon: Sentiment extraction from small talk on the web” In Management science 53.9 Informs, 2007, pp. 1375–1388
- Kenneth French “U.S. Research Returns Data”, https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html, 2023
- Diego Garcia, Xiaowen Hu and Maximilian Rohrer “The colour of finance words” In Journal of Financial Economics 147.3 Elsevier, 2023, pp. 525–549
- Paul Glasserman, Fulin Li and Harry Mamaysky “Time variation in the news-returns relationship” In Available at SSRN, 2022
- Anne Lundgaard Hansen and Sophia Kazinnik “Can ChatGPT Decipher Fedspeak?” In Available at SSRN, 2023
- Zheng Tracy Ke, Bryan T Kelly and Dacheng Xiu “Predicting returns with text data” In Available at SSRN, 2019
- “Can ChatGPT Forecast Stock Price Movements? Return Predictability and Large Language Models”, 2023 arXiv:2304.07619 [q-fin.ST]
- OpenAI “GPT-4”, https://openai.com/research/gpt-4, 2023
- “Upstream Mitigation Is Not All You Need: Testing the Bias Transfer Hypothesis in Pre-Trained Language Models” In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) Dublin, Ireland: Association for Computational Linguistics, 2022, pp. 3524–3542
- Paul C Tetlock “Giving content to investor sentiment: The role of media in the stock market” In Journal of Finance 62.3 Wiley Online Library, 2007, pp. 1139–1168
- Paul C Tetlock, Maytal Saar-Tsechansky and Sofus Macskassy “More than words: Quantifying language to measure firms’ fundamentals” In Journal of Finance 63.3 Wiley Online Library, 2008, pp. 1437–1467
- “Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Models” In Advances in Neural Information Processing Systems 35 Curran Associates, Inc., 2022, pp. 38274–38290