A diagram of a transformer attention block with sliding window

Build a Fused Causal Self-Attention Block with RoPE and Sliding-Window KV Cache in Pure Python

This guide walks through implementing a fused causal self-attention block with RoPE and a sliding-window KV cache in pure Python, giving you a concrete portfolio piece that highlights systems engineering expertise.

September 11, 2026 · 4 min · 823 words · martinuke0
Feedback