Paper implementations practice problems
16 problems · 0 solved
Reading a paper is one skill, and turning its equations into working code is another. Papers often skip small details like shapes, stability tricks and edge cases, and you only find them when you implement the idea. These problems take core ideas from well known papers and turn each into a focused coding task. You will compute the word2vec skip-gram negative sampling loss, write the knowledge distillation loss with temperature, mix a batch with mixup, build a global magnitude pruning mask, evaluate the Chinchilla scaling law and its compute-optimal rule of thumb, compute ALiBi attention biases, implement FlashAttention-style tiled causal attention, implement recurrent retention from RetNet, and run a Mamba-style selective state-space scan with zero-order-hold discretization. Start with the Easy problems on scaling laws, pruning and word2vec. Then do distillation, mixup and ALiBi, and finish with FlashAttention tiling, RetNet and the Mamba scan. Research and applied scientist roles often ask candidates to implement a paper idea from scratch, and practising this makes reading new papers far less intimidating.
Easy 7
- word2vec skip-gram negative sampling loss (Mikolov et al., 2013)
- Compute-optimal model and data size with a Chinchilla-style rule of thumb
- Evaluate the Chinchilla scaling law
- Build a global magnitude pruning mask
- Compute the SwiGLU feed-forward hidden size used by Llama
- Add the z-loss auxiliary term to cross-entropy
- Apply tanh soft-capping to logits and get its gradient