AI Glossary Term

What does “Multi-Head Attention” mean?

Definition

A transformer mechanism that runs several attention operations in parallel to capture different types of relationships.

How Multi-Head Attention works

Diagram for Multi-Head Attention: Same input tokens feed into Several attention heads in parallel, which produces Head 1: grammar links, Head 2: reference links, Head 3: nearby words.Same input tokensSeveral attention heads inparallelHead 1:grammar linksHead 2:referencelinksHead 3:nearby words

Example

In one layer, one head may track which noun a pronoun refers to, while another focuses on neighboring words. Their results are combined into a richer representation.

Why it matters

Multiple heads let the model look at different relationships at once. Heads tend to specialize, though not always in neat human terms.

Common questions

How many heads?

It varies, from a handful to a hundred or more in large models.

How are head outputs combined?

They are concatenated and passed through a learned linear layer.

Does each head really specialize?

Some do, but many are redundant, and interpreting them is an active research area.

Learn more in our free guides

Test yourself

See also