Stock Price Prediction with LLM-Guided Market Movement Signals and Transformer Model

Authors

DOI:

https://doi.org/10.47852/bonviewFSI52025703

Keywords:

deep learning, financial news, LLM, stock price prediction, sentiment analysis, transformer

Abstract

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

2025-07-23

Issue

Section

Research Articles

How to Cite

Chen, Q. (2025). Stock Price Prediction with LLM-Guided Market Movement Signals and Transformer Model. FinTech and Sustainable Innovation, 1-7. https://doi.org/10.47852/bonviewFSI52025703