Dual coordinate descent methods for logistic regression and maximum entropy models

Hsiang-Fu Yu, Fang-Lan Huang, Chih-Jen LinMachine Learning 2011 · DOI

Abstract

While Support Vector Machines (SVMs) have long benefited from the efficiency of dual coordinate descent (CD) solvers, Logistic Regression (LR) and Maximum Entropy (ME) models have traditionally relied on primal solvers due to the complexity of their dual formulations. This paper presents a robust dual CD framework for LR and ME that overcomes numerical instabilities and the lack of closed-form solutions for sub-problems. By utilizing a modified Newton method and a numerically stable reformulation, the proposed approach significantly outperforms state-of-the-art primal solvers like LBFGS and TRON on high-dimensional datasets.

Introduction

In the domain of large-scale linear classification, training speed is a critical factor for practical application. Support Vector Machines (SVMs) are frequently the algorithm of choice because their dual optimization problem is particularly well-suited for coordinate descent methods. These methods, implemented in popular libraries like LIBLINEAR, optimize one variable at a time, allowing for rapid convergence on high-dimensional data.

In contrast, Logistic Regression (LR) and its multi-class generalization, Maximum Entropy (ME) models, have historically been solved in their primal form. The dual form of LR is significantly more complex than that of the SVM; while the SVM dual sub-problem is a simple quadratic with a closed-form solution, the LR dual involves transcendental (logarithmic) terms. This complexity introduces two primary challenges: the lack of a closed-form update and severe numerical instability when variables approach their boundaries. This paper addresses these hurdles to bring the efficiency of dual coordinate descent to LR and ME models.

The Complexity of the Dual Problem

The dual formulation of Logistic Regression presents a "messier" optimization landscape than the SVM. Specifically, the one-variable sub-problem in LR does not allow for a direct update. Instead, it requires an iterative solver—typically a Newton-type method—for every single variable update.

Furthermore, numerical instability arises from "catastrophic cancellation." As dual variables approach the boundaries of their feasible region (defined by the penalty parameter $C$), floating-point precision loss occurs. This results in the algorithm attempting to calculate logarithms of near-zero numbers, leading to divergence or inaccurate gradients.

Algorithmic Innovations

To address these challenges, the authors propose a tailored Dual Coordinate Descent framework characterized by three key innovations:

1. Modified Newton Sub-problem Solver

Since a closed-form solution is unavailable, the authors employ a modified Newton method to solve the one-variable sub-problem. Crucially, they prove that with a specific initialization, the Newton step always moves toward the optimum. This mathematical guarantee allows the algorithm to bypass expensive line searches, which are traditionally used to ensure convergence but are computationally prohibitive in a coordinate descent setting.

2. Numerical Robustness via Reformulation

To solve the issue of catastrophic cancellation, the sub-problem is reformulated to operate on the distance from the boundaries rather than the absolute values of the variables. This ensures that the arguments within the logarithmic functions remain numerically stable, even when weights are extremely small or large, maintaining precision throughout the optimization process.

3. Two-Level CD for Maximum Entropy

For multi-class Maximum Entropy models, the authors implement a hierarchical approach. An outer level selects a block of variables corresponding to all labels for a single data point, while an inner level applies the stabilized coordinate descent method to solve that specific block. This structure maintains the efficiency of CD while handling the increased dimensionality of multi-class problems.

Experimental Evaluation

The proposed method, CDdual, was evaluated against standard benchmarks including binary classification tasks (rcv1, yahoo-japan, real-sim) and NLP tasks (CoNLL2000, BROWN corpus).

Performance on High-Dimensional Data

The results demonstrate that CDdual is significantly faster than state-of-the-art primal solvers such as TRON (Trust Region Newton) and LBFGS on high-dimensional datasets. The dual approach is particularly efficient because it allows the algorithm to maintain and incrementally update a weight vector $w$, reducing the per-iteration computational cost.

NLP and Maximum Entropy

In the context of Maximum Entropy models for NLP, CDdual reached target testing accuracy faster than competing methods. This makes it an ideal candidate for practitioners working with 0/1 featured data where quick model iteration is essential.

Conclusion

This work demonstrates that with proper numerical stabilization and a specialized sub-problem solver, dual coordinate descent is not only viable for Logistic Regression and Maximum Entropy models but often superior to primal methods. While primal solvers remain more efficient when the number of instances greatly exceeds the number of features, the dual CD framework provides a powerful tool for the high-dimensional sparse data common in modern machine learning and natural language processing.

Summary updated

Abstract

Most optimization methods for logistic regression or maximum entropy solve the primal problem. They range from iterative scaling, coordinate descent, quasi-Newton, and truncated Newton. Less efforts have been made to solve the dual problem. In contrast, for linear support vector machines (SVM), methods have been shown to be very effective for solving the dual problem. In this paper, we apply coordinate descent methods to solve the dual form of logistic regression and maximum entropy. Interestingly, many details are different from the situation in linear SVM. We carefully study the theoretical convergence as well as numerical issues. The proposed method is shown to be faster than most state of the art methods for training logistic regression and maximum entropy.
BibTeX
@article{yu2011dual,
  author = {Hsiang-Fu Yu and Fang-Lan Huang and Chih-Jen Lin},
  title = {{Dual coordinate descent methods for logistic regression and maximum entropy models}},
  journal = {Machine Learning},
  year = {2011},
  doi = {10.1007/s10994-010-5221-8},
}

Loading related content...

Figure