A Masked Language Model is trained to predict missing tokens anywhere in a sequence, using the context from both before and after the missing tokens.
They are commonly used for non-generative tasks like sentiment analysis and text classification, or for tasks requiring an understanding of the overall context such as code debugging.
An example is BERT.