IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2402.03659.html
   My bibliography  Save this paper

Learning to Generate Explainable Stock Predictions using Self-Reflective Large Language Models

Author

Listed:
  • Kelvin J. L. Koa
  • Yunshan Ma
  • Ritchie Ng
  • Tat-Seng Chua

Abstract

Explaining stock predictions is generally a difficult task for traditional non-generative deep learning models, where explanations are limited to visualizing the attention weights on important texts. Today, Large Language Models (LLMs) present a solution to this problem, given their known capabilities to generate human-readable explanations for their decision-making process. However, the task of stock prediction remains challenging for LLMs, as it requires the ability to weigh the varying impacts of chaotic social texts on stock prices. The problem gets progressively harder with the introduction of the explanation component, which requires LLMs to explain verbally why certain factors are more important than the others. On the other hand, to fine-tune LLMs for such a task, one would need expert-annotated samples of explanation for every stock movement in the training set, which is expensive and impractical to scale. To tackle these issues, we propose our Summarize-Explain-Predict (SEP) framework, which utilizes a self-reflective agent and Proximal Policy Optimization (PPO) to let a LLM teach itself how to generate explainable stock predictions in a fully autonomous manner. The reflective agent learns how to explain past stock movements through self-reasoning, while the PPO trainer trains the model to generate the most likely explanations from input texts. The training samples for the PPO trainer are also the responses generated during the reflective process, which eliminates the need for human annotators. Using our SEP framework, we fine-tune a LLM that can outperform both traditional deep-learning and LLM methods in prediction accuracy and Matthews correlation coefficient for the stock classification task. To justify the generalization capability of our framework, we further test it on the portfolio construction task, and demonstrate its effectiveness through various portfolio metrics.

Suggested Citation

  • Kelvin J. L. Koa & Yunshan Ma & Ritchie Ng & Tat-Seng Chua, 2024. "Learning to Generate Explainable Stock Predictions using Self-Reflective Large Language Models," Papers 2402.03659, arXiv.org, revised Feb 2024.
  • Handle: RePEc:arx:papers:2402.03659
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2402.03659
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Stefano Giglio & Bryan Kelly & Dacheng Xiu, 2022. "Factor Models, Machine Learning, and Asset Pricing," Annual Review of Financial Economics, Annual Reviews, vol. 14(1), pages 337-368, November.
    2. Fuli Feng & Xiangnan He & Xiang Wang & Cheng Luo & Yiqun Liu & Tat-Seng Chua, 2018. "Temporal Relational Ranking for Stock Prediction," Papers 1809.09441, arXiv.org, revised Jan 2019.
    3. Fama, Eugene F. & French, Kenneth R., 2015. "A five-factor asset pricing model," Journal of Financial Economics, Elsevier, vol. 116(1), pages 1-22.
    4. Alejandro Lopez-Lira & Yuehua Tang, 2023. "Can ChatGPT Forecast Stock Price Movements? Return Predictability and Large Language Models," Papers 2304.07619, arXiv.org, revised Sep 2023.
    5. Fama, Eugene F, 1970. "Efficient Capital Markets: A Review of Theory and Empirical Work," Journal of Finance, American Finance Association, vol. 25(2), pages 383-417, May.
    6. Zihan Chen & Lei Nico Zheng & Cheng Lu & Jialu Yuan & Di Zhu, 2023. "ChatGPT Informed Graph Neural Network for Stock Movement Prediction," Papers 2306.03763, arXiv.org, revised Sep 2023.
    7. Hongyang Yang & Xiao-Yang Liu & Christina Dan Wang, 2023. "FinGPT: Open-Source Financial Large Language Models," Papers 2306.06031, arXiv.org.
    8. Alexandra Niessen-Ruenzi & Stefan Ruenzi, 2019. "Sex Matters: Gender Bias in the Mutual Fund Industry," Management Science, INFORMS, vol. 65(7), pages 3001-3025, July.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Liping Wang & Jiawei Li & Lifan Zhao & Zhizhuo Kou & Xiaohan Wang & Xinyi Zhu & Hao Wang & Yanyan Shen & Lei Chen, 2023. "Methods for Acquiring and Incorporating Knowledge into Stock Price Prediction: A Survey," Papers 2308.04947, arXiv.org.
    2. Yujie Ding & Shuai Jia & Tianyi Ma & Bingcheng Mao & Xiuze Zhou & Liuliu Li & Dongming Han, 2023. "Integrating Stock Features and Global Information via Large Language Models for Enhanced Stock Return Prediction," Papers 2310.05627, arXiv.org.
    3. Dat Mai, 2024. "StockGPT: A GenAI Model for Stock Prediction and Trading," Papers 2404.05101, arXiv.org, revised Apr 2024.
    4. Shi, Huai-Long & Zhou, Wei-Xing, 2022. "Factor volatility spillover and its implications on factor premia," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 80(C).
    5. Monica Martinez-Blasco & Vanessa Serrano & Francesc Prior & Jordi Cuadros, 2023. "Analysis of an event study using the Fama–French five-factor model: teaching approaches including spreadsheets and the R programming language," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 9(1), pages 1-34, December.
    6. Linnenluecke, Martina K. & Chen, Xiaoyan & Ling, Xin & Smith, Tom & Zhu, Yushu, 2017. "Research in finance: A review of influential publications and a research agenda," Pacific-Basin Finance Journal, Elsevier, vol. 43(C), pages 188-199.
    7. Adam Zaremba & Jacob Koby Shemer, 2018. "Price-Based Investment Strategies," Springer Books, Springer, number 978-3-319-91530-2, September.
    8. Kentaro Imajo & Kentaro Minami & Katsuya Ito & Kei Nakagawa, 2020. "Deep Portfolio Optimization via Distributional Prediction of Residual Factors," Papers 2012.07245, arXiv.org.
    9. Tobias Wiest, 2023. "Momentum: what do we know 30 years after Jegadeesh and Titman’s seminal paper?," Financial Markets and Portfolio Management, Springer;Swiss Society for Financial Market Research, vol. 37(1), pages 95-114, March.
    10. Jian Guo & Saizhuo Wang & Lionel M. Ni & Heung-Yeung Shum, 2022. "Quant 4.0: Engineering Quantitative Investment with Automated, Explainable and Knowledge-driven Artificial Intelligence," Papers 2301.04020, arXiv.org.
    11. Lu Zhang, 2017. "The Investment CAPM," European Financial Management, European Financial Management Association, vol. 23(4), pages 545-603, September.
    12. Lu Zhang, 2019. "Q-factors and Investment CAPM," NBER Working Papers 26538, National Bureau of Economic Research, Inc.
    13. Flori, Andrea, 2019. "News and subjective beliefs: A Bayesian approach to Bitcoin investments," Research in International Business and Finance, Elsevier, vol. 50(C), pages 336-356.
    14. Alex Kim & Maximilian Muhn & Valeri Nikolaev, 2023. "From Transcripts to Insights: Uncovering Corporate Risks Using Generative AI," Papers 2310.17721, arXiv.org.
    15. Seppo Pynnonen, 2022. "Non-Parametric Statistic for Testing Cumulative Abnormal Stock Returns," JRFM, MDPI, vol. 15(4), pages 1-14, March.
    16. Kewei Hou & Haitao Mo & Chen Xue & Lu Zhang, 2017. "The Economics of Value Investing," NBER Working Papers 23563, National Bureau of Economic Research, Inc.
    17. Huaibing Yu, 2019. "Long-run Cointegration and Market Equilibrium in Large Cap Stocks," Journal of Finance and Investment Analysis, SCIENPRESS Ltd, vol. 8(1), pages 1-2.
    18. Polk, Christopher & Lou, Dong & Huang, Shiyang, 2016. "The Booms and Busts of Beta Arbitrage," CEPR Discussion Papers 11531, C.E.P.R. Discussion Papers.
    19. Flori, Andrea & Regoli, Daniele, 2021. "Revealing Pairs-trading opportunities with long short-term memory networks," European Journal of Operational Research, Elsevier, vol. 295(2), pages 772-791.
    20. Breitmayer, Bastian & Massari, Filippo & Pelster, Matthias, 2019. "Swarm intelligence? Stock opinions of the crowd and stock returns," International Review of Economics & Finance, Elsevier, vol. 64(C), pages 443-464.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2402.03659. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.