Transformer visualization via dictionary learning: contextualized embedding as a linear superposition of transformer factors
Yun, Zeyu, Chen, Yubei, Olshausen, Bruno A, LeCun, Yann
–arXiv.org Artificial Intelligence
Transformer networks have revolutionized NLP representation learning since they were introduced. Though a great effort has been made to explain the representation in transformers, it is widely recognized that our understanding is not sufficient. One important reason is that there lack enough visualization tools for detailed analysis. In this paper, we propose to use dictionary learning to open up these "black boxes" as linear superpositions of transformer factors. Through visualization, we demonstrate the hierarchical semantic structures captured by the transformer factors, e.g., word-level polysemy disambiguation, sentence-level pattern formation, and long-range dependency. While some of these patterns confirm the conventional prior linguistic knowledge, the rest are relatively unexpected, which may provide new insights. We hope this visualization tool can bring further knowledge and a better understanding of how transformer networks work. The code is available at https://github.com/zeyuyun1/TransformerVis
arXiv.org Artificial Intelligence
Apr-4-2023
- Country:
- Africa (1.00)
- Asia (0.67)
- Europe > United Kingdom (0.67)
- North America > United States
- New York (0.93)
- Oceania > Australia (0.68)
- Genre:
- Personal > Obituary (0.92)
- Research Report > New Finding (0.67)
- Industry:
- Education (0.92)
- Government
- Health & Medicine > Therapeutic Area
- Law > Government & the Courts (0.92)
- Law Enforcement & Public Safety (1.00)
- Leisure & Entertainment > Sports
- Media
- Film (0.93)
- Music (1.00)
- Television (0.92)
- Transportation
- Air (1.00)
- Ground (1.00)
- Infrastructure & Services (0.92)
- Passenger (0.93)
- Technology: