attention
Inference interview questions tagged attention, across every topic.
12 questions · 7 unlocked for you
Concepts behind "attention"
Concept pages for the mechanisms these questions lean on.
Foundational
The Online Softmax RecurrenceOnline softmax keeps a running max, a running normalizer and an unnormalized output, and rescales them when the max grows. The merge rule is exact and associative, which is what lets FlashAttention tile over keys and Flash-Decoding split one long context across thread blocks.🔦 Attention Kernels
Foundational
Attention With a KV Cache, From ScratchA from-scratch implementation of causal multi-head attention with grouped-query KV heads and a KV cache, in about 35 lines of numpy. Covers the offset causal mask when queries are fewer than keys, why the cache turns quadratic recompute into linear work, and the tests an interviewer runs against it.⌨️ Implementation Patterns