Attention Mechanisms
PremiumFrom MHA / Causal / GQA to Attention Sink and Gated Attention, understand the design, flaws, and evolution of attention
Overview
Attention is the core of the Transformer. This series starts from the most basic Self-Attention. We first make clear the three forms you must master in practice: MHA, Causal Attention, and GQA. Then we reveal a counterintuitive phenomenon shared by all modern softmax-based LLMs, Attention Sink: why the first token absorbs the vast majority of attention, along with the mechanism, cost, and removal paths of this phenomenon. Finally we move into Gated Attention, an architectural change proposed by the Qwen team in 2025 that uses a single head-wise sigmoid gate to simultaneously address sink, low-rank collapse, and training stability.
After finishing this series, you should be able to answer:
Log in to continue reading
This is premium content. Please log in to access the full article.
CookLLM Docs