Zenaique
Glossary · Architecture

Multi-Head Attention (MHA)

Also known as: MHA, Multi-headed attention

Run several attention heads in parallel with different projections, then concat. This captures multiple relationship types per layer.

A self-attention variant that runs several attention operations in parallel with different learned projections, then concatenates the results. Lets the model attend to different relationship patterns simultaneously.

In practice

Standard attention variant in transformers. GQA and MQA are direct optimizations of it, so knowing MHA first makes those click instantly.

How it compares

MHA gives each query head its own KV; GQA shares KV across groups of query heads.

Related topics

Related terms