atlas

Research map / Architectures and efficiency / Attention and transformers

Improving Transformers with Dynamically Composable Multi-Head Attention

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head mechanisms · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes DCMHA, which dynamically composes attention score and weight matrices across heads with input-dependent low-rank and gating maps, yielding DCFormer models that outperform Transformer baselines on Pile language modeling and downstream tasks.

Problem

Standard multi-head attention has independent heads, causing low-rank bottleneck of attention score matrices and head redundancy; prior head-collaboration methods are either static, surface-level, or computationally costly.

Approach

A Compose function that linearly mixes attention score (pre-softmax) and weight (post-softmax) matrices across heads, with input-dependent low-rank-plus-diagonal maps computed from queries and keys via a row-plus-column, low-rank-plus-diagonal tensor decomposition, keeping parameter and FLOP overhead small.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
replace MHA with DCMHAPythia-2.8B · Pile validationperplexity: 6.63 -> 6.36Helped
replace MHA with DCMHAPythia-6.9B · Zero-shot downstream NLP tasksaverage accuracy: 55.1 -> 56.7Helped
replace MHA with DCMHAPythia-6.9B · Synthetic datasetaccuracy: 31.9% -> 39.0%Helped
replace MHA with DCMHAViT-S/16 · ImageNet-1k, Epoch 300Top-1 accuracy: 79.8 -> 80.1Helped
add dynamic projection and gating instead of static projection (ablation)Transformer++ 405M · language modelingperplexity: 11.17 -> 10.83Helped
add dynamic projection (ablation)Transformer++ 405M · language modelingperplexity: 11.68 -> 10.95Helped
add dynamic gating (ablation)Transformer++ 405M · language modelingperplexity: 11.68 -> 11.31Helped
add query-wise composition (ablation)Transformer++ 405M · language modelingperplexity: 11.68 -> 10.89Helped
add key-wise composition (ablation)Transformer++ 405M · language modelingperplexity: 11.68 -> 10.91Helped
add pre-composition on attention scores (ablation)Transformer++ 405M · language modelingperplexity: 11.68 -> 11.54Helped
add post-composition on attention weights (ablation)Transformer++ 405M · language modelingperplexity: 11.68 -> 11.05Helped
increase dynamic projection rank from 1 to 2 (ablation)DCFormer++ 405M · language modelingperplexity: 10.87 -> 10.83Helped

Surprising findings

Limitations

Experimental setup

Datasets: Pile Flan Collection C4 ImageNet-1K synthetic entity-attribute reasoning dataset (888 examples, 74 tasks)

Benchmarks: Pile validation perplexity Flan perplexity LAMBADA PIQA WinoGrande ARC-Easy ARC-Challenge SciQ LogiQA BoolQ HellaSwag RACE

Metrics: perplexity accuracy top-1 accuracy top-5 accuracy training throughput inference speed

Baselines: Transformer Transformer++ Pythia-2.8B Pythia-6.9B Pythia-12B ViT-S/16 ViT-M/16 Talking-Heads Attention

Builds on: Talking-Heads Attention Transformer++ (RoPE + SwiGLU) Pythia QKNorm

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy