Skip to content
Query Feedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  1. Home /
  2. AI Glossaries /
  3. LLMs /
  4. What is an Attention Head?
LLMs

What is an Attention Head?

Updated September 26, 2026 Read 3 min

An attention head is a single attention unit inside a transformer layer, with its own query, key and value projections. Each head learns to focus on a particular kind of relationship between tokens.

Contents 11
  1. 01Key takeaways
  2. 02An attention head explained in simple terms
  3. 03What a single head does
  4. 04Roles heads can take on
  5. 05A worked example
  6. 06Attention sinks
  7. 07Head pruning
  8. 08Limitations
  9. 09Common Use Cases
  10. 10Frequently Asked Questions
  11. 11Related Terms

An attention head is one individual attention unit inside a transformer layer, with its own learned query, key and value projections. A layer contains many heads running in parallel, together forming multi-head attention. Each head computes its own pattern of which tokens should attend to which, and contributes part of the layer’s output.

Key takeaways

  • A head is the smallest unit of attention in a transformer.
  • Heads within a layer are independent during attention, then combined.
  • Some heads take on recognisable roles; many are hard to interpret.
  • Research has shown many heads can be pruned with little performance loss.
  • Heads are a central object of study in AI interpretability.

An attention head explained in simple terms

If a transformer layer is a team reading a document, each head is one team member with a specific habit. One always checks who “it” refers to. One notices repeated phrases. One watches for the main verb. None of them was told to do this; each developed its habit during training because it reduced error.

What a single head does

  1. Projects every token into its own query, key and value vectors, usually of a smaller dimension such as 64 or 128.
  2. Scores every query against every key.
  3. Applies scaling, any masking, then softmax.
  4. Outputs a weighted mix of values for each position.

Its output is concatenated with the other heads’ outputs and passed through the layer’s output projection.

Roles heads can take on

Observed roleWhat the head does
Previous-token headAttends mainly to the token just before
Positional headFocuses on fixed offsets or the first token
Syntactic headLinks subjects to verbs, or nouns to their modifiers
Coreference headConnects pronouns to earlier nouns
Induction headFinds an earlier occurrence of the current token and copies what followed it
Rare-token headAttends to unusual or distinctive words

Induction heads, described in interpretability research by Anthropic in 2022, are thought to play a part in in-context learning: copying patterns from earlier in the prompt.

A worked example

Prompt: “Riya works at NeerSoft. Riya’s role is”. A previous-token head helps carry local grammar. An induction head spots that “Riya” appeared before, looks at what followed it then, and raises the probability of related content. The combination of many heads across many layers produces a coherent continuation.

Attention sinks

Researchers have found that many heads place large attention weight on the first token, even when it carries little meaning. This “attention sink” behaviour appears to act as a default place to send attention when a head finds nothing relevant, and it matters when designing long-context and streaming systems.

Head pruning

A 2019 study titled “Are Sixteen Heads Really Better than One?” found that many heads could be removed after training with only small drops in performance. Pruning heads can speed up inference, though the effect varies by model and task.

Limitations

  • Attention weights show where a head looks, not why the model answered as it did.
  • Head roles are often mixed rather than clean and separable.
  • Findings from one model do not always transfer to another.

Common Use Cases

01

Interpretability research

Study individual heads to understand how models process text.

02

Model compression

Prune redundant heads to speed up inference.

03

Debugging model behaviour

Inspect attention patterns when models misread context.

04

Long-context engineering

Account for attention sinks when designing streaming systems.

05

Architecture design

Choose head counts and dimensions when training new models.

06

Safety research

Trace which components drive unwanted behaviour.

Frequently Asked Questions

One parallel attention unit in a transformer layer, with its own query, key and value projections.

Different heads specialise in patterns such as previous-token links, syntax, coreference or copying earlier sequences.

A head that finds an earlier occurrence of the current token and attends to what followed it, supporting in-context pattern copying.

Often yes. Research has shown many heads can be pruned after training with small performance losses.

Only partly. They show where a head looks, not the full reason for an output.

Related Terms

  • Multi-Head Attention
  • Self-Attention
  • Transformer
  • Interpretability
  • Attention Mechanism
  • Model Pruning

Related AI Terms

What is Multi-Head Attention?Multi-head attention runs several attention operations in parallel, each with its own learned projections, so a model can…What is Prefix Tuning?Prefix tuning is a parameter-efficient fine-tuning method that learns trainable vectors inserted into the attention keys and values…What is an Attention Mechanism?An attention mechanism is a technique that lets a neural network focus on the most relevant parts of…What is Self-Attention?Self-attention is a mechanism where each position in a sequence attends to every other position in the same…What is RoPE (Rotary Positional Embedding)?RoPE (rotary positional embedding) encodes a token's position by rotating its query and key vectors by an angle…What is an Encoder-Decoder Model?An encoder-decoder model, also called a sequence-to-sequence model, uses one component to read and understand the input and…

Contents

  1. 01Key takeaways
  2. 02An attention head explained in simple terms
  3. 03What a single head does
  4. 04Roles heads can take on
  5. 05A worked example
  6. 06Attention sinks
  7. 07Head pruning
  8. 08Limitations
  9. 09Common Use Cases
  10. 10Frequently Asked Questions
  11. 11Related Terms

AI Topic

  • LLMs

Related Terms

  • What is Multi-Head Attention?
  • What is Prefix Tuning?
  • What is an Attention Mechanism?
  • What is Self-Attention?
  • What is RoPE (Rotary Positional Embedding)?
  • What is an Encoder-Decoder Model?

Quick Navigation

  • Common Use Cases
  • Frequently Asked Questions
  • Related Terms
  • Back to top

Details

Updated
September 26, 2026
Read
3 min
  • Forum
  • Submit a tool
  • Submit Guest Post
  • List Your Startup
  • Privacy Policy
  • Editorial Policy
  • Account
  • Contact
  • AI Productivity
  • AI Video
  • AI Coding
  • AI Chatbots
  • Sales
  • AI Business
  • View All Tools

Subscribe our Newsletter

Get weekly exclusive content - No spam.

Copyright © 2026 -  Query Feedz

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}