Chapter 032 / 5
Attention Efficiency & Long Context
Implement a KV cache + incremental single-token decode loop for a small transformer
Medium
Target interface
class CachedAttentionImplement the function/class skeleton in the editor. Any correct approach is accepted.
Hints0 / 2
Reference solution
Your own code stays in the editor.