Reproduce “Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Zihan Qiu, Zekun Wang, Bo Zheng, Zeyu Huang, Kaiyue Wen, Songlin Yang, Rui Men, Le Yu and 5 more

The authors add a learned, token-dependent gate to each attention head’s output after the attention-weighted sum, reducing attention sinks. In tested models, elementwise SDPA gating improved 15B-parameter MoE perplexity from 6.026 to 5.761 and MMLU by 2.03 points, while raising 128k RULER from 31.65 to 58.82 after continued training. These results do not establish that sink reduction causes long-context gains.

Key insights

  • Non-linearity and sparsity from gating are key factors for improved performance
  • SDPA output gating enables larger learning rates and enhances training stability
  • Sparse gating effectively eliminates attention sink problems
  • Gating improves model's ability to handle longer context lengths

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.