← Questions

Implement multi-head attention and LLM sampling

0
Scale AICodingLast asked Feb 2026

Implement multi-head self-attention from scratch, then the sampling step of a language model: given logits, pick the next token with temperature, top-k and top-p (nucleus) sampling.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding