Hi @reSearch2vec and @Maria
BERT will actually predict all the tokens (everything, masked, and non-masked tokens). This is why we set the non-masked tokens equal to -100. This means not to compute loss for the non-masked tokens. the reason is the cross-entropy function ignores the inputs which are equal to -100, see here 29
Also, you can see this code 35 for the code for pre-training the BERT model and understanding how the masking works.