Implement a KV cache + incremental single-token decode loop for a small transformer

Attention Efficiency and Long Context2 / 5

Chapter 032 / 5

Attention Efficiency and Long Context

Implement a KV cache + incremental single-token decode loop for a small transformer

Medium
Target interface
class CachedAttention

Complete the starter code in the editor. Any correct approach is accepted.

Hints0 / 2
Reference solution
Your own code stays in the editor.