Skip to main content
QUICK REVIEW

[Paper Review] Masking as an Efficient Alternative to Finetuning for Pretrained Language Models

Mengjie Zhao, Tao Lin|arXiv (Cornell University)|Apr 26, 2020
Topic ModelingComputer Science13 citations
TL;DR

This paper proposes masking—learning selective binary masks for pretrained language model weights—as a parameter-efficient alternative to finetuning. By retaining pretrained weights and training only 1-bit masks per task, the method achieves performance on par with finetuning across 11 NLP tasks while drastically reducing memory usage, especially for multi-task deployment.

ABSTRACT

We present an efficient method of utilizing pretrained language models, where we learn selective binary masks for pretrained weights in lieu of modifying them through finetuning. Extensive evaluations of masking BERT and RoBERTa on a series of NLP tasks show that our masking scheme yields performance comparable to finetuning, yet has a much smaller memory footprint when several tasks need to be inferred simultaneously. Through intrinsic evaluations, we show that representations computed by masked language models encode information necessary for solving downstream tasks. Analyzing the loss landscape, we show that masking and finetuning produce models that reside in minima that can be connected by a line segment with nearly constant test accuracy. This confirms that masking can be utilized as an efficient alternative to finetuning.

Motivation & Objective

  • To address the high memory cost of finetuning large pretrained language models when deploying multiple tasks simultaneously.
  • To explore whether selective parameter pruning via binary masks can match finetuning performance without updating any pretrained weights.
  • To evaluate the effectiveness of masking as a parameter-efficient alternative to finetuning in diverse NLP tasks.
  • To analyze the generalization and loss landscape properties of masked models to understand why masking performs competitively.

Proposed method

  • The method trains a set of learnable binary masks—one per downstream task—applied to the pretrained model’s attention and feed-forward layers.
  • The binary masks are optimized end-to-end using the straight-through estimator to enable backpropagation through discrete mask values.
  • The final model uses only the masked weights (i.e., original pretrained weights multiplied by binary masks), leaving all original parameters unchanged.
  • The approach is applied to BERT, RoBERTa, and DistilBERT across 11 diverse NLP tasks, including sequence classification, NER, and reading comprehension.
  • The method enables parameter-efficient ensembles by storing only the binary masks, not full finetuned weights.
  • A mode connectivity analysis is conducted by interpolating between finetuned and masked models along a line segment to evaluate loss landscape similarity.

Experimental results

Research questions

  • RQ1Can learning binary masks for pretrained weights achieve performance comparable to full finetuning on diverse NLP tasks?
  • RQ2How does the memory efficiency of masking compare to finetuning when deploying multiple downstream tasks?
  • RQ3Do the representations learned by masked models encode sufficient information for downstream task performance?
  • RQ4Are the minima found by masking and finetuning connected in the loss landscape, indicating similar optimization paths?
  • RQ5What factors influence the performance of the masking mechanism across different models and tasks?

Key findings

  • Masking achieves performance comparable to finetuning on 11 diverse NLP tasks, including MRPC, SST-2, and CoNLL-2003, with no significant drop in accuracy.
  • The memory footprint of masking is drastically reduced—only 1-bit per parameter per task—making it ideal for multi-task deployment on edge devices.
  • Intrinsic evaluations confirm that masked models extract generalizable and informative representations for downstream tasks.
  • The loss landscape analysis shows that minima found by masking and finetuning are connected by a line segment with nearly constant test accuracy, indicating similar optimization quality.
  • Masks for higher BERT layers are more dissimilar across tasks, suggesting greater task-specificity in deeper layers, consistent with findings in finetuning.
  • Different random initializations of masks yield similar performance, supporting the existence of multiple effective subnetworks—consistent with the lottery ticket hypothesis.

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.