The incredible success of transformers on sequence modeling tasks can be largely attributed to the self-attention mechanism, which allows information to be transferred between different parts of a sequence. Self-attention allows transformers to encode causal structure which makes them particularly suitable for sequence modeling. However, the process by which transformers learn such causal structure via gradient-based training algorithms remains poorly understood. To better understand this process, we introduce an in-context learning task that requires learning latent causal structure. We prove that gradient descent on a simplified two-layer transformer learns to solve this task by encoding the latent causal graph in the first attention layer. The key insight of our proof is that the gradient of the attention matrix encodes the mutual information between tokens. As a consequence of the data processing inequality, the largest entries of this gradient correspond to edges in the latent causal graph. As a special case, when the sequences are generated from in-context Markov chains, we prove that transformers learn an induction head (Olsson et al., 2022). We confirm our theoretical findings by showing that transformers trained on our in-context learning task are able to recover a wide variety of causal structures.
Demystifying amortized causal discovery with transformers
Institute of Science and Technology Austria(奥地利科学与技术研究所);Chan Zuckerberg Initiative(查纳·泽克伯格倡议);Mila - Quebec AI Institute and Université de Montréal(蒙特利尔AI研究所和蒙特利尔大学)
CaTs and DAGs: Integrating Directed Acyclic Graphs with Transformers for Causally Constrained Predictions
Kivira Health(Kivira健康公司);The Sense Innovation and Research Center, CHUV, Lausanne, Switzerland(The Sense创新与研究中心,CHUV,洛桑,瑞士);Centre for Vision, Speech and Signal Processing, University of Surrey, U.K.(视觉、语音和信号处理中心,萨里大学,英国);Institute of Psychology, University of Lausanne, Switzerland(心理学研究所,洛桑大学,瑞士);EPFL, Switzerland(瑞士联邦理工学院)
Bypassing the Exponential Dependency: Looped Transformers Efficiently Learn In-context by Multi-step Gradient Descent
Middle Tennessee State University(中田纳西州立大学);University of New South Wales(新南威尔士大学);The University of Hong Kong(香港大学);University of Wisconsin-Madison(威斯康星大学麦迪逊分校);The Simons Institute for the Theory of Computing at the University of California, Berkeley(加州大学伯克利分校西蒙斯理论计算研究所)
On the Convergence of Gradient Descent on Learning Transformers with Residual Connections
Michigan Institute for Computational Discovery and Engineering, Department of Electrical Engineering and Computer Science, Department of Statistics, University of Michigan(密歇根大学计算发现与工程研究所、电气工程与计算机科学系、统计系);Department of Computer Science and Engineering, The Ohio State University(俄亥俄州立大学计算机科学与工程系)
Effects of Parameter Norm Growth During Transformer Training: Inductive Bias from Gradient Descent
Allen Institute for AI(艾伦人工智能研究所);New York University(纽约大学);University of Washington(华盛顿大学);Bar Ilan University(巴伊兰大学);Hebrew University of Jerusalem(希伯来大学)
TTCD:Transformer Integrated Temporal Causal Discovery from Non-Stationary Time Series Data
Department of Information Systems(信息系统系);University of Maryland, Baltimore County(马里兰大学巴尔的摩县分校);Department of Data Science(数据科学系);University of North Texas(北德克萨斯大学);Climate Science Section(气候科学组);Lawrence Livermore National Laboratory(劳伦斯利弗莫尔国家实验室)
MSCT: Addressing Time-Varying Confounding with Marginal Structural Causal Transformer for Counterfactual Post-Crash Traffic Prediction
School of Transportation, Southeast University(东南大学交通学院);Department of Civil and Environmental Engineering, Imperial College London(帝国理工学院土木与环境工程系);School of Mathematics, Southeast University(东南大学数学学院);School of Cyber Science and Engineering, Southeast University(东南大学网络空间科学与工程学院);Department of Civil and Environmental Engineering, University of Washington(华盛顿大学土木与环境工程系)
Learning Local Causal World Models with State Space Models and Attention
Institute for Cognitive Sciences and Technologies, National Research Council(认知科学与技术研究所,国家科研理事会);Sapienza University of Rome(罗马大学);University of Bologna(博洛尼亚大学)
Learning to Recall with Transformers Beyond Orthogonal Embeddings
University of Toronto and Vector Institute(多伦多大学和向量研究所);Flatiron Institute(Flatiron研究所);University of Southern California(南加州大学);New York University and Flatiron Institute(纽约大学和Flatiron研究所)