Frequency Is What You Need: Considering Word Frequency When Text Masking Benefits Vision-Language Model Pre-training
Mingliang Liang, Martha Larson
TL;DR
This work examines how text-masking strategies used during Vision-Language Model pre-training shape word-frequency distributions in the training data and how these shifts relate to model performance. It introduces CLIPF, a frequency-based masking approach that uses $P(w_i) = 1 - \sqrt{\frac{t}{f(w_i)}}$ to prioritize masking of frequent words without POS tagging or hard cutoffs, and demonstrates its advantages over syntax masking, especially as the number of input tokens decreases. The study also shows that the relative performance of masking strategies depends on training duration, with frequency-preserving methods like CLIPF performing well across multiple datasets (CC3M, CC12M, LAION-400M) and tasks (zero-shot classification, image-text retrieval). Overall, the findings offer practical guidance for choosing text-masking strategies under computational constraints and point to ongoing opportunities to tune word-frequency distributions for improved VLM pre-training efficiency and effectiveness.
Abstract
Vision Language Models (VLMs) can be trained more efficiently if training sets can be reduced in size. Recent work has shown the benefits of masking text during VLM training using a variety of strategies (truncation, random masking, block masking and syntax masking) and has reported syntax masking as the top performer. In this paper, we analyze the impact of different text masking strategies on the word frequency in the training data, and show that this impact is connected to model success. This finding motivates Contrastive Language-Image Pre-training with Word Frequency Masking (CLIPF), our proposed masking approach, which directly leverages word frequency. Extensive experiments demonstrate the advantages of CLIPF over syntax masking and other existing approaches, particularly when the number of input tokens decreases. We show that not only CLIPF, but also other existing masking strategies, outperform syntax masking when enough epochs are used during training, a finding of practical importance for selecting a text masking method for VLM training. Our code is available online.
