Skip to main content
QUICK REVIEW

[Paper Review] Sensitivity Analysis on Transferred Neural Architectures of BERT and GPT-2 for Financial Sentiment Analysis

Tracy Qian, Andy Xie|arXiv (Cornell University)|Jul 7, 2022
Stock Market Forecasting MethodsDecision Sciences5 citations
TL;DR

This study investigates the fine-tuning performance and parameter sensitivity of BERT and GPT-2 in financial sentiment analysis. By analyzing frozen layers, batch size, and learning rate, it finds BERT's parameters are highly sensitive to stochasticity during fine-tuning, while GPT-2 demonstrates greater stability, with earlier layers in both models preserving critical word pattern information.

ABSTRACT

The explosion in novel NLP word embedding and deep learning techniques has induced significant endeavors into potential applications. One of these directions is in the financial sector. Although there is a lot of work done in state-of-the-art models like GPT and BERT, there are relatively few works on how well these methods perform through fine-tuning after being pre-trained, as well as info on how sensitive their parameters are. We investigate the performance and sensitivity of transferred neural architectures from pre-trained GPT-2 and BERT models. We test the fine-tuning performance based on freezing transformer layers, batch size, and learning rate. We find the parameters of BERT are hypersensitive to stochasticity in fine-tuning and that GPT-2 is more stable in such practice. It is also clear that the earlier layers of GPT-2 and BERT contain essential word pattern information that should be maintained.

Motivation & Objective

  • To evaluate the performance and robustness of fine-tuned BERT and GPT-2 in financial sentiment analysis.
  • To assess the sensitivity of model parameters to hyperparameters such as learning rate, batch size, and layer freezing.
  • To identify which layers in BERT and GPT-2 are most critical for preserving word pattern information during fine-tuning.
  • To compare the stability of BERT and GPT-2 under stochastic fine-tuning conditions.

Proposed method

  • Fine-tuning pre-trained BERT and GPT-2 models on financial sentiment datasets using controlled hyperparameter settings.
  • Systematically varying learning rate, batch size, and the number of frozen transformer layers to evaluate performance and stability.
  • Measuring model performance through standard classification metrics such as accuracy and F1-score across multiple random seeds.
  • Analyzing parameter sensitivity by observing variance in performance across multiple fine-tuning runs with identical hyperparameters.
  • Examining feature importance by analyzing the contribution of early versus later transformer layers in both models.
  • Using statistical analysis to compare the variance in performance between BERT and GPT-2 under identical fine-tuning protocols.

Experimental results

Research questions

  • RQ1How does the learning rate affect the performance and stability of fine-tuned BERT and GPT-2 in financial sentiment analysis?
  • RQ2What is the impact of batch size on the consistency of fine-tuning outcomes for BERT and GPT-2?
  • RQ3How does freezing different numbers of transformer layers influence model performance and sensitivity?
  • RQ4To what extent are BERT and GPT-2 parameters sensitive to stochasticity during fine-tuning?
  • RQ5Which layers in BERT and GPT-2 contain the most essential word pattern information for financial sentiment classification?

Key findings

  • BERT exhibits high sensitivity to stochasticity in fine-tuning, with significant performance variance across multiple runs using the same hyperparameters.
  • GPT-2 demonstrates greater stability during fine-tuning, showing lower variance in performance across repeated trials.
  • The earlier layers of both BERT and GPT-2 contain essential word pattern information critical for sentiment classification.
  • Freezing earlier layers leads to a more substantial drop in performance than freezing later layers, indicating their foundational role.
  • Optimal performance is achieved when only the final layers are fine-tuned, particularly for BERT, due to its sensitivity to parameter changes.
  • Batch size and learning rate have a measurable but less pronounced effect on performance variance compared to model architecture and initialization stochasticity.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.