Predicting Stock Price Movement with LLM-Enhanced Tweet Emotion Analysis

An Vuong, Susan Gauch

Abstract

Short-term stock market prediction remains a significant challenge due to the inherent noise in social media sentiment. This paper presents a novel deep learning framework that enhances predictive accuracy by integrating historical market data with refined emotion features extracted from Twitter. By leveraging Meta’s Llama 3.1-8B-Instruct as a semantic filter to isolate emotionally relevant content, the proposed pipeline significantly improves the signal-to-noise ratio. Experimental results on major tech stocks (TSLA, AAPL, AMZN) demonstrate that this LLM-enhanced approach nearly triples the accuracy of predicting significant price movements compared to traditional price-only baselines.

Introduction

The financial markets are highly sensitive to public sentiment, yet capturing this sentiment in a way that yields actionable predictive power is notoriously difficult. While traditional sentiment analysis—categorizing text as positive, negative, or neutral—is a common starting point, it often fails to capture the nuanced emotional drivers of trading behavior, such as fear, anticipation, or disgust.

Social media platforms like Twitter provide a real-time stream of public consciousness, but they are also characterized by extreme noise. A large portion of financial tweets are spam, bot-generated, or lack emotional substance. This paper addresses the challenge of extracting high-quality emotional signals from this chaotic data stream to predict whether a stock will remain stable or experience a significant price shift.

Methodology

The researchers developed a three-stage pipeline designed to distill raw social media chatter into a robust predictive signal.

1. LLM-Based Semantic Filtering

The core novelty of this research lies in the preprocessing stage. Rather than treating all tweets equally, the authors utilized Meta’s Llama 3.1-8B-Instruct model as an advanced "data janitor." The LLM was prompted to identify specific emotions relevant to market psychology. If the model determined a tweet contained "no emotion," the data point was discarded entirely. This step effectively removed 50-60% of the raw dataset, ensuring that only tweets with high "signal density" proceeded to the next stage.

2. Emotion Extraction

The filtered, emotionally dense tweets were then processed through specialized classifiers to generate daily "emotion vectors." Three distinct methods were compared:

  • DistilRoBERTa: A transformer-based model fine-tuned to output probabilities across seven discrete emotion categories.
  • NRC-Intensity & NRC-Binary: Lexicon-based approaches that score text against predefined dictionaries of 8 to 10 emotion and polarity categories.

3. Time-Series Forecasting

The final stage utilized a Long Short-Term Memory (LSTM) neural network. The LSTM was trained on a multi-modal feature set including historical market data (Open, Close, High, Low, Volume), daily average emotion scores, and daily tweet volume. The model’s objective was to classify the next day’s price movement into three categories: Stable, Significant Increase, or Significant Decrease, with "significant" defined by standard deviation thresholds.

Experimental Results

The framework was evaluated using a year-long dataset (September 2021 – September 2022) covering Tesla (TSLA), Apple (AAPL), and Amazon (AMZN). The results highlight the dramatic impact of LLM-enhanced filtering:

  • Baseline (Historical Data Only): Achieved a 13.5% average accuracy for predicting significant price movements.
  • Standard Emotion Analysis (No LLM Filter): Adding DistilRoBERTa features improved accuracy to 23.6%.
  • LLM-Enhanced Emotion Analysis: The full pipeline, including the Llama 3.1 filtering step, reached an accuracy of 38.5%—nearly triple the baseline.

The transformer-based DistilRoBERTa model consistently outperformed the lexicon-based NRC methods, achieving a superior balance between detecting volatility and maintaining overall classification stability (approximately 57.6% overall accuracy).

Discussion: Signal vs. Volume

The findings suggest that in the realm of social media analysis, data quality is far more critical than data quantity. By discarding over half of the dataset, the LLM-enhanced filter actually improved the model's performance. This underscores the value of LLMs not just as generators or classifiers, but as sophisticated filters that can identify the "emotional payload" necessary for financial forecasting.

Furthermore, the inclusion of emotion features created a "volatility trade-off." While the model became slightly less accurate at predicting "Stable" days, it became significantly more accurate at identifying the price swings that are most valuable to active traders looking to capture alpha.

Conclusion

This research demonstrates that integrating LLM-based semantic filtering with specialized emotion classifiers can provide a powerful edge in stock market prediction. By moving beyond simple sentiment to a multidimensional emotional analysis, the framework successfully captures the human reactions that precede market volatility. Future iterations of this work could benefit from incorporating technical indicators and formal financial news to create a more comprehensive view of market dynamics.

Summary updated

BibTeX
@inproceedings{vuong2025predicting,
  author = {An Vuong and Susan Gauch},
  title = {{Predicting Stock Price Movement with LLM-Enhanced Tweet Emotion Analysis}},
  booktitle = {IC3K (KDIR)},
  year = {2025},
  doi = {10.5220/0013675900004000},
}
Figure