Skip to main content
QUICK REVIEW

[Paper Review] Comparative Study of Machine Learning Models and BERT on SQuAD

Devshree Patel, Param Raval|arXiv (Cornell University)|May 22, 2020
Topic ModelingComputer Science14 references8 citations
TL;DR

This study compares traditional machine learning models—logistic regression, Gaussian Mixture Models, SVM, Random Forest, and XGBoost—against BERT on the SQuAD 1.1 question answering benchmark. Using InferSent for sentence embeddings, the authors find that while simpler models are faster, BERT achieves significantly higher accuracy (77% test F1) at the cost of increased training time, demonstrating the trade-off between performance and efficiency in NLP models.

ABSTRACT

This study aims to provide a comparative analysis of performance of certain models popular in machine learning and the BERT model on the Stanford Question Answering Dataset (SQuAD). The analysis shows that the BERT model, which was once state-of-the-art on SQuAD, gives higher accuracy in comparison to other models. However, BERT requires a greater execution time even when only 100 samples are used. This shows that with increasing accuracy more amount of time is invested in training the data. Whereas in case of preliminary machine learning models, execution time for full data is lower but accuracy is compromised.

Motivation & Objective

  • To evaluate the performance of traditional machine learning models on the SQuAD 1.1 question answering dataset.
  • To compare the accuracy and inference time of these models against BERT, a state-of-the-art transformer-based model.
  • To analyze the impact of sentence representation techniques, such as InferSent embeddings, on model performance.
  • To investigate the trade-off between model complexity, training time, and predictive accuracy in question answering systems.

Proposed method

  • Preprocessing SQuAD 1.1 data using InferSent to generate contextual sentence embeddings based on semantic representations.
  • Applying principal component analysis (PCA) to reduce dimensionality and reconstruct data, measuring reconstruction loss to assess component effectiveness.
  • Training and evaluating multiple supervised models: logistic regression, Gaussian Mixture Models, SVM, Random Forest, and XGBoost with hyperparameter tuning.
  • Fine-tuning BERT BASE (110M parameters) on SQuAD 1.1 using a cloud TPU for end-to-end question answering.
  • Using cosine similarity and Euclidean distance in vector space to identify relevant sentence-question pairs during inference.
  • Evaluating models using F1 score, training/test accuracy, and loss curves, with model selection based on optimal hyperparameters like gamma in SVM.

Experimental results

Research questions

  • RQ1How do traditional machine learning models perform on the SQuAD 1.1 benchmark compared to BERT?
  • RQ2What is the trade-off between inference speed and accuracy when using simpler models versus BERT?
  • RQ3To what extent do sentence embeddings from InferSent improve performance across different machine learning models?
  • RQ4How does hyperparameter tuning affect overfitting and generalization in models like Random Forest and XGBoost on this dataset?
  • RQ5Why does BERT outperform other models despite higher computational cost?

Key findings

  • BERT achieved a test accuracy of 77% on SQuAD 1.1, significantly outperforming all traditional machine learning models.
  • The best-performing traditional model, Random Forest, achieved 63.7% test accuracy with min_samples_leaf=8 and n_estimators=60, but performance dropped with lower leaf sizes, indicating overfitting.
  • SVM with an RBF kernel achieved 66% test accuracy, the highest among non-tree-based models, but still underperformed BERT.
  • Logistic regression with PCA improved slightly from the baseline, achieving 52.5% F1 score, but remained far below BERT’s performance.
  • Despite lower accuracy, simpler models like logistic regression and SVM had significantly faster execution times, especially on smaller data subsets.
  • The study confirms that BERT’s bidirectional attention and deep transformer architecture enable superior contextual understanding, justifying its higher computational cost.

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.