Stochastic Optimization Algorithms for Instrumental Variable Regression with Streaming Data

Xuxing Chen, Abhishek Roy, Yifan Hu, Krishna Balasubramanian

TL;DR

This paper introduces two novel streaming algorithms for Instrumental Variable Regression (IVaR) that operate without the need for computationally expensive matrix inversions or large mini-batches. By reframing IVaR as a conditional stochastic optimization problem, the authors achieve fast convergence rates—up to $\mathcal{O}(\log T/T)$—providing a robust, fully online solution for causal inference on massive, real-time data streams.

The Challenge of Endogeneity in Streaming Data

In fields like econometrics and healthcare, researchers often want to find the causal effect of a variable $X$ on an outcome $Y$. However, "confounders" (unobserved factors) often influence both, making simple regression misleading—a problem known as endogeneity.

Instrumental Variable (IV) analysis solves this by using an "instrument" $Z$ that affects $X$ but has no direct link to the noise in $Y$. Traditionally, this is solved via Two-Stage Least Squares (2SLS): first, you regress $X$ on $Z$, then you use the predicted $X$ to regress $Y$.

While effective, 2SLS has major drawbacks for modern data:

  1. Computational Cost: It requires matrix inversions, which are slow for high-dimensional data.
  2. Offline Nature: It typically requires the entire dataset to be available at once.
  3. The "Forbidden Regression" Trap: Errors in the first stage can propagate and bias the second stage.

This paper seeks to move IV analysis into the "streaming" era, where data arrives one point at a time and must be processed efficiently without storing the whole history.

Methods: Conditional Stochastic Optimization

The authors' key innovation is viewing IVaR through the lens of conditional stochastic optimization. Instead of the traditional two-step estimation, they minimize a loss function that involves nested expectations. They propose two main algorithms:

  1. TOSG-IVaR (Two-Sample One-stage Stochastic Gradient): This algorithm assumes access to a "two-sample oracle"—meaning for every instrument $Z$, we can get two independent samples of $X$. This allows the algorithm to construct an unbiased gradient estimate. Crucially, it bypasses the need to model the relationship between $Z$ and $X$ entirely, avoiding the "forbidden regression" problem.
  2. OTSG-IVaR (One-Sample Two-stage Stochastic Gradient): Recognizing that two samples aren't always available, this version uses standard streaming data. It maintains two simultaneous updates: one for the relationship between $Z$ and $X$, and another for the causal parameter $\theta$.
Pseudocode for the One-Sample Two-stage Stochastic Gradient-IVaR (OTSG-IVaR) algorithm.

Unlike previous "minimax" approaches that turn the problem into a complex game between two models, these algorithms solve the optimization problem directly using stochastic gradient descent (SGD) variants.

Key Insights and Ideas

  • Direct Optimization vs. Minimax: Recent trends in IV research favored reformulating the problem as a minimax (saddle-point) problem. This paper argues that those methods are unnecessarily "cumbersome" and introduce implicit approximation errors. Direct stochastic optimization is cleaner and more efficient.
  • The Power of Two Samples: If you can get two samples of $X$ for one $Z$, you can skip the "first stage" of IV regression entirely. This is a massive win for robustness, as you no longer need to worry if your model for $X|Z$ is perfectly specified.
  • No Mini-batches Required: Most algorithms for "nested" expectations require processing data in batches to reduce bias. The authors prove that for the specific quadratic structure of IV regression, you can achieve optimal convergence using just a single sample per iteration.

Empirical and Theoretical Results

The authors validated their approach using both synthetic simulations and classic real-world datasets, including the Children and Their Parents’ Labor Supply dataset and the U.S. Portland Cement Industry dataset.

  • Theoretical Convergence: For linear models, the authors prove that TOSG-IVaR converges at a rate of $\mathcal{O}(\log T / T)$, which is exceptionally fast for a stochastic algorithm. The one-sample version (OTSG-IVaR) achieves $\mathcal{O}(1/T^{1-\epsilon})$.
  • Stability and Efficiency: In experiments, the proposed algorithms showed much lower variance and better stability compared to existing online 2SLS (O2SLS) methods. They also boast significantly lower memory and per-iteration computational costs than competing streaming IV methods, making them truly "lightweight."
Convergence comparison showing OTSG-IVaR's stability over time compared to standard Conditional Stochastic Optimization (CSO).

Limitations and Future Work

  • Linearity in Proofs: While the algorithms can be applied to non-linear models (like neural networks), the strongest theoretical convergence guarantees in this paper are for the linear case.
  • Initial Divergence: As seen in some convergence plots, the one-sample algorithm (OTSG-IVaR) can sometimes diverge in the very early stages of training before settling into a stable convergence path. The authors suggest "warm-starting" or careful step-size selection to mitigate this.
  • Inference: The current work focuses on estimation (finding the right number). A natural next step is developing inferential methods—calculating confidence intervals and p-values in a streaming fashion.

Summary updated

BibTeX
@inproceedings{chen2024stochastic,
  author = {Xuxing Chen and Abhishek Roy and Yifan Hu and Krishna Balasubramanian},
  title = {{Stochastic Optimization Algorithms for Instrumental Variable Regression with Streaming Data}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=2RS0fL7Eet},
}
Figure