Introduction
The field of Natural Language Processing (NLP) has seen a massive shift toward Deep Learning, primarily driven by Pre-trained Language Models (PLMs) like BERT. While these models have set new benchmarks, their dominance has led many researchers to overlook traditional linear classifiers. This paper argues that the "deep-learning-first" mentality results in significant efficiency waste and a "Direct Run" trap, where complex models are deployed without a proper baseline to verify their relative performance. Simple TF-IDF features paired with linear Support Vector Machines (SVMs) often serve as a crucial sanity check, ensuring that the added complexity of PLMs is truly justified.
Methods
The study evaluates two primary families of text classification methods:
1. Linear Baselines
The authors utilize simple uni-gram TF-IDF (Term Frequency-Inverse Document Frequency) features. Three variations of linear classifiers are tested:
- One-vs-rest: A standard approach training a binary classifier for each label.
- Thresholding: An extension that adjusts decision values to optimize for Macro-F1 scores.
- Cost-sensitive: A method that re-weights losses to address class imbalance, a common challenge in multi-label datasets.
2. BERT-based Methods
The evaluation includes standard BERT fine-tuning and more advanced configurations like Hierarchical BERT. The latter is designed to handle long documents by splitting them into segments, effectively bypassing BERT’s native 512-token limit.
Datasets
The primary evaluation framework is the LexGLUE benchmark, which consists of various legal document classification tasks:
- Multi-class: SCOTUS and LEDGAR.
- Multi-label: ECtHR (Tasks A & B), EUR-LEX, and UNFAIR-ToS.
- Document Length Case Study: The classic 20 Newsgroups dataset.
Key Insights
The empirical analysis reveals several critical findings regarding the utility of linear models:
- Competitive Performance: Linear SVMs frequently match or exceed the performance of standard BERT implementations, particularly on legal datasets. On the SCOTUS dataset, the linear SVM achieved a Micro-F1 of 78.2, significantly outperforming the standard BERT's 68.3.
- The Document Length Advantage: BERT's 512-token limit is a significant bottleneck for long legal documents. Linear models, which process the entire document via TF-IDF, often outperform "standard" BERT runs unless complex hierarchical architectures are employed.
- Diagnostic Utility: A linear baseline acts as a debugger. If a sophisticated PLM fails to outperform a simple SVM, it indicates a likely issue with the PLM's configuration or the dataset's suitability for that specific architecture.
Key Results
The performance and efficiency gap between linear models and PLMs is stark. As shown in the comparison of various models across the LexGLUE benchmark, linear methods remain highly competitive with state-of-the-art transformer models.
Beyond accuracy, the computational efficiency of linear models is orders of magnitude superior. Training a linear model on the EUR-LEX dataset requires approximately 4 minutes on a standard CPU, whereas training BERT on the same data takes over 38 hours on an Nvidia V100 GPU.
Furthermore, model size differences are substantial: linear models range from 50KB to 15MB, while BERT variants typically occupy 110MB to 149MB.
Limitations and Future Work
This work serves as an opinion piece to encourage better experimental practices. The findings are currently limited to text classification and may not extend to generative tasks or complex reasoning. Future research could explore more sophisticated feature engineering for linear models (e.g., n-grams) and develop methods to predict whether a specific dataset necessitates the use of a PLM before committing to expensive training cycles.
Summary updated