What kinds of patterns do different attention heads tend to specialize in?
Last updated
Common roles: positional heads (previous/next token, early layers), syntactic heads (verb to object, coreference), and sink heads attending to
[SEP],[CLS]or BOS as a "no-op".Decoder LMs have algorithmic heads such as induction heads (find an earlier occurrence of the current token and copy what followed), key to in-context learning.
Rough trend is local/positional low, syntactic middle, semantic high. Attention weights are not a full explanation, and many heads are redundant or prunable.
- https://medium.com/@inamdaraditya/do-attention-heads-actually-specialize-what-the-research-actually-says-92f8897c4275
- https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html
- https://dev.to/jackm_345442a09fb53b/llm-interview-series3-transformers-explained-attention-is-all-you-need-523o