Publication Type
Conference Proceeding Article
Version
publishedVersion
Publication Date
5-2024
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 verbal self-reflective agent and Proximal Policy Optimization (PPO) that allow 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 a self-reasoning process, while the PPO trainer trains the model to generate the most likely explanations given the input texts at test-time. 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 specialized 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. Our code can be accessed through https://github.com/koa-fin/sep.
Keywords
explainable ai, large language models, stock prediction
Discipline
Artificial Intelligence and Robotics | Programming Languages and Compilers
Research Areas
Intelligent Systems and Optimization
Areas of Excellence
Digital transformation
Publication
WWW '24: The ACM Web Conference 2024, Singapore, May 13-17
First Page
4304
Last Page
4315
Identifier
10.1145/3589334.3645611
Publisher
ACM
City or Country
New York
Citation
KOA, Kelvin J.L.; MA, Yunshan; NG, Ritchie; and CHUA, Tat‑Seng.
Learning to generate explainable stock predictions using self‑reflective large language models. (2024). WWW '24: The ACM Web Conference 2024, Singapore, May 13-17. 4304-4315.
Available at: https://ink.library.smu.edu.sg/sis_research/10886
Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-No Derivative Works 4.0 International License.
Additional URL
https://doi.org/10.1145/3589334.3645611
Included in
Artificial Intelligence and Robotics Commons, Programming Languages and Compilers Commons