AI engineering glossary · Transformers LLM architecture

What is attention head?

Attention head: One of the parallel attention computations inside a multi-head attention layer, with its own query, key and value projection matrices. Each head produces its own pattern of weights, and researchers have found heads that track things like previous tokens, syntax links or repeated text.

Level: intermediateTopic: Transformers LLM architecture

Attention head: an example

Llama-style 7B models typically use 32 heads per layer, so a 32-layer model has 1,024 attention heads in total.

Related terms

More Transformers LLM architecture terms

Where you learn it

Attention head is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.