A Stochastic PCA Algorithm with an Exponential Convergence Rate

Ohad Shamir

Introduction

Principal Component Analysis (PCA) is a fundamental tool in data science, essential for dimensionality reduction and feature extraction. However, as datasets scale to millions of samples ($n$) and thousands of dimensions ($d$), practitioners face a trade-off between computational efficiency and convergence speed. Traditional batch methods, such as Power Iteration, offer exponential convergence but require a full pass over the dataset at every step. Conversely, stochastic methods like Oja’s algorithm are computationally "cheap" per iteration but suffer from high variance, leading to slow $O(1/\epsilon)$ convergence and difficulty in reaching high-precision solutions.

This paper introduces VR-PCA, a variance-reduced stochastic algorithm that achieves the "best of both worlds": the low per-iteration cost of stochastic methods and the fast, exponential convergence rate of batch methods.

The VR-PCA Algorithm

The core innovation of VR-PCA is the adaptation of Stochastic Variance Reduced Gradient (SVRG) to the non-convex landscape of PCA. The algorithm operates in epochs to systematically reduce the variance of stochastic updates.

Algorithm 1: The VR-PCA procedure, utilizing periodic full-gradient anchors to reduce variance in stochastic updates.

At the start of each epoch, the algorithm computes a "full" average vector $\tilde{u}$ using the entire dataset. This vector serves as a stable anchor. During the epoch, cheap stochastic updates are performed. Crucially, the anchor is used to "correct" the direction of the current stochastic update, effectively shrinking the noise variance as the algorithm approaches the optimal solution. After each update, the vector is projected back onto the unit sphere to maintain a valid solution. The paper also notes a clever implementation trick for sparse data, ensuring runtime per iteration remains proportional to non-zero entries.

Experimental Evaluation

The performance of VR-PCA was evaluated on three distinct types of data: synthetic datasets with controlled eigengaps ($\lambda$), the MNIST handwritten digit dataset, and the large-scale sparse CCAT (Reuters RCV1) text dataset.

Key Results

The experimental results demonstrate that VR-PCA consistently outperforms both Power Iteration and various tuned versions of Oja’s algorithm.

Convergence comparison of VR-PCA against Power Iterations and Oja's algorithm across various eigengaps ($\lambda$).

As shown in the log-error plots, VR-PCA’s error drops linearly (exponential convergence), appearing as a straight line. In contrast, Oja’s algorithm often plateaus or descends much more slowly. VR-PCA can reach high-precision solutions (e.g., $10^{-10}$ error) in just a few dozen passes over the data. Additionally, the author found that a hybrid approach—starting with Oja's algorithm and switching to VR-PCA—can further optimize performance on real-world data like MNIST.

Theoretical Insights

A significant theoretical contribution is the proof that variance reduction works for the non-convex PCA problem. While SVRG was designed for convex optimization, the author shows that the geometry of PCA allows for similar exponential convergence.

Furthermore, VR-PCA improves the computational complexity. Traditional iterative methods have a runtime proportional to $n \times (1/\lambda)$. VR-PCA changes this to an additive complexity of $n + (1/\lambda^2)$. This means that for large datasets, the algorithm's performance is less sensitive to the dataset size $n$ compared to batch methods, even when the eigengap $\lambda$ is small. Interestingly, despite theoretical requirements for initialization, experiments showed no visible "burn-in" delay even with random starting vectors.

Conclusion and Future Work

VR-PCA provides a robust, high-precision alternative for large-scale PCA. While it performs exceptionally well in practice, future work may explore formal "burn-in" phase analysis and potential improvements to the $1/\lambda^2$ dependency. Extending the formal analysis to the multi-eigenvector ($k > 1$) case also remains an open area for research.

Summary updated

BibTeX
@inproceedings{shamir2015stochastic,
  author = {Ohad Shamir},
  title = {{A Stochastic PCA Algorithm with an Exponential Convergence Rate}},
  booktitle = {International Conference on Machine Learning},
  year = {2015},
  url = {https://openreview.net/forum?id=S1N6P3WuWS},
}
Figure