How Do Transformers Learn Topic Structure: Towards a Mechanistic Understanding
摘要
While the successes of transformers across many domains are indisputable, accurate understanding of the learning mechanics is still largely lacking. Their capabilities have been probed on benchmarks which include a variety of structured and reasoning tasks -- but mathematical understanding is lagging substantially behind. Recent lines of work have begun studying representational aspects of this question: that is, the size/depth/complexity of attention-based networks to perform certain tasks. However, there is no guarantee the learning dynamics will converge to the constructions proposed. In our paper, we provide fine-grained mechanistic understanding of how transformers learn"semantic structure", understood as capturing co-occurrence structure of words. Precisely, we show, through a combination of mathematical analysis and experiments on Wikipedia data and synthetic data modeled by Latent Dirichlet Allocation (LDA), that the embedding layer and the self-attention layer encode the topical structure. In the former case, this manifests as higher average inner product of embeddings between same-topic words. In the latter, it manifests as higher average pairwise attention between same-topic words. The mathematical results involve several assumptions to make the analysis tractable, which we verify on data, and might be of independent interest as well.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 65 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Skill-it! A data-driven skills framework for understanding and training language models 引用了 Language Models are Few-Shot Learners
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- How Transformers Learn Causal Structure with Gradient Descent 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- How Transformers Learn Causal Structure with Gradient Descent 引用了 Language Models are Few-Shot Learners
- How Transformers Learn Causal Structure with Gradient Descent 引用了 Birth of a Transformer: A Memory Viewpoint
- How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression? 引用了 Language Models are Few-Shot Learners
- Birth of a Transformer: A Memory Viewpoint 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper65
- Towards Best Practices of Activation Patching in Language Models: Metrics and MethodsFred Zhang, Neel NandaICLR 2024 · 233 次引用
- Birth of a Transformer: A Memory ViewpointAlberto Bietti, Vivien Cabannes, Diane Bouchacourt, Hervé Jégou 等NeurIPS 2023 · 182 次引用
- Skill-it! A data-driven skills framework for understanding and training language modelsMayee F. Chen, Nicholas Roberts, Kush Bhatia, Jue Wang 等NeurIPS 2023 · 143 次引用
- How Transformers Learn Causal Structure with Gradient DescentEshaan Nichani, Alex Damian, Jason D. LeeICML 2024 · 117 次引用
- How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?Jingfeng Wu, Difan Zou, Zixiang Chen, Vladimir Braverman 等ICLR 2024 · 94 次引用
它引用的 Paper20
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- On Layer Normalization in the Transformer ArchitectureRuibin Xiong, Yunchang Yang, Di He, Kai Zheng 等ICML 2020 · 1,388 次引用
- Are Transformers universal approximators of sequence-to-sequence functions?Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi 等ICLR 2020 · 481 次引用
- Why are Adaptive Methods Good for Attention Models?Jingzhao Zhang, Sai Praneeth Karimireddy, Andreas Veit, Seungyeon Kim 等NeurIPS 2020 · 397 次引用
相关 Paper
- A Mechanistic Analysis of a Transformer Trained on a Symbolic Multi-Step Reasoning TaskJannik Brinkmann, Abhay Sheshadri, Victor Levoso, Paul Swoboda 等ACL Findings 2024 · 3 次引用
- Identifying Semantic Induction Heads to Understand In-Context LearningJie Ren, Qipeng Guo, Hang Yan, Dongrui Liu 等ACL Findings 2024 · 4 次引用
- A Phase Transition between Positional and Semantic Learning in a Solvable Model of Dot-Product AttentionHugo Cui, Freya Behrens, Florent Krzakala, Lenka ZdeborováNeurIPS 2024 · 35 次引用
- How Do Transformers Learn to Associate Tokens: Gradient Leading Terms Bring Mechanistic InterpretabilityShawn Im, Changdae Oh, Zhen Fang, Sharon LiICLR 2026 · 4 次引用
- A Meta-Learning Perspective on Transformers for Causal Language ModelingXinbo Wu, Lav R. VarshneyACL Findings 2024 · 3 次引用
