[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-117192-en":3,"doc-seo-117192-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":27,"seo_description":14,"update_tm":28,"read_time":29},117192,4398048950312,"Violet","https://ap-avatar.wpscdn.com/avatar/400002538284de19e3c?_k=1778320343897328908",8,"Research & Report","Attention is Not All You Need - Pure Attention Loses Rank Doubly Exponentially with Depth","Attention-based architectures are widely used in machine learning, yet the underlying reasons for their effectiveness remain insufficiently understood. This work analyzes self-attention networks through a decomposition of their outputs into sums of smaller terms, each corresponding to a sequence of attention heads across layers. The study proves a strong inductive bias: without skip connections or MLPs, the network output converges doubly exponentially to a rank-1 matrix with uniform tokens, while skip connections and MLPs prevent degeneration. Experiments confirm the convergence behavior across variants of transformer architectures.","View metadata, citation and similar [papers at ](papers at core.ac.uk)[core.ac.uk](papers at core.ac.uk) brought to you by CORE  \n[provided by](provided by arXiv.org)[ arXiv.org](provided by arXiv.org) e-Print Archive  \nAttention is not all you need:  \npure attention loses rank doubly exponentially with depth  \narXiv :2103 .03404v 1 [ cs .LG] 5 Mar 2021  \nYihe Dong Google  \n[yihed@google.com](yihed@google.com)  \nJean-Baptiste Cordonnier  \nEPFL  \njean-baptiste.cordonnier@ep􀀍.ch  \nAndreas Loukas EPFL  \nandreas.loukas@ep􀀍.ch  \nAbstract  \nAttention-based architectures have become ubiquitous in machine learning. Yet our understanding of the reasons for their e􀀋ectiveness remains limited. This work proposes a new way to understand self-attention networks: we show that their output can be decomposed into a sum of smaller terms, each involving the operation of a sequence of attention heads across layers. Using this decomposition, we prove that self-attention possesses a strong inductive bias towards \\token uniformity\". Speci􀀌cally, without skip connections or multi-layer perceptrons (MLPs), the output converges doubly exponentially to arank-1 matrix. On the other hand, skip connections and MLPs stop the output from degeneration. Our experiments verify the identi􀀌ed convergence phenomena on di􀀋erent variants of standard transformer architectures 1 .  \n1 Introduction  \nThe attention mechanism [BCB15] was initially developed to better learn long-range sequential knowledge, and found e􀀋ective use in transformer networks [VSP+ 17] . Since then, attention-based architectures have permeated across data domains machine learning applications, such as in natural language processing [DCLT18], speech recognition [LZL+ 20], and computer vision [RPV+ 19 , BZV+ 19] . As such, it is vital to develop tools to understand the inner workings of transformers and attention in general, both to shed light on existing models, and to design more e􀀋ective future models.  \nThis work provides new insights about the operation and inductive bias of networks built by stacking multiple self-attention layers. Surprisingly, we 􀀌nd that pure self-attention networks (SANs), i.e., transformers with skip connections and multi-layer perceptrons (MLPs) disabled, lose expressive power doubly exponentially with respect to network depth. More speci􀀌cally, we prove that the output converges with a cubic rate to a rank one matrix that has identical rows. While we derive the convergence bounds in part by using properties of stochastic matrices, our results go beyond what one would expect based on standard results. In particular, by leveraging the cascading e􀀋ects of speci􀀌cally stacking self-attention modules, we show exponentially faster convergence than what standard theory prescribes. Furthermore, while previous studies have considered the rank of individial self-attention matrices [WLK+ 20 , KVPF20 , CLJ20a], our results are the 􀀌rst to address conditions under which the entire network converges to rank one.  \nThis raises the question, why do transformers work? Our analysis indicates that skip connections play a key role in mitigating rank collapse, and MLPs can slow down the convergence by increasing their Lipschitz constant. We characterize these counteracting forces by proving upper and lower bounds of this convergence behavior under SAN architectural variants that resemble transformers. Our results reveal a previously unknown vital utility of skip connections, beyond facilitating optimization and gradient 􀀍ow [HZRS16a, BFL + 18] .  \n1 Our code is publicly available at [https://github.com/twistedcubic/attention-rank-collapse](https://github.com/twistedcubic/attention-rank-collapse)  \nLayer 1 Layer 2  \nFigure 1: Two paths in a deep Self-Attention Network (SAN) with H heads and L layers. At each layer, a path can go through one of the heads or bypass the layer. Adding an MLP block after each attention layer forms the transformer architecture.  \nIn the process, we develop a ne","cbCailZKiVgNDa1a","https://ap.wps.com/l/cbCailZKiVgNDa1a","pdf",1519662,1,22,"English","en",105,"# Abstract\n# Introduction\n# Attention Doubly Exponentially Loses Rank\n## Self-attention networks convergence result","[{\"question\":\"本文提出了如何理解自注意力网络的分析方法？\",\"answer\":\"通过将自注意力网络的输出分解为多个更小项之和，每一项对应于跨层按顺序运行的注意力头序列，从而得到新的路径分解视角。\"},{\"question\":\"纯自注意力网络在深度增加时会发生什么现象？\",\"answer\":\"在禁用跳连（skip connections）和多层感知机（MLPs）时，输出会随网络深度以双重指数速度收敛，并趋向于秩为1且所有token相同的矩阵。\"},{\"question\":\"跳连和MLP为何能阻止退化并影响收敛？\",\"answer\":\"跳连在抑制秩塌陷方面起关键作用；MLPs会通过增大其Lipschitz常数来减慢收敛，从而阻止纯注意力导致的退化。\"}]","Attention is Not All You Need - Pure Attention Loses Rank Doubly Exponentially with Depth | PDF",1785674356,55,{"code":4,"msg":31,"data":32},"ok",{"site_id":24,"language":23,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"attention-is-not-all-you-need-pure-attention-loses-rank-doubly-exponentially-with-depth","",{"@graph":36,"@context":85},[37,54,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,51],{"item":41,"name":42,"@type":43,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":50},"https://docshare.wps.com/document/research-report/",3,{"item":52,"name":13,"@type":43,"position":53},"https://docshare.wps.com/document/attention-is-not-all-you-need-pure-attention-loses-rank-doubly-exponentially-with-depth/117192/",4,{"url":52,"name":13,"@type":55,"author":56,"headline":13,"publisher":58,"fileFormat":61,"inLanguage":23,"description":14,"dateModified":62,"datePublished":62,"encodingFormat":61,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":57},"Person",{"url":41,"name":59,"@type":60},"DocShare","Organization","application/pdf","2026-08-02",true,{"@type":65,"interactionType":66,"userInteractionCount":4},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"本文提出了如何理解自注意力网络的分析方法？","Question",{"text":75,"@type":76},"通过将自注意力网络的输出分解为多个更小项之和，每一项对应于跨层按顺序运行的注意力头序列，从而得到新的路径分解视角。","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"纯自注意力网络在深度增加时会发生什么现象？",{"text":80,"@type":76},"在禁用跳连（skip connections）和多层感知机（MLPs）时，输出会随网络深度以双重指数速度收敛，并趋向于秩为1且所有token相同的矩阵。",{"name":82,"@type":73,"acceptedAnswer":83},"跳连和MLP为何能阻止退化并影响收敛？",{"text":84,"@type":76},"跳连在抑制秩塌陷方面起关键作用；MLPs会通过增大其Lipschitz常数来减慢收敛，从而阻止纯注意力导致的退化。","https://schema.org",{"og:url":52,"og:type":87,"og:title":13,"og:site_name":59,"og:description":14},"article",{"robots":89,"canonical":52},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,120,123,128,131,135],{"id":20,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":53,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":118,"slug":119},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":121,"slug":122},30,"research-report",{"id":124,"doc_module":4,"doc_module_name":46,"category_name":125,"show_sort_weight":126,"slug":127},9,"Religion & Spirituality",20,"religion-spirituality",{"id":126,"doc_module":4,"doc_module_name":46,"category_name":129,"show_sort_weight":126,"slug":130},"World Cup","world-cup",{"id":132,"doc_module":4,"doc_module_name":46,"category_name":133,"show_sort_weight":132,"slug":134},10,"Lifestyle","lifestyle",{"id":136,"doc_module":4,"doc_module_name":46,"category_name":137,"show_sort_weight":106,"slug":138},19,"General","general"]