Implement the forward masking process for a masked diffusion LM (mask a fraction tt of to

Diffusion & Non-Autoregressive Language Models1 / 4

Chapter 221 / 4

Diffusion & Non-Autoregressive Language Models

Implement the forward masking process for a masked diffusion LM (mask a fraction tt of to

Easy

Implement the forward masking process for a masked diffusion LM (mask a fraction tt of tokens).

Target interface
forward_mask(x0, t, mask_id)

Implement the function/class skeleton in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.