My Personal Favorite FlashAttention (+ KV-Caching) Visualization

July 15, 2026

Note: To be frank, these were some notes that were hiding in my notability that I stumbled across whilst doing a self-review of some key attention concepts. Hopefully they can be of some use to you!

FlashAttention is extremely well-known, but despite this, I can rarely find an explanation of it that truly satisfies me. I’m the kind of person who likes to get into the nitty-gritty of the exact math and computation behind the kernel. This PDF is my understanding of the core algorithm, along with some mathematics that will hopefully help you grok why tiling in this way is correct.

“Teaching” Notes:

Hope this helps all you self-studiers out there! Please contact me if there’s any part of my notes you disagree with or find awry.

Attention Notes:

PDF

Open in new tab