Efficient Second Order Online Learning by Sketching

Haipeng Luo, Alekh Agarwal, Nicolò Cesa-Bianchi, John Langford

Introduction

This paper introduces Sketched Online Newton (SON), an algorithm that brings the power of second-order optimization to large-scale online learning. By using matrix sketching techniques, SON achieves the robustness of Newton-style methods with a computational cost that scales linearly with data dimension. Crucially, it provides the first known sparse implementations for these sketches to handle high-dimensional, sparse features efficiently.

The Challenge with High-Dimensional Online Learning

In online learning, models process data one example at a time. Most practitioners rely on first-order methods (like SGD or AdaGrad) because they are fast—their per-step computational complexity is linear in the number of dimensions ($d$). However, these methods are highly sensitive to the "geometry" of the data. If the data is ill-conditioned (e.g., some features are on vastly different scales or are highly correlated), first-order methods converge slowly.

Second-order methods (like the Online Newton Step) solve this geometric sensitivity by using the covariance of the data to "whiten" the gradient, making the algorithm invariant to linear transformations. The catch? They typically require $O(d^2)$ time and space to maintain a covariance matrix. For a dataset with a million features, $d^2$ is a trillion—completely impractical. Furthermore, even if the input data is sparse, the second-order matrix quickly becomes dense, destroying any computational advantage.

The authors ask a fundamental question: Can we develop an (approximate) second-order online algorithm that is as efficient as first-order methods?

Methodology: Sketched Online Newton (SON)

The authors propose SON, which approximates the second-order information using a sketch—a compressed version of the data's covariance matrix that only keeps track of the $m$ most important directions (where $m \ll d$).

Key Innovations

  1. Sketching Integration: They adapt two sketching techniques for the online setting:
  2. Frequent Directions (FD): A deterministic method that effectively captures the dominant subspace of the data.
  3. Oja’s Algorithm: An online PCA approach that updates the sketch using a gradient-descent-like rule.
  4. Sparse Updates: This is a major technical contribution. Normally, sketching a sparse vector results in a dense matrix. The authors developed a clever "weight-splitting" technique. They maintain the weights in two parts: one for the subspace captured by the sketch and one for the remaining "orthogonal" space. This allows the algorithm to run in $O(ms)$ time, where $s$ is the number of non-zero features in the current example.
  5. Invariant Learning Setting: They analyze the algorithm under a "scale-invariant" framework, where the performance is measured against a benchmark that produces bounded predictions, rather than a benchmark with a bounded norm. This is a more natural fit for second-order methods.

Experiments and Key Results

The authors evaluated SON on a mix of synthetic and real-world data, including 23 benchmarks from the UCI and LIBSVM repositories. These ranged from high-dimensional/sparse datasets like 20news ($d \approx 102,000$, $s \approx 94$) to standard benchmarks like mnist and adult.

Invariance and Robustness

The synthetic experiments highlight that while AdaGrad's performance degrades as the data becomes more "skewed" (higher condition number), SON remains nearly unaffected. This confirms that sketching captures enough second-order information to provide the desired geometric robustness.

Error rate vs. condition number for AdaGrad and Oja-SON.

Subspace Identification

The Oja-based sketch was shown to identify the top eigenvalues of the data very quickly. As demonstrated in their experiments, the relative eigenvalue difference drops dramatically within the first 500 to 2000 examples.

Relative eigenvalue difference over time, showing rapid subspace identification.

Efficiency and Empirical Gains

  • The Best of Both Worlds: SON acts like the Online Newton Step for the "important" directions in the data (captured by the sketch) and like Gradient Descent for the rest.
  • Theoretical Optimality: The authors prove that SON achieves regret bounds nearly as good as the full Online Newton Step, despite the massive reduction in computation.
  • Real-World Performance: On real-world datasets, a version of SON with "diagonal adaptation" (a hybrid approach) outperformed AdaGrad on the majority of the 23 tested datasets.
  • Speed: For a sketch size of $m=10$, the algorithm was only about 11 times slower than the highly optimized AdaGrad, making it a highly practical choice for problems where first-order methods struggle.

Limitations and Future Work

  • The "Off-Sketch" Problem: For directions not captured in the $m$-sized sketch, the algorithm defaults to vanilla Gradient Descent. The authors found that adding a diagonal pre-conditioner (like AdaGrad) to these off-sketch directions was necessary for peak performance on real-world data.
  • Hyperparameter Tuning: The algorithm introduces a sketch size $m$ and a step size $\alpha$. While $m=10$ worked well in many cases, finding the optimal balance between sketch size and computation remains a task for the user.
  • Adversarial Oja Theory: While Oja's algorithm performed best empirically, its theoretical regret guarantees in a purely adversarial (non-stochastic) setting are less robust than those for the Frequent Directions sketch. Strengthening this theory is a potential future direction.

Summary updated

BibTeX
@inproceedings{luo2016efficient,
  author = {Haipeng Luo and Alekh Agarwal and Nicolò Cesa-Bianchi and John Langford},
  title = {{Efficient Second Order Online Learning by Sketching}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2016},
}
Figure