The high volatility and non-linear dynamics of the stock market make forecasting stock behavior increasingly challenging. This task is further influenced by a variety of contextual factors, including news content and social media data. However, several challenges remain unresolved, stemming from the influence of textual content, specifically from social networks, that are often characterized by dynamic interactions and non-standard language. In this paper, we design a two-step framework for the prediction of stock behavior by integrating contextual features inferred from social networks with historical financial data. We first build a chain of text composed of posts, and the related daily comments that are summarized and analyzed through Large Language Models to infer features in terms of sentiment scores and a buy/sell indicator. Successively, these social contextual features and historical financial data are fed as input to a forecasting module composed of different deep learning models (i.e., Long Short-Term Memory, Temporal Convolutional Networks, Transformers, and Generative Adversarial Networks). The proposed framework has been evaluated on a NASDAQ-listed stock dataset, encompassing more than 4 millions of social content and historical financial data over a period of six years of analysis. We show an improvement of up to 23.27% in Root Mean Square Error and 23.70% in Mean Average Error for forecasting stock behavior compared to various baselines. Finally, we compare these results with respect to those achieved using Large Language Models as predictors under zero-shot scenarios, achieving lower results (up to 68.1%) in addressing the forecasting task.

Empowered stock market forecasting using Large Language Model on social media content / Sperli', G., Sichinolfi, M.A.. - In: ENGINEERING APPLICATIONS OF ARTIFICIAL INTELLIGENCE. - ISSN 0952-1976. - 162:(2025). [10.1016/j.engappai.2025.112727]

Empowered stock market forecasting using Large Language Model on social media content

Sperli' G.;
2025

Abstract

The high volatility and non-linear dynamics of the stock market make forecasting stock behavior increasingly challenging. This task is further influenced by a variety of contextual factors, including news content and social media data. However, several challenges remain unresolved, stemming from the influence of textual content, specifically from social networks, that are often characterized by dynamic interactions and non-standard language. In this paper, we design a two-step framework for the prediction of stock behavior by integrating contextual features inferred from social networks with historical financial data. We first build a chain of text composed of posts, and the related daily comments that are summarized and analyzed through Large Language Models to infer features in terms of sentiment scores and a buy/sell indicator. Successively, these social contextual features and historical financial data are fed as input to a forecasting module composed of different deep learning models (i.e., Long Short-Term Memory, Temporal Convolutional Networks, Transformers, and Generative Adversarial Networks). The proposed framework has been evaluated on a NASDAQ-listed stock dataset, encompassing more than 4 millions of social content and historical financial data over a period of six years of analysis. We show an improvement of up to 23.27% in Root Mean Square Error and 23.70% in Mean Average Error for forecasting stock behavior compared to various baselines. Finally, we compare these results with respect to those achieved using Large Language Models as predictors under zero-shot scenarios, achieving lower results (up to 68.1%) in addressing the forecasting task.
2025
Empowered stock market forecasting using Large Language Model on social media content / Sperli', G., Sichinolfi, M.A.. - In: ENGINEERING APPLICATIONS OF ARTIFICIAL INTELLIGENCE. - ISSN 0952-1976. - 162:(2025). [10.1016/j.engappai.2025.112727]
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11588/1052179
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 1
  • ???jsp.display-item.citation.isi??? ND
social impact