paper-with-me

홈 › Papers

How Do Transformers Learn Topic Structure: Towards a Mechanistic Understanding

2023-03-07 · Yuchen Li, Yuanzhi Li, Andrej Risteski

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.

📄 PDF Abstract BibTeX arXiv:2303.04245

Code (1)

yuchenli01/transformer_topic_model_lda 공식 구현 pytorch

Similar Papers 제목 키워드 기반

Compact Proofs of Model Performance via Mechanistic Interpretability

2024-06-17 · Jason Gross, Rajashree Agrawal, Thomas Kwa, Euan Ong 외

We propose using mechanistic interpretability -- techniques for reverse engineering model weights into human-interpretable algorithms -- to derive and compactly prove formal guarantees on model performance. We prototype …

model

Towards Mechanistic Interpretability of Graph Transformers via Attention Graphs

2025-02-17 · Batu El, Deepro Choudhury, Pietro Liò, Chaitanya K. Joshi

We introduce Attention Graphs, a new tool for mechanistic interpretability of Graph Neural Networks (GNNs) and Graph Transformers based on the mathematical equivalence between message passing in GNNs and the self-attenti…

Node Classification

Extracting Finite State Machines from Transformers

2024-10-08 · Rik Adriaensen, Jaron Maene

Fueled by the popularity of the transformer architecture in deep learning, several works have investigated what formal languages a transformer can learn. Nonetheless, existing results remain hard to compare and a fine-gr…

An explainable transformer circuit for compositional generalization

2025-02-19 · Cheng Tang, Brenden Lake, Mehrdad Jazayeri

Compositional generalization-the systematic combination of known components into novel structures-remains a core challenge in cognitive science and machine learning. Although transformer-based large language models can e…

Interpreting Transformers Through Attention Head Intervention

2026-01-07 · Mason Kadem, Rong Zheng arxiv

Neural networks are growing more capable on their own, but we do not understand their neural mechanisms. Understanding these mechanisms' decision-making processes, or mechanistic interpretability, enables (1) accountabil…