Cluster & Tune: Boost Cold Start Performance in Text Classification

Eyal Shnarch, Ariel Gera, Alon Halfon, Lena Dankin, Leshem Choshen, Ranit Aharonov, Noam Slonim

Abstract

In real-world scenarios, a text classification task often begins with a cold start, when labeled data is scarce. In such cases, the common practice of fine-tuning pre-trained models, such as BERT, for a target classification task, is prone to produce poor performance. We suggest a method to boost the performance of such models by adding an intermediate unsupervised classification task, between the pre-training and fine-tuning phases. As such an intermediate task, we perform clustering and train the pre-trained model on predicting the cluster labels. We test this hypothesis on various data sets, and show that this additional classification phase can significantly improve performance, mainly for topical classification tasks, when the number of labeled instances available for fine-tuning is only a couple of dozen to a few hundred.

The Cold Start Challenge

Fine-tuning large language models like BERT has become the standard for text classification. However, these models are notoriously data-hungry. In many real-world "cold start" scenarios, practitioners may only have a few dozen labeled examples per class. In these low-resource settings, standard fine-tuning often performs poorly because the transition from general language modeling (predicting masked words) to specific classification is too abrupt.

While researchers often employ "intermediate training"—such as further pre-training on domain-specific text using Masked Language Modeling (MLM)—these methods do not always align perfectly with the ultimate goal of classification. The "Cluster & Tune" approach aims to bridge this gap using an intermediate task that mimics classification without requiring human-labeled data.

Methodology: The Cluster & Tune Approach

The authors propose an intermediate step between general pre-training and task-specific fine-tuning. The core innovation is Path 3: $BERT_{IT:CLUST}$, which follows a three-stage process:

  1. Unsupervised Clustering: Unlabeled training data is partitioned into $n_c$ clusters (50 clusters proved to be a robust default). The authors utilized the sequential Information Bottleneck (sIB) technique based on Bag-of-Words (BOW) representations.
  2. Intermediate Training (Inter-training): These cluster assignments serve as "pseudo-labels." The pre-trained BERT model is trained to predict the cluster membership of a sentence for a single epoch. This forces the model to learn the structural and topical nuances of the specific domain.
  3. Fine-tuning: The cluster-prediction layer is discarded, and the model is fine-tuned on the small set of human-labeled data.
The four training paths compared: (1) Standard BERT, (2) Inter-training with MLM, (3) Inter-training with Clustering, and (4) a hybrid MLM+Clustering approach.

The study also explored a hybrid approach (Path 4: $BERT_{IT:MLM+CLUST}$) combining traditional domain-adaptive pre-training with the clustering task.

Experimental Setup

The method was evaluated across nine diverse datasets, categorized by their underlying classification nature:

  • Topical (6 datasets): Yahoo! Answers, DBpedia, CFPB (consumer complaints), 20 Newsgroups, AG’s News, and ISEAR (emotional reports). These tasks require distinguishing text based on subject matter.
  • Non-topical (3 datasets): SMS Spam, Subjectivity, and Polarity (sentiment). These rely more on stylistic cues or specific keywords rather than broad topics.

To simulate "cold start" conditions, training budgets were varied from 64 to 1024 labeled examples.

Key Results and Insights

The experiments revealed that the "Cluster & Tune" method provides significant advantages in specific contexts:

  • Performance Gains in Low-Data Regimes: On topical datasets with only 64 labeled samples, $BERT_{IT:CLUST}$ achieved an average 110% accuracy gain and a 33% error reduction compared to standard BERT.
  • The Importance of Topicality: The method is highly effective for topical datasets but provides minimal gains for sentiment or style-based tasks. This is likely because unsupervised clustering via BOW naturally groups documents by topic.
  • Clustering as Feature Discovery: The model does not require the clusters to perfectly match the final labels. By distinguishing between 50 different clusters, the model learns salient domain features. Visualizations of the model's internal representations show that after the clustering phase, the target classes already begin to separate, even before the model has encountered a single human-provided label.
  • Efficiency: Unlike further MLM pre-training, which requires multiple epochs, just one epoch of cluster-training was sufficient. Extended training led to overfitting on the "pseudo-labels," degrading final performance.
Accuracy comparison across nine datasets. $BERT_{IT:CLUST}$ and $BERT_{IT:MLM+CLUST}$ consistently outperform standard BERT in topical tasks, especially with fewer training samples.

Discussion and Limitations

While "Cluster & Tune" offers a powerful tool for cold-start topical classification, it has limitations. Its reliance on BOW clustering makes it less suitable for non-topical tasks like sentiment analysis. Future work might explore different embedding spaces for clustering to address this. Additionally, while the method saves on labeled data, it still requires several thousand unlabeled examples to generate meaningful clusters. Finally, combining MLM and Clustering ($BERT_{IT:MLM+CLUST}$) yielded the best overall results, suggesting that learning vocabulary and document structure provide complementary benefits.

Summary updated

BibTeX
@inproceedings{shnarch2022cluster,
  author = {Eyal Shnarch and Ariel Gera and Alon Halfon and Lena Dankin and Leshem Choshen and Ranit Aharonov and Noam Slonim},
  title = {{Cluster \& Tune: Boost Cold Start Performance in Text Classification}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-long.526},
}
Figure