Reproduce “Talking-Heads Attention” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

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

About this paper

Noam Shazeer, Zhenzhong Lan, Youlong Cheng, Nan Ding, Le Hou

Google researchers propose Talking-Heads Attention, an architectural modification to the Multi-Head Attention mechanism in Transformer models. This enhancement introduces linear projections that enable information exchange between attention heads, leading to consistent quality improvements across T5, ALBERT, and BERT, particularly maintaining performance in configurations with a high number of low-dimensional attention heads.

Key insights

  • Enabling information exchange across attention heads, both before and after the softmax operation, is crucial for improving Multi-Head Attention performance.
  • The proposed mechanism allows Transformer models to effectively utilize a much larger number of attention heads, even when per-head query and key dimensions are significantly reduced.
  • Modifying the encoder self-attention layers within T5 models yields the most substantial performance improvements on downstream language understanding tasks.

Summary by alphaXiv.

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