MaskGIT is an iterative generative model using masked token prediction. During training, tokens are randomly masked and a transformer predicts them. During generation, tokens with highest uncertainty are iteratively refined in parallel.
Training loss is standard cross-entropy on masked positions. The key is the masking schedule and iterative refinement strategy.
L=i∑1[tokeni masked]⋅H(predi,targeti)Implement:
maskgit_loss(logits, targets, mask)
Computes cross-entropy loss only on masked token positions.
No results yet
Run your code to check it against the examples, or submit to run every test.