Preconditioned Conjugate Gradient Methods in Truncated Newton Frameworks for Large-scale Linear Classification

Chih-Yang Hsia, Wei-Lin Chiang, Chih-Jen LinACML 2018

Abstract

Truncated Newton methods are among the most effective optimization techniques for large-scale linear classification. The primary computational bottleneck in each Newton iteration is solving a quadratic sub-problem using an iterative procedure, typically the Conjugate Gradient (CG) method. However, CG convergence can be significantly hindered by ill-conditioned sub-problems. While Preconditioned Conjugate Gradient (PCG) methods are designed to address this, finding a robust preconditioner for linear classification is challenging, especially given the constraints of Hessian-free optimization. This paper investigates the inconsistencies of existing preconditioners and proposes a "Mixed" preconditioning strategy and parallel execution frameworks to ensure robustness. Theoretical and experimental results demonstrate that these methods effectively reduce training time for large-scale problems without the risk of performance degradation.

Introduction

In the realm of large-scale machine learning, training models like Logistic Regression or Linear Support Vector Machines (SVMs) requires efficient optimization. Truncated Newton methods have emerged as a gold standard because they utilize second-order information to achieve fast convergence. These methods work by iteratively approximating the objective function with a quadratic model and solving for the update step.

To handle datasets with millions of features and instances, researchers employ "Hessian-free" techniques. Instead of storing the massive Hessian matrix, they use the Conjugate Gradient (CG) algorithm, which only requires matrix-vector products. However, the efficiency of CG is tied to the "condition number" of the system. If the data landscape is ill-conditioned—characterized by narrow, steep valleys—CG requires many iterations to converge, stalling the training process.

The Challenge of Preconditioning

Preconditioning is the standard mathematical remedy for ill-conditioning. By applying a transformation matrix (a preconditioner), one can warp the optimization landscape to be more spherical, allowing CG to converge faster.

Despite its theoretical appeal, preconditioning in linear classification is a double-edged sword. The authors identify two major issues:

  1. Computational Overhead: Some preconditioners, like the Subsampled Hessian (SH), are expensive to compute. The time spent building the preconditioner can outweigh the time saved during the CG iterations.
  2. Performance Instability: In many cases, a standard preconditioner (like a diagonal matrix) can actually increase the condition number of the sub-problem, making the solver slower than basic CG. For instance, on datasets like news20 and url, standard diagonal preconditioning can increase training time by over 60%.

Proposed Robust Strategies

To make PCG a reliable tool for practitioners, the paper introduces two primary strategies:

1. The "Mixed" Preconditioner

The core contribution is a new preconditioner $\bar{M}$ defined as a weighted average of a standard preconditioner $M$ and the identity matrix $I$: $$\bar{M} = \alpha M + (1 - \alpha)I$$ By setting $\alpha$ to a small value (e.g., $10^{-2}$), the identity matrix acts as a safety net. If $M$ is beneficial, the mix retains its advantages; if $M$ is poorly suited to the current iteration, the identity component prevents the condition number from exploding. Theorem 1 in the paper provides the mathematical proof that this "diluted" approach ensures the condition number of the preconditioned system remains manageable.

2. Parallel Execution

In modern multi-core environments, the authors suggest running standard CG and PCG in parallel. The Newton iteration proceeds as soon as either solver meets the stopping criteria. This "competitive" approach guarantees that the optimization process is never slower than the baseline CG, effectively neutralizing the risk of a "bad" preconditioner.

Experimental Evaluation

The methods were evaluated on several massive binary classification datasets, including kdd12 (149 million instances) and criteo (45 million instances).

Key Findings:

  • Consistency: The Mixed Preconditioner consistently matched or outperformed standard CG. It successfully avoided the massive performance hits that the pure Diagonal preconditioner suffered on the news20 dataset.
  • Wall-Clock Efficiency: While complex methods like the Subsampled Hessian (SH-3000) could reduce the number of CG steps, they were often significantly slower in actual time. For example, on news20, SH-3000 was 44 times slower than basic CG due to the overhead of constructing the preconditioner.
  • Reliability: The study emphasizes that in a sequence of Newton iterations, one "bad" step can derail the entire process. The Mixed strategy provides the reliability needed for production-grade solvers.

Conclusion

This work highlights that for large-scale linear classification, robustness is as important as peak speed. By mixing standard preconditioners with the identity matrix, the authors created a solver that is both fast and stable. These improvements have been integrated into LIBLINEAR (v2.20+), making these robust optimization techniques available for widespread use in the machine learning community. Future research may extend these "safe" preconditioning concepts to non-linear models and deep learning frameworks.

Summary updated

BibTeX
@inproceedings{hsia2018preconditioned,
  author = {Chih-Yang Hsia and Wei-Lin Chiang and Chih-Jen Lin},
  title = {{Preconditioned Conjugate Gradient Methods in Truncated Newton Frameworks for Large-scale Linear Classification}},
  booktitle = {ACML},
  year = {2018},
  url = {https://openreview.net/forum?id=wqrBqX4gZA},
}
Figure