CourseTransformers: From Attention to Trained, Served and Interpreted Models · Module 10: Efficiency and Long Context · part 73 of 111
Part 73 · Module 10: Efficiency and Long Context

Lesson 3: Attention that respects memory, and the KV cache

31 min read·13 Oct 2026
Module 10 · Lesson 3 · About 60 minutes · Needs: Module 2, Lesson 5 (KV cache, GQA, MQA, MLA); Module 5, Lesson 4 (fused attention, checkpointing); Module 8's package as pasted in Module 8, Lesson 4

The situation

Sol 431 at Aurora Station. Tariq's relay splits long transmissions from Earth into 128-character pieces, because base reads only 128 at a time. Lesson 1 priced reading one 4,096-character transmission whole. Hana Aoki asks two things. "Can attention at 4,096 avoid a 4,096 by 4,096 grid of scores? And when the station serves many readers at once, what does each cost me in memory?"

You answer both with the same transmission: first attention without the grid, then the keys and values a server keeps for it, shrunk four ways.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.