{"url":"/method/talking-heads-attention","slug":"talking-heads-attention","name":"Talking-Heads Attention","full_name":"Talking-Heads Attention","full_name_withheld":false,"description_markdown":"**Talking-Heads Attention** is a variation on [multi-head attention](https://paperswithcode.com/method/multi-head-attention) which includes linear projections across the attention-heads dimension, immediately before and after the [softmax](https://paperswithcode.com/method/softmax) operation. In [multi-head attention](https://paperswithcode.com/method/multi-head-attention), the different attention heads perform separate computations, which are then summed at the end. Talking-Heads Attention breaks that separation. Two additional learned linear projections are inserted, $P\\_{l}$ and $P\\_{w}$, which transform the attention-logits and the attention weights respectively, moving information across attention heads. Instead of one \"heads\" dimension $h$ across the whole computation, we now have three separate heads dimensions: $h\\_{k}$, $h$, and $h\\_{v}$, which can optionally differ in size (number of \"heads\"). $h\\_{k}$ refers to the number of attention heads for the keys and the queries. $h$ refers to the number of attention heads for the logits and the weights, and $h\\_{v}$ refers to the number of attention heads for the values.","description_state":"present","introduced_year":null,"introduced_by":{"title":"Talking-Heads Attention","paper":"/paper/talking-heads-attention","first_author":"Noam Shazeer","n_authors":5,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/talking-heads-attention"},"source":{"url":"https://arxiv.org/abs/2003.02436v1","title":"Talking-Heads Attention","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"General","area_id":"general","collection":"Attention Modules","url":"/methods/category/attention-modules","pwc_aliases":[]}],"n_papers_tagged":1,"archive_num_papers":1,"papers_newest_first":[{"paper":"/paper/talking-heads-attention","title":"Talking-Heads Attention","date":"2020-03-05","arxiv_id":"2003.02436","n_code_links":4,"syntology":{"ran":3,"of":3,"unverified":0,"pointer_only":2}}],"papers_shown":1,"tasks":[{"task":"/task/language-modeling","name":"Language Modeling","papers":1},{"task":"/task/language-modelling","name":"Language Modelling","papers":1},{"task":"/task/masked-language-modeling","name":"Masked Language Modeling","papers":1},{"task":"/task/question-answering","name":"Question Answering","papers":1},{"task":"/task/transfer-learning","name":"Transfer Learning","papers":1}],"tasks_shown":5,"n_tasks":5,"usage_by_year":[{"year":"2020","papers":1}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/talking-heads-attention"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}