Abstract
This paper investigates the theoretical and practical limits of performing Streaming Principal Component Analysis (PCA) under limited numerical precision. By integrating a batched version of Oja’s algorithm with stochastic logarithmic quantization, the authors demonstrate that it is possible to achieve nearly dimension-free accuracy that matches information-theoretic lower bounds. Empirical results show that 16-bit systems can achieve significant speedups over 64-bit counterparts while maintaining high accuracy, and 8-bit systems can rival full-precision performance on standard datasets like MNIST and Human Activity Recognition (HAR).
Introduction
As machine learning models grow to gargantuan sizes, the hardware cost of moving and processing 32-bit or 64-bit floats becomes a significant bottleneck. Researchers are increasingly turning to low-precision arithmetic (16-bit, 8-bit, or even binary) to save memory and power. However, Principal Component Analysis (PCA)—a cornerstone of dimensionality reduction—presents a challenge in a "streaming" setting where data arrives sequentially.
Standard implementations of Oja’s algorithm, the workhorse for streaming PCA, often fail under low precision. If the update to the eigenvector is smaller than the smallest representable number (the "quantum"), it is rounded to zero, causing the algorithm to stall. This research addresses how many bits are required to find the top principal component accurately and identifies the optimal quantization strategies to overcome these numerical limitations.
Methods
The authors analyze Oja’s algorithm under two primary quantization schemes:
- Linear Quantization (LQ): Values are spaced uniformly.
- Logarithmic Quantization (NLQ): Values are spaced exponentially, providing finer resolution near zero, similar to floating-point representations.
To mitigate the "stalling" problem, the authors employ Stochastic Rounding, where values are rounded up or down randomly such that the expected value remains unbiased. Furthermore, they introduce a Batched Version of Oja’s Algorithm. Instead of updating the eigenvector for every data point, gradients are averaged over a batch before a single quantized update is performed. This reduces cumulative noise and allows the algorithm to capture small signals that would otherwise be lost to rounding.
Theoretical Insights
- Dimension-Free Accuracy: A key finding is that under Linear Quantization, error scales linearly with the dimension ($d$). However, with Logarithmic Quantization, the error is nearly dimension-free, making NLQ far superior for high-dimensional machine learning tasks.
- Necessity of Batching: The authors prove that batching is a theoretical requirement to reach information-theoretic lower bounds for accuracy in quantized settings, effectively filtering quantization noise.
- Optimality: The proposed batched method matches the mathematical lower bound for accuracy given a specific bit budget, up to logarithmic factors.
Experimental Results
The theory was validated using synthetic streams ($d$ up to 500), the Human Activity Recognition (HAR) dataset ($n=7,352, d=561$), and MNIST ($n=60,000, d=784$). On MNIST and HAR, the batched NLQ method achieved performance comparable to full-precision Oja’s using only 6 to 8 bits.
As shown in the table above, 16-bit computation was approximately 70 times faster than 64-bit computation (0.000398s vs 0.0274s) with negligible loss in accuracy. While standard quantized Oja’s accumulated error over time, the batched version remained stable and accurate across large sample sizes.
Conclusion and Future Work
This work establishes a robust framework for low-precision streaming PCA, showing that 8-bit systems can rival full-precision performance. However, several avenues for future research remain. The current analysis focuses on the leading eigenvector; extending this to the top-$k$ eigenvectors via deflation-based approaches requires further formal proof. Additionally, while simulations are promising, real-world performance will depend on hardware-level support for stochastic rounding and logarithmic arithmetic.
Summary updated