Transformers Handle Endogeneity in In-Context Linear Regression
Not on the map. Why?
Abstract (arXiv)
We explore the capability of transformers to address endogeneity in in-context linear regression. Our main finding is that transformers inherently possess a mechanism to handle endogeneity effectively using instrumental variables (IV). First, we demonstrate that the transformer architecture can emulate a gradient-based bi-level optimization procedure that converges to the widely used two-stage least squares (textsf2SLS) solution at an exponential rate. Next, we propose an in-context pretraining scheme and provide theoretical guarantees showing that the global minimizer of the pre-training loss achieves a small excess loss. Our extensive experiments validate these theoretical findings, showing that the trained transformer provides more robust and reliable in-context predictions and coefficient estimates than the textsf2SLS method, in the presence of endogeneity.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). Builds on 32 of its 49 references that are in the map. First posted on arXiv 2 Oct 2024.
Builds on
32 of 49 references.
References · 32
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2020End-to-End Object Detection with Transformerscited by 7,384
- 2022Transformers learn in-context by gradient descentcited by 714
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2015An Introduction to Matrix Concentration Inequalitiescited by 391
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 291
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
20 more
- 2019Stabilizing Transformers for Reinforcement Learningcited by 262
- 2023Looped Transformers as Programmable Computerscited by 224
- 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 220
- 2022Multi-Game Decision Transformerscited by 212
- 2023Looped Transformers are Better at Learning Learning Algorithmscited by 135
- 2019Kernel Instrumental Variable Regressioncited by 118
- 2024The Evolution of Statistical Induction Heads: In-Context Learning Markov Chainscited by 115
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2023In-Context Convergence of Transformerscited by 112
- 2023Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Contextcited by 63
- 2024Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspectivecited by 51
- 2024In-Context Learning of a Linear Transformer Block: Benefits of the MLP Component and One-Step GD Initializationcited by 30
- 2024Transformers on Markov Data: Constant Depth Sufficescited by 26
- 2024How Well Can Transformers Emulate In-context Newton's Method?cited by 23
- 2023Can a Transformer Represent a Kalman Filter?cited by 20
- 2024Local to Global: Learning Dynamics and Effect of Initialization for Transformerscited by 11
- 2023Stochastic Online Instrumental Variable Regression: Regrets for Endogeneity and Bandit Feedbackcited by 7
- 2024Nonparametric Instrumental Variable Regression through Stochastic Approximate Gradientscited by 6
- 2024Meta-Learning with Generalized Ridge Regression: High-dimensional Asymptotics, Optimality and Hyper-covariance Estimationcited by 5
- 2024Stochastic Optimization Algorithms for Instrumental Variable Regression with Streaming Datacited by 4
Built on by
Citing papers per year: 2025: 4; 2026: 4.
8 papers.
- 2025CausalPFN: Amortized Causal Effect Estimation via In-Context Learningcited by 43
- 2026Transformers Provably Implement In-Context Reinforcement Learning with Policy Improvementcited by 1
- 2025How Private is Your Attention? Bridging Privacy with In-Context Learningcited by 0
- 2025Interpretability and Generalization Bounds for Learning Spatial Physicscited by 0
- 2025Differentially Private Two-Stage Gradient Descent for Instrumental Variable Regressioncited by 0
- 2026Reconciling In-Context and In-Weight Learning via Dual Representation Space Encodingcited by 0
- 2026Evidence-Type Competition: When Can Interventional Data Teach Language Models Causal Direction?cited by 0
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learningcited by 0
- 2026Theory on Attention Dynamics for Out-of-Distribution In-Context Learning29 Sep 2026
- 2026Evidence-Type Competition: When Can Interventional Data Teach Language Models Causal Direction?31 Jul 2026
- 2026Transformers Provably Implement In-Context Reinforcement Learning with Policy Improvement7 May 2026
- 2026Reconciling In-Context and In-Weight Learning via Dual Representation Space Encoding13 Mar 2026
- 2025Differentially Private Two-Stage Gradient Descent for Instrumental Variable Regression26 Sep 2025
- 2025Interpretability and Generalization Bounds for Learning Spatial Physics18 Jun 2025
- 2025CausalPFN: Amortized Causal Effect Estimation via In-Context Learning9 Jun 2025
- 2025How Private is Your Attention? Bridging Privacy with In-Context Learning22 Apr 2025