← Teach it back (generation)⌂ From Typewriter to Editor: Diffusion Language ModelsThe cheat sheet (consolidation) →
Part 7 · Keep Learning
Build it yourself (transfer)
The repo now contains a tutorial at tutorials/masked-diffusion/: a numpy skeleton of
everything Maths II derived — the forward masking process, the reveal-probability sampler
step, the NELBO weight, the weighted MLM loss, and a DDIM step — with the implementations
replaced by TODOs and a test suite that knows the right answers (including statistical checks
that your sampler preserves the marginals):
cd tutorials/masked-diffusion python3 -m pytest -q # red until your implementations are right
When the suite is green, you have not read masked diffusion — you have written it. Stuck
on one function? solutions/ has a reference implementation; the honest move is to
peek at one function, not the file.