Learning from A Single Markovian Trajectory: Optimality and Variance Reduction

Zhenyu Sun, Ermin WeiNeurIPS 2025

Introduction

Most machine learning theory relies heavily on the "i.i.d. assumption"—the premise that every data point is independent and identically distributed. However, in many real-world applications such as reinforcement learning, financial market sensor processing, or streaming user feedback, data points are temporally correlated. One state depends on the previous one, effectively following a Markov chain.

This paper tackles the challenge of stochastic non-convex optimization when data arrives as a single, continuous stream from a Markov chain rather than as independent samples. As a purely theoretical work, it establishes fundamental lower bounds for this setting and introduces MaC-SPIDER (Markov-Chain SPIDER), the first variance-reduced algorithm to achieve a near-optimal sample complexity of $\mathcal{O}(\epsilon^{-3})$ using only one trajectory.

The Challenge: Moving Beyond i.i.d. Data

While researchers have studied Markovian sampling before, many previous works assumed a "simulator" setting where the Markov chain could be restarted at will to gather multiple independent trajectories. This paper investigates the much harder, yet more realistic, "worst-case" scenario: you have exactly one trajectory.

Without the ability to hit a reset button, significant bias and correlation are introduced into gradient estimates, breaking standard optimization proofs. The core question this paper addresses is: What is the fundamental limit of learning in this single-trajectory setting, and can an algorithm be designed to reach it?

Establishing Theoretical Limits

To find the "speed limit" of any possible algorithm, the authors construct a "hard" objective function and a specific Markov chain to establish algorithm-independent lower bounds. They employ a "progress function" technique, where an algorithm must navigate a high-dimensional space coordinate-by-coordinate. The Markovian noise makes it difficult to "see" the next coordinate until enough time has passed for the chain to mix.

The results show that for any first-order, zero-respecting algorithm:

  • Smooth functions: Require at least $\Omega(\epsilon^{-4})$ samples.
  • Mean-squared smooth functions: Require at least $\Omega(\epsilon^{-3})$ samples.

MaC-SPIDER: Variance Reduction on a Single Trajectory

To match these theoretical limits, the authors propose MaC-SPIDER, adapting the popular SPIDER (Stochastic Path-Integrated Differential Estimator) algorithm for the Markovian setting. SPIDER is highly efficient in i.i.d. settings because it utilizes variance reduction—periodically calculating a high-precision gradient and then using cheap, incremental updates.

The core challenge in MaC-SPIDER is controlling the bias introduced by the Markov chain. Unlike i.i.d. samples, a single Markovian sample is a biased estimate of the true gradient. The authors provide a novel analysis of how this bias propagates through variance-reduction loops. By carefully choosing batch sizes and the update frequency, they demonstrate that the error can be kept strictly under control.

Ultimately, MaC-SPIDER achieves an upper bound complexity of $\mathcal{O}(\tau_{mix} \pi_{min}^{-1/2} \epsilon^{-3})$. Because the upper and lower bounds both scale with $\epsilon^{-3}$, MaC-SPIDER is proven to be (near) min-max optimal. Its complexity depends linearly on the mixing time ($\tau_{mix}$), which quantifies how quickly the Markov chain "forgets" its initial state.

Key Insights

  • The $\epsilon^{-3}$ Barrier is Reachable: In the i.i.d. world, the best possible complexity for mean-squared smooth non-convex problems is $\mathcal{O}(\epsilon^{-3})$. This paper proves that even with the added difficulty of Markovian correlation and bias, algorithms can still hit that same fundamental limit.
  • No Restarts Necessary: A major takeaway is that multiple trajectories are not required to achieve optimal rates. A single, long trajectory contains enough information, provided the algorithm is designed to handle the dependencies correctly.
  • Managing Bias vs. Variance: In standard Stochastic Gradient Descent (SGD), the primary concern is variance. In Markovian SGD, algorithms must manage the joint effects of bias and temporal correlation. Variance reduction techniques prove robust enough to handle this bias if the algorithm allows the Markov chain enough time to "mix" (approach its stationary distribution).
  • The Cost of Smoothness: The paper highlights a complexity gap based on function assumptions. If the function is merely "smooth," the limit is $\Omega(\epsilon^{-4})$. However, if it is "mean-squared smooth" (a common assumption in variance reduction), the limit improves significantly to $\Omega(\epsilon^{-3})$.

Limitations and Future Directions

While this paper establishes strong theoretical foundations, several avenues remain open for future research:

  • Finite State Spaces: The current analysis primarily focuses on finite-state Markov chains. Extending these proofs to continuous or infinite state spaces is a logical next step for broader applicability.
  • Stationarity Assumption: The paper assumes the Markov chain is stationary. In many dynamic environments (such as non-stationary reinforcement learning), the underlying distribution changes over time. Adapting MaC-SPIDER to non-stationary trajectories remains an open challenge.
  • The $\pi_{min}$ Gap: There is a small gap between the lower bound and the upper bound involving the minimum stationary probability ($\pi_{min}$). Future work could investigate whether this factor is a fundamental mathematical requirement or simply an artifact of the current analysis techniques.

Summary updated

BibTeX
@inproceedings{sun2025learning,
  author = {Zhenyu Sun and Ermin Wei},
  title = {{Learning from A Single Markovian Trajectory: Optimality and Variance Reduction}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=2oRz0NNOQQ},
}
Figure