{"url":"/method/multi-dconv-head-attention","slug":"multi-dconv-head-attention","name":"Multi-DConv-Head Attention","full_name":"Multi-DConv-Head Attention","full_name_withheld":false,"description_markdown":"**Multi-DConv-Head Attention**, or **MDHA**, is a type of [Multi-Head Attention](https://paperswithcode.com/method/multi-head-attention) that utilizes [depthwise convolutions](https://paperswithcode.com/method/depthwise-convolution) after the multi-head projections. It is used in the [Primer](https://paperswithcode.com/method/primer) [Transformer](https://paperswithcode.com/method/transformer) architecture.\r\n\r\nSpecifically, 3x1 depthwise convolutions are added after each of the multi-head projections for query $Q$, key $K$ and value $V$ in self-attention. These depthwise convolutions are performed over the spatial dimension of each dense projection’s output. Interestingly, this ordering of pointwise followed by depthwise convolution is the reverse of typical [separable convolution](https://paperswithcode.com/method/depthwise-separable-convolution), which the authors find to be less effective. They also find that wider depthwise convolution and [standard convolution](https://paperswithcode.com/method/convolution) not only do not improve performance, but in several cases hurt it. \r\n\r\nMDHA is similar to [Convolutional Attention](https://paperswithcode.com/method/cvt), which uses [separable convolution](https://paperswithcode.com/method/depthwise-separable-convolution) instead of depthwise convolution and does not apply convolution operations per attention head as in MDHA.","description_state":"present","introduced_year":null,"introduced_by":{"title":null,"paper":null,"first_author":null,"n_authors":0,"url_abs":null,"archive_paper_url":null},"source":{"url":"https://arxiv.org/abs/2109.08668v2","title":"Primer: Searching for Efficient Transformers for Language Modeling","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":15,"archive_num_papers":null,"papers_newest_first":[{"paper":null,"title":"SAFEPATH: Preventing Harmful Reasoning in Chain-of-Thought via Early Alignment","date":"2025-05-20","arxiv_id":"2505.14667","n_code_links":0,"syntology":null},{"paper":null,"title":"A review of DNA restriction-free overlapping sequence cloning techniques for synthetic biology","date":"2025-05-06","arxiv_id":"2505.03681","n_code_links":0,"syntology":null},{"paper":null,"title":"Primer C-VAE: An interpretable deep learning primer design method to detect emerging virus variants","date":"2025-03-03","arxiv_id":"2503.01459","n_code_links":0,"syntology":null},{"paper":"/paper/solving-oscillator-odes-via-soft-constrained","title":"Characteristic Performance Study on Solving Oscillator ODEs via Soft-constrained Physics-informed Neural Network with Small Data","date":"2024-08-19","arxiv_id":"2408.11077","n_code_links":1,"syntology":null},{"paper":null,"title":"The curious case of A31P, a topology-switching mutant of the Repressor of Primer protein : A molecular dynamics study of its folding and misfolding","date":"2024-04-01","arxiv_id":"2404.01405","n_code_links":0,"syntology":null},{"paper":"/paper/rcmha-relative-convolutional-multi-head","title":"RCMHA: Relative Convolutional Multi-Head Attention for Natural Language Modelling","date":"2023-08-07","arxiv_id":"2308.03429","n_code_links":1,"syntology":null},{"paper":null,"title":"Brainformers: Trading Simplicity for Efficiency","date":"2023-05-29","arxiv_id":"2306.00008","n_code_links":0,"syntology":null},{"paper":"/paper/the-effects-of-political-martyrdom-on","title":"The Effects of Political Martyrdom on Election Results: The Assassination of Abe","date":"2023-05-29","arxiv_id":"2305.18004","n_code_links":1,"syntology":null},{"paper":null,"title":"Towards NeuroAI: Introducing Neuronal Diversity into Artificial Neural Networks","date":"2023-01-23","arxiv_id":"2301.09245","n_code_links":0,"syntology":null},{"paper":"/paper/n-grammer-augmenting-transformers-with-latent-1","title":"N-Grammer: Augmenting Transformers with latent n-grams","date":"2022-07-13","arxiv_id":"2207.06366","n_code_links":2,"syntology":{"ran":0,"of":6,"unverified":6,"pointer_only":0}},{"paper":null,"title":"Piecewise Linear Neural Networks and Deep Learning","date":"2022-06-18","arxiv_id":"2206.09149","n_code_links":0,"syntology":null},{"paper":null,"title":"Enriching and Characterizing T-Cell Repertoires from 3' Barcoded Single-Cell Whole Transcriptome Amplification Products","date":"2022-03-21","arxiv_id":"2203.11266","n_code_links":0,"syntology":null},{"paper":null,"title":"Searching for Efficient Transformers for Language Modeling","date":"2021-12-01","arxiv_id":null,"n_code_links":0,"syntology":null},{"paper":null,"title":"N-grammer: Augmenting Transformers with latent n-grams","date":"2021-11-16","arxiv_id":null,"n_code_links":0,"syntology":null},{"paper":"/paper/primer-searching-for-efficient-transformers","title":"Primer: Searching for Efficient Transformers for Language Modeling","date":"2021-09-17","arxiv_id":"2109.08668","n_code_links":4,"syntology":{"ran":3,"of":3,"unverified":0,"pointer_only":3}}],"papers_shown":15,"tasks":[{"task":"/task/language-modeling","name":"Language Modeling","papers":5},{"task":"/task/language-modelling","name":"Language Modelling","papers":5},{"task":null,"name":"CPU","papers":1},{"task":"/task/common-sense-reasoning","name":"Common Sense Reasoning","papers":1},{"task":"/task/coreference-resolution","name":"Coreference Resolution","papers":1},{"task":"/task/deep-learning","name":"Deep Learning","papers":1},{"task":"/task/diversity","name":"Diversity","papers":1},{"task":"/task/epidemiology","name":"Epidemiology","papers":1},{"task":null,"name":"GPU","papers":1},{"task":"/task/natural-language-inference","name":"Natural Language Inference","papers":1},{"task":"/task/protein-structure-prediction","name":"Protein Structure Prediction","papers":1},{"task":"/task/question-answering","name":"Question Answering","papers":1},{"task":"/task/safety-alignment","name":"Safety Alignment","papers":1},{"task":"/task/sentiment-analysis","name":"Sentiment Analysis","papers":1},{"task":"/task/specificity","name":"Specificity","papers":1},{"task":"/task/tar","name":"TAR","papers":1},{"task":"/task/text-classification","name":"Text Classification","papers":1},{"task":"/task/word-sense-disambiguation","name":"Word Sense Disambiguation","papers":1}],"tasks_shown":18,"n_tasks":18,"usage_by_year":[{"year":"2021","papers":3},{"year":"2022","papers":3},{"year":"2023","papers":4},{"year":"2024","papers":2},{"year":"2025","papers":3}],"row_source":"embedded","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/multi-dconv-head-attention"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}