bert icon indicating copy to clipboard operation
bert copied to clipboard

Question about mask strategy.

Open JinmingZhao opened this issue 8 years ago • 2 comments

the mask strategy relevant code at: https://github.com/google-research/bert/blob/master/create_pretraining_data.py#L335 randome mask 15% tokens of every sequence , and 20% probability of each token will not be masked as [MASK], So, supppose a sequence with 100 tokens, then the number of the random seleced tokens will be 15% * 100 = 15tokens, then the probabolty of the sequence without [MASK] is 20% ^ (15) . This probabilty is so small. So, how to understanding " The first is that we are creating a mismatch between pre-training and finetuning, since the [MASK] token is never seen during fine-tuning." ?

Thanks!

JinmingZhao avatar Nov 26 '18 01:11 JinmingZhao

Hi, @jacobdevlin-google , could you answer this question for me? Thanks.

JinmingZhao avatar Nov 28 '18 23:11 JinmingZhao

This is more relevant to the token-level representation for tasks like SQuAD and NER, not sentence level tasks. We've run some more experiments which we'll report in the next version of the paper where we show that if you replace with [MASK] 100% of the time it hurts feature-based token-level approach, but doesn't hurt sentence level tasks like GLUE.

jacobdevlin-google avatar Nov 28 '18 23:11 jacobdevlin-google