Stock Price Prediction with LLM-Guided Market Movement Signals and Transformer Model
DOI:
https://doi.org/10.47852/bonviewFSI52025703Keywords:
deep learning, financial news, LLM, stock price prediction, sentiment analysis, transformerAbstract
Accurate stock price prediction is difficult because financial markets are complex and affected by various factors. Traditional methods often fail to analyze financial news and market trends effectively. Recent improvements in large language models (LLMs) allow better extraction of insights from text and stock data. Motivated by these advances, this paper introduces a new approach that combines LLM-generated stock predictions with a Transformer model to forecast prices. Specifically, a structured prompt fed with financial news and stock features is designed. Then, the prompt-based LLM approach is used to generate the predicted trend in the form of a one-hot vector and its corresponding probability. Finally, the LLM-generated output, together with historical closing prices, is used as input to a Transformer model to predict the stock price for the next day. To examine the effectiveness of the proposed framework, models such as Long Short Term Memory (LSTM), Temporal Convolutional Network, Convolutional Neural Network (CNN), CNN-LSTM, Random Forest, support vector regressor, XGBoost, and vanilla Transformer are chosen for comparison. In addition, an ablation study is conducted under several configurations. The findings indicate that the proposed framework exhibits superior performance compared to all the baseline models. Moreover, the ablation study demonstrates that integrating LLM-predicted features has the potential to improve stock price prediction performance.
Received: 16 March 2025 | Revised: 13 June 2025 | Accepted: 26 June 2025
Conflicts of Interest
The author declares that he has no conflicts of interest to this work.
Data Availability Statement
The stock data that support the findings of this study can be downloaded from Yahoo Finance using the Python library finance. The news data can be downloaded using the Financial News Feed and Stock News Sentiment data API (https://eodhd.com/financial-apis/stock-market-financial-news-api).
Author Contribution Statement
Qizhao Chen: Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Resources, Data curation, Writing – original draft, Writing – review & editing, Visualization.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Author

This work is licensed under a Creative Commons Attribution 4.0 International License.