Sliding Window Attention Explained with Cartoon Huangs: Old Tokens Slide Out of View

cfregly · x · 2026-11-11

cfregly released excerpts from his new "AI Systems Performance Engineering, the Huang Edition" series, using cartoon characters Jensen, Lori, and Alice Huang to illustrate sliding window attention (SWA): each query sees only its own slot plus the 2 previous ones, so older tokens like Lori drop out of view — a "selective memory" that's usually a feature. The post links the Mistral 7B paper, where SWA handles arbitrary-length sequences at reduced inference cost.

Related event: Cartoon Series Explains Sliding Window Attention and Top-k Sampling(2 posts)→

Original post →

More from Infra

Infra channel →