Source-linked AI summary
Financial sentiment analysis using FinBERT with application in predicting stock movement
Tingsong Jiang, Qingyun Zeng
TL;DR
The paper addresses the challenge of quantifying financial-news sentiment for predicting market movements. It combines FinBERT sentiment analysis with LSTM forecasting and reports that the combined approach outperforms ARIMA and LSTM without sentiment analysis. The authors also identify limited postprocessed data and overfitting risk as constraints.
Problem
Quantitatively predicting financial-market movements from information such as news remains challenging, while ARIMA does not capture financial-data nonlinearity well.
Source: §1 · p. 1Method
Results
Takeaways & Limitations
The authors conclude that news sentiment and market behavior can be harnessed to produce more accurate and reliable stock-market predictions.
Source: §9 · p. 7After processing, MSFT had 1,440 rows, which the authors say increases overfitting risk because the model may learn training-period noise rather than generalizable patterns.
Source: §8.1 · p. 7
Abstract
from arXiv · showhide
In this study, we integrate sentiment analysis within a financial framework by leveraging FinBERT, a fine-tuned BERT model specialized for financial text, to construct an advanced deep learning model based on Long Short-Term Memory (LSTM) networks. Our objective is to forecast financial market trends with greater accuracy. To evaluate our model's predictive capabilities, we apply it to a comprehensive dataset of stock market news and perform a comparative analysis against standard BERT, standalone LSTM, and the traditional ARIMA models. Our findings indicate that incorporating sentiment analysis significantly enhances the model's ability to anticipate market fluctuations. Furthermore, we propose a suite of optimization techniques aimed at refining the model's performance, paving the way for more robust and reliable market prediction tools in the field of AI-driven finance.
1. Introduction
The paper proposes combining financial-news sentiment with an LSTM to predict market movements, treating sentiment and market behavior as correlated rather than causal. It reports that FinBERT combined with LSTM performs best among the compared approaches.
1. Introduction
- FinBERT is a contextual pretrained language model trained specifically on large-scale financial communications for financial sentiment analysis.Source: §1 · p. 1
- Prior FinBERT applications cited include financial text mining, financial communications, and information extraction in finance.Source: §1 · p. 1
- The proposed approach uses transformer-based contextual language models to analyze financial sentiment and LSTM to predict market movement from that sentiment.Source: §1 · p. 1
- FinBERT combined with LSTM achieved the best reported performance, while LSTM generally outperformed ARIMA and FinBERT sentiment analysis outperformed standalone LSTM.Source: §1 · p. 1
2. Related Work
Related work includes models that use transformers or hybrid deep-learning architectures to predict stock movement, as well as sentiment-based stock-return prediction. The paper distinguishes its approach by using FinBERT sentiment with LSTM sequencing.
2. Related Work
- Zhang et al. (2022) proposed TEANet for stock-price movement prediction and trading simulation, using a transformer for time-series modeling rather than sentiment analysis.Source: §2 · pp. 1–2
- Hiew et al. (2019) combined BERT-based sentiment with option-implied and market-implied sentiment for LSTM stock-return prediction, and reported LSTM outperforming VAR.Source: §2 · p. 2
- Shi et al. (2022) combined ARIMA preprocessing, attention-based CNN, LSTM, and XGBoost; their attention-based CNN with Bi-LSTM performed best among the compared baselines and single models.Source: §2 · p. 2
3. Data
The study combines pretrained language models, financial news archives, and historical stock-market data. Its primary news archive is supplemented with analyst ratings data before modeling.
3. Data
- The researchers use base BERT uncased and FinBERT from the Hugging Face Model Hub, selecting FinBERT for its specialization in financial text.Source: §3 · p. 2
- Historical stock data, including open price, close price, and percentage change, is retrieved for news-associated tickers and used alongside sentiment scores as LSTM input.Source: §3 · p. 2
- The primary historical news archive covers over 800 US companies across 12 years up to 2019, and the combined analysis dataset contains 1,056,471 news records.Source: §3 · p. 2
- The study supplements the historical news archive with analyst ratings from a second dataset covering news for more than 6,000 stocks.Source: §3 · p. 2
4. Data Preprocessing and Feature Engineering
Preprocessing combines and cleans financial-news and market data, derives daily sentiment measures, and aligns inputs with trading days. The pipeline also scales features and uses a chronological train-test split.
4. Data Preprocessing and Feature Engineering
- The two news datasets are combined, duplicate titles removed, and the resulting text data merged with numerical stock-market data.Source: §4 · pp. 2–3
- Figure 1 presents a plot of MSFT closing price.Source: Figure 1 · p. 3
- FinBERT produces positive, negative, and neutral probabilities for news titles, which are averaged by ticker and day into an aggregated sentiment score.Source: §4 · p. 3
- The Numerical Sentiment Index labels daily returns as 1, 0, or -1 using a threshold of s = 0.01, for market-based sentiment labeling and correlation analysis.Source: §4 · p. 3
- News sentiment for non-trading days is aligned with the next available trading day, and incomplete records are dropped.Source: §4 · p. 3
- Min-Max scaling maps numerical features to [0, 1], using separate training-fitted scalers for input features and the closing-price target.Source: §4 · p. 3
- A chronological split assigns the first 90% of data to training and the subsequent 10% to testing to avoid future-data leakage.Source: §4 · p. 3
5. Sentiment Analysis Methodology
The methodology uses financial-domain FinBERT to score news titles, aggregates sentiment by stock and day, and pairs the resulting scores with stock-market data for analysis.
5. Sentiment Analysis Methodology
- FinBERT is fine-tuned on financial text, including Reuters TRC2 and Financial PhraseBank, for financial sentiment analysis.The study uses the pretrained model without further fine-tuning.Source: §5 · pp. 3–4
- News titles are tokenized and padded or truncated to a maximum of 512 tokens before sentiment extraction.Source: §5 · p. 4
- FinBERT produces positive, negative, and neutral logits, which are converted with softmax into sentiment probabilities.Source: §5 · p. 4
- For each stock ticker and day, the method averages article-level positive-minus-negative probabilities into an aggregated sentiment score.The average uses the number of news articles for that ticker on that day.Source: §5 · p. 4
- The Numerical Sentiment Index supplies market-based sentiment labels for possible FinBERT fine-tuning or analysis of textual and market sentiment correlations.Source: §5 · p. 4
6. The Model
The proposed forecasting architecture combines financial-news sentiment from FinBERT with historical market features in an LSTM module. The section also describes its training setup, comparison models, and reported evaluation materials.
6. The Model
- The proposed architecture combines a financial sentiment module with a time-series forecasting module to predict stock-price movements from news and market data.Source: §6 · p. 4
- FinBERT converts each news item into positive, negative, and neutral probabilities, then into a score defined as positive probability minus negative probability.The pretrained model was not further fine-tuned in this study; daily per-ticker scores feed the LSTM.Source: §6 · p. 4
- Each daily LSTM input combines aggregated sentiment with lagged closing, opening, high, low, and volume values over a 60-day look-back window.Numerical features are Min-Max scaled to [0, 1].Source: §6 · p. 4
- The forecasting network stacks two 100-unit LSTM layers, followed by a 25-unit ReLU dense layer and a single-unit linear output.The output target is typically the next day's closing price or price change.Source: §6 · p. 5
- Training minimizes MSE with Adam at a 0.001 initial learning rate, using up to 100 epochs, batch size 1, and early stopping after 20 validation-loss checks without improvement.The validation set is the chronologically last 10% of the training portion.Source: §6 · p. 5
- The comparisons include ARIMA, a numerical-data-only LSTM, FinBERT with a DNN, and standard BERT with an otherwise identical LSTM architecture.Source: §6 · p. 5
- Figure 2 plots rolling mean and standard deviation for MSFT.Source: Figure 2 · p. 5
- MSE is the main training and validation metric; ARIMA tuning also uses MAE and RMSE, and Table 1 is identified as reporting training and testing losses across models.The supplied passage does not provide the table's loss values.Source: §6 · p. 5, Table 1 · p. 6
7. Experiments
The experiments predict closing prices using date-based train-test partitioning and normalized training variables. They also use the Numerical Sentiment Index to examine market-based sentiment alongside news sentiment.
7. Experiments
- The Numerical Sentiment Index is used to quantify market-based sentiment and is described as useful for fine-tuning FinBERT and studying its correlation with price-based sentiment.Source: §7 · p. 6
- The close-price task uses Min-Max scaling and a chronological split, with the first 90% of days for training and the remaining 10% for testing.The authors cite unpredictable influences such as COVID-19 and war as a reason long-run financial-market behavior is difficult to predict.Source: §7 · p. 6
- The authors report that an earlier 80-20 split was less satisfying and did not substantially outperform the baseline LSTM.Source: §7 · p. 6
8. Analysis
FinBERT sentiment combined with LSTM achieved the best training and validation loss, while ARIMA captured long-run trends and the proposed model fit short-run movements. The analysis also identifies limited per-stock data, title-only sentiment, and task-specific FinBERT fit as constraints.
8. Analysis
- FinBERT sentiment with LSTM achieved the best training and validation loss, with Base BERT + LSTM following closely.The authors note that raw sentiment scores from off-the-shelf FinBERT may not fully exploit the model for this prediction task.Source: §8 · p. 6
- ARIMA achieved MSE: 0.00975, MAE: 0.07154, and RMSE: 0.09876, capturing long-run trends while the proposed model fit short-run movements.Figure 3 plots predicted and real close prices.Source: §8 · p. 6, Figure 3 · p. 6
8.1. Error Analysis and Limitations
- The MSFT data fell to 1440 rows after processing, and the authors identify small per-stock samples as an overfitting risk.They report that loss dropped significantly within a few epochs and warn that models may learn market noise rather than effective information.Source: §8.1 · pp. 6–7, §8 · p. 6
- Using news titles alone limits the textual information available for sentiment extraction.The authors suggest using full article text or social-media sentiment as richer sources.Source: §8.1 · p. 7
- The improvement over Base BERT suggests off-the-shelf FinBERT may not be fully optimized for this dataset or prediction task.Proposed directions include task-specific fine-tuning or training on a larger, more contemporary financial-news corpus.Source: §8.1 · p. 7
- The authors propose augmenting training data, incorporating related stocks, using fuller or additional sentiment sources, and further fine-tuning FinBERT.These directions target the identified data-size, sentiment-input, and model-fit limitations.Source: §8.1 · p. 7
9. Conclusion
The FinBERT–LSTM model outperforms ARIMA and LSTM without sentiment analysis. The conclusion identifies data size, long-term trend prediction, FinBERT fine-tuning, and time-series architecture as areas for further work.
9. Conclusion
- The FinBERT–LSTM fusion outperforms ARIMA and LSTM models without sentiment analysis in predicting stock-market movements.The authors describe the model as capturing market fluctuations more effectively than these baselines.Source: §9 · p. 7
- The model tends to underpredict long-term trends; future work could combine ARIMA preprocessing or predictions with the LSTM.The proposed hybrid would feed residuals or ARIMA predictions as features into the LSTM.Source: §9 · p. 7
- Small per-stock datasets raise overfitting concerns, motivating broader news coverage, full articles, or social-media sentiment.These sources are proposed to enrich training data and provide more comprehensive sentiment signals.Source: §9 · p. 7
- FinBERT’s improvement over base BERT was modest, motivating further fine-tuning on contemporary financial news or Numerical Sentiment Index labels.The authors also emphasize aligning fine-tuning labels with the downstream prediction objective.Source: §9 · p. 7
- The authors propose investigating time-series transformer architectures such as TEANet as alternatives to, or additions to, LSTM.They suggest these architectures may capture more complex temporal patterns.Source: §9 · p. 7
- The conclusion presents news sentiment and market behavior as an interplay that can be harnessed for more accurate and reliable predictions.The authors anticipate further performance improvements and deeper understanding as the model is refined.Source: §9 · p. 7