[Paper Review] Linking microblogging sentiments to stock price movement: An application of GPT-4
This study applies GPT-4 to analyze microblogging sentiment from Stocktwits for Apple and Tesla in 2017, using advanced prompt engineering to extract contextually nuanced sentiment. GPT-4 outperformed BERT in predicting same-day stock price movements, achieving a peak accuracy of 71.47% in May, demonstrating superior contextual understanding for financial sentiment analysis.
This paper investigates the potential improvement of the GPT-4 Language Learning Model (LLM) in comparison to BERT for modeling same-day daily stock price movements of Apple and Tesla in 2017, based on sentiment analysis of microblogging messages. We recorded daily adjusted closing prices and translated them into up-down movements. Sentiment for each day was extracted from messages on the Stocktwits platform using both LLMs. We develop a novel method to engineer a comprehensive prompt for contextual sentiment analysis which unlocks the true capabilities of modern LLM. This enables us to carefully retrieve sentiments, perceived advantages or disadvantages, and the relevance towards the analyzed company. Logistic regression is used to evaluate whether the extracted message contents reflect stock price movements. As a result, GPT-4 exhibited substantial accuracy, outperforming BERT in five out of six months and substantially exceeding a naive buy-and-hold strategy, reaching a peak accuracy of 71.47 % in May. The study also highlights the importance of prompt engineering in obtaining desired outputs from GPT-4's contextual abilities. However, the costs of deploying GPT-4 and the need for fine-tuning prompts highlight some practical considerations for its use.
Motivation & Objective
- To evaluate whether GPT-4 improves sentiment analysis accuracy for predicting same-day stock price movements compared to BERT.
- To investigate the impact of advanced prompt engineering on extracting contextually relevant sentiment from microblogging content.
- To assess the predictive power of sentiment derived from platforms like Stocktwits on real-time stock returns for highly liquid stocks like Apple and Tesla.
- To compare GPT-4’s performance against a naive buy-and-hold strategy and establish statistical significance in sentiment-based predictions.
- To explore practical implications and limitations of deploying GPT-4 in financial sentiment analysis, including cost and fine-tuning requirements.
Proposed method
- A novel prompt engineering framework was developed to guide GPT-4 in extracting sentiment, perceived advantages or disadvantages, and relevance to specific companies from microblogging messages.
- Daily sentiment scores were extracted from Stocktwits messages using both GPT-4 and BERT, with sentiment mapped to positive, negative, or neutral classifications.
- Stock price movements were calculated as up/down based on daily adjusted closing prices, with same-day predictions evaluated using logistic regression.
- Performance was measured via accuracy and p-values, with the naive buy-and-hold strategy used as a benchmark for statistical significance.
- The study excluded months with insufficient training or test data (e.g., Jan–Mar, Oct–Dec) to ensure stable and representative model evaluation.
- Sentiment and price data were matched on a daily basis to assess immediate correlation between social media sentiment and intraday stock direction.
Experimental results
Research questions
- RQ1Does GPT-4 outperform BERT in predicting same-day stock price movements using microblogging sentiment?
- RQ2To what extent does advanced prompt engineering enhance the contextual accuracy of sentiment extraction from financial microblogs?
- RQ3Is the sentiment derived from GPT-4 statistically significant in predicting stock direction compared to a naive buy-and-hold strategy?
- RQ4How does the performance of GPT-4 vary across different months, and does it consistently outperform BERT?
- RQ5What are the practical trade-offs of deploying GPT-4 in financial sentiment analysis, particularly regarding cost and model fine-tuning?
Key findings
- GPT-4 achieved a peak accuracy of 71.47% in predicting same-day stock price movements for Apple and Tesla in May 2017, significantly outperforming BERT.
- GPT-4 outperformed BERT in five out of six months evaluated, with the highest statistical significance observed in May, where the p-value was 4.91×10⁻⁵.
- BERT’s best accuracy was 66.47% in May, still outperforming the naive buy-and-hold baseline, which ranged from 46.99% to 52.06% across the evaluation period.
- All p-values for GPT-4 predictions were below the 0.05 threshold, indicating consistent statistical significance in its predictive power.
- The study confirms that prompt engineering is critical to unlocking GPT-4’s contextual capabilities, as performance heavily depends on input prompt design.
- Despite its high accuracy, the deployment cost of GPT-4 and the need for careful prompt tuning present practical barriers for widespread adoption.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.