Weighted Sampling for Masked Language Modeling

Linhan Zhang, Qian Chen, Wen Wang, Chong Deng, Xin Cao +3 more
2/28/2023
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

Masked Language Modeling (MLM) is widely used to pretrain language models. The standard random masking strategy in MLM causes the pre-trained language models (PLMs) to be biased toward high-frequency tokens. Representation learning of rare tokens is poor and PLMs have limited performance on downstream tasks. To alleviate this frequency bias issue, we propose two simple and effective Weighted Sampling strategies for masking tokens based on the token frequency and training loss. We apply these two strategies to BERT and obtain Weighted-Sampled BERT (WSBERT). Experiments on the Semantic Textual Similarity benchmark (STS) show that WSBERT significantly improves sentence embeddings over BERT. Combining WSBERT with calibration methods and prompt learning further improves sentence embeddings. We also investigate fine-tuning WSBERT on the GLUE benchmark and show that Weighted Sampling also improves the transfer learning capability of the backbone PLM. We further analyze and provide insights into how WSBERT improves token embeddings.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhang2023weighted,
  title  = {Weighted Sampling for Masked Language Modeling},
  author = {Linhan Zhang and Qian Chen and Wen Wang and Chong Deng and Xin Cao and Kongzhang Hao and Yuxin Jiang and Wei Wang},
  year   = {2023},
  eprint = {2302.14225},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.14225v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.14225.svg)](https://codeofpaper.com/paper/2302.14225)

Discussion