Semi-Supervised Learning for Text Classification by Layer Partitioning

Alexander Hanbo Li, Abhinav Sethy

TL;DR

This paper introduces "LayerParti," a novel semi-supervised learning (SSL) framework for text classification that adapts computer vision SSL techniques to the discrete nature of text. By partitioning a neural network into a frozen feature extractor (F) and a trainable classifier (U), LayerParti enables the use of standard SSL methods on text, achieving competitive results, especially on shorter texts.

What Problem Does This Paper Address?

Semi-supervised learning (SSL) is a powerful technique for leveraging large amounts of unlabeled data when labeled data is scarce. Many successful SSL methods rely on introducing small perturbations (like noise) to the input data and enforcing consistency in the model's predictions. This works well for images, which exist in a continuous space. However, text data is inherently discrete (sequences of words or tokens). Directly applying noise to word embeddings or discrete text representations can lead to nonsensical inputs that don't reflect real-world language, making standard SSL approaches less effective. The challenge is to adapt these powerful SSL techniques to the discrete domain of text without losing their effectiveness.

Methods

The core innovation of this paper is the "Layer Partitioning" (LayerParti) approach. The authors propose to decompose a pre-trained neural network (specifically, a Transformer encoder) into two parts:

  • F (Frozen Layers): These are the lower layers of the network, typically responsible for extracting general, domain-agnostic features. In this work, F includes the word embedding layer and the first encoder layer. These layers are frozen during most of the training.
  • U (Unfrozen Layers): These are the higher layers of the network, which are adapted to the specific downstream task. Only these layers are trained.

This partitioning serves two key purposes:

  1. Feature Extraction: The frozen layers (F) act as a robust feature extractor, mapping the discrete text input into a higher-level representation.
  2. Perturbation: By passing the input through F, the output naturally incorporates a form of "systematic noise" via dropout within F. This is a more linguistically meaningful perturbation than adding random noise to embeddings, as F is trained on a general domain and is more likely to produce coherent representations even with dropout.

LayerParti then allows standard SSL algorithms like the Π-model and Temporal Ensembling to be applied to the outputs of F, training the U component. Additionally, the paper proposes a "gradually unfreezing" schedule, where layers in F are progressively unfrozen towards the end of training to prevent catastrophic forgetting and allow for finer task-specific adaptation.

Datasets

The paper evaluates its method on the following public datasets:

  • IMDB: A dataset of movie reviews labeled as positive or negative. The authors use both "long texts" (full reviews) and shorter versions.
  • TREC-6: A dataset of open-domain, fact-based questions categorized into six semantic classes.

The authors also mention applying their method to a "spoken personal memory retrieval task," which involves processing spoken queries and retrieving memories.

Key Insights and Ideas

  • Bridging the Discrete-Continuous Gap: The most significant insight is that by freezing lower layers of a pre-trained network, we can create a meaningful "continuous-like" representation space for discrete text inputs. This allows established computer vision SSL techniques to be effectively applied to NLP.
  • Meaningful Perturbations: Using dropout within a frozen, pre-trained feature extractor (F) provides a more linguistically sound way to introduce variability compared to arbitrary noise injection. The pre-trained nature of F ensures that its outputs, even with dropout, are more likely to retain semantic coherence.
  • Layer Partitioning as a General Framework: LayerParti is presented as a flexible framework that can be combined with various SSL algorithms (Π-model, Temporal Ensembling, Mean Teacher, etc.), making it a versatile tool for semi-supervised text classification.
  • Short Text Advantage: The results suggest that LayerParti is particularly effective for shorter texts, where fine-tuning the entire language model might be less beneficial or even detrimental.

Key Results

  • Competitive Performance: LayerParti, when combined with I-Model or Temporal Ensembling, achieves results comparable to state-of-the-art (SOTA) methods on the IMDB dataset.
  • Superiority on TREC-6: For the TREC-6 dataset, LayerParti demonstrates better performance than SOTA semi-supervised methods, achieving 97.2% accuracy with the I-Model.
  • Efficiency with Limited Labels: On the personal memory retrieval task, LayerParti achieved better F1 scores using only 6% of the labeled data compared to a supervised baseline, highlighting its efficiency in low-resource scenarios.
  • Short Text Gains: The paper notes that on shorter texts like TREC-6, their method provides better accuracy than even semi-supervised ULMFiT results when using fewer labels.

Limitations and Future Work

  • LM Fine-tuning for Long Texts: The authors acknowledge that for longer texts like IMDB reviews, fine-tuning the language model on all available data (as done in ULMFiT) can still yield better results than their approach when only considering the semi-supervised aspect. This suggests that for very long texts, a hybrid approach might be beneficial.
  • Generalizability of Partitioning: While they found freezing the word embedding and the first encoder layer to be optimal, the paper doesn't extensively explore other partitioning strategies. Future work could investigate optimal splitting points for different model architectures and tasks.
  • Broader SSL Algorithm Integration: The paper demonstrates integration with two SSL methods. Exploring compatibility with a wider range of SSL algorithms could further enhance its applicability.

Summary updated

BibTeX
@inproceedings{li2020semi,
  author = {Alexander Hanbo Li and Abhinav Sethy},
  title = {{Semi-Supervised Learning for Text Classification by Layer Partitioning}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2020},
  url = {https://openreview.net/forum?id=c2KYUskywJ},
}
Figure