Measure attention cost as sequence length grows
Implement scaled dot-product attention in numpy or PyTorch. Time and memory it at 512, 2K, 8K, 32K tokens (synthetic is fine). Add a sliding-window or prefix-cache variant. Plot wall time and peak memory against n. Mark the knee where lengthening the window exceeds a stated latency or memory bound.