Large Scale Distributed Multiclass Logistic Regression

Pengtao Xie, Jin Kyu Kim, Eric P. Xing · DOI

Abstract

Multiclass logistic regression (MLR) is a fundamental machine learning model to do multiclass classification. However, it is very challenging to perform MLR on large scale data where the feature dimension is high, the number of classes is large and the number of data samples is numerous. In this paper, we build a distributed framework to support large scale multiclass logistic regression. Using stochastic gradient descent to optimize MLR, we find that the gradient matrix is computed as the outer product of two vectors. This grants us an opportunity to greatly reduce communication cost: instead of communicating the gradient matrix among machines, we can only communicate the two vectors and use them to reconstruct the gradient matrix after communication. We design a Sufficient Vector Broadcaster (SVB) to support this communication pattern. SVB synchronizes the parameter matrix of MLR by broadcasting the sufficient vectors among machines and migrates gradient matrix computation on the receiver side. SVB can reduce the communication cost from quadratic to linear without incurring any loss of correctness. We evaluate the system on the ImageNet dataset and demonstrate the efficiency and effectiveness of our distributed framework.

The Challenge of Scale in Matrix-Parameterized Models

In modern large-scale machine learning, we often use Matrix-Parameterized Models (MPMs). These include multiclass logistic regression (MLR), neural networks, and sparse coding, where the model parameters are stored in a large matrix $W$.

The challenge arises when these models scale: if you have 325,000 classes ($J$) and 10,000 features ($D$), your parameter matrix $W$ contains billions of entries, taking up tens of gigabytes. In a distributed setting, workers must synchronize these matrices. Standard "full-matrix" synchronization requires sending the entire $J \times D$ update across the network. Since typical cluster networks can only handle a few GBs per second, the network becomes a massive bottleneck, leaving powerful CPUs/GPUs idling while they wait for data.

Sufficient Factor Broadcasting (SFB)

To address this, we identify a specific property shared by many MPMs: the parameter update ($\Delta W$) computed from a data sample is often a rank-1 matrix. Specifically, $\Delta W = uv^T$, where $u$ and $v$ are "Sufficient Factors" (SFs).

Instead of broadcasting the massive $J \times D$ matrix, the Sufficient Factor Broadcasting (SFB) model works as follows:

  1. Local Computation: Each worker computes the vectors $u$ and $v$ from its local data.
  2. Broadcasting: Workers broadcast only these two vectors ($u$ and $v$) to all other workers.
  3. Local Reconstruction: Each worker receives the SFs and reconstructs the update matrix locally to update its own copy of $W$.
Figure 1: The SFB peer-to-peer communication model where workers exchange low-rank vectors (u, v) to synchronize the global parameter matrix.

This shifts the communication cost from $O(J \times D)$ to $O(J + D)$. The time taken for reconstruction is empirically negligible compared to the massive savings in network transit. Unlike traditional Parameter Server (client-server) architectures that eventually send full matrices back to clients, the SFB peer-to-peer topology ensures that full matrices are never sent over the wire.

Performance and Scalability

We evaluated SFB on massive real-world datasets, including ImageNet (1.2 million images, 1,000 categories) and Wikipedia (2.4 million documents, 325,000 categories). These tests covered Multiclass Logistic Regression (MLR), Distance Metric Learning (DML), and Sparse Coding (SC).

Figure 4: Runtime comparison between Spark, FMS, and SFB across different problem scales. SFB consistently outperforms existing frameworks.

Key results include:

  • Speedup: For parameter matrices with 5–10 billion entries, SFB improved convergence times by 3–4x compared to full-matrix synchronization.
  • Comparison to Spark: The SFB implementation of $L_2$-regularized MLR was approximately 9 times faster than the Apache Spark v1.3.1 implementation.
  • Throughput: SFB processed significantly more samples per second because workers spent less time waiting for the network.
  • Scalability: The system showed near-linear speedup as the number of machines in the cluster increased.

Conclusion and Future Work

SFB demonstrates that by exploiting the mathematical structure of model updates, we can achieve linear communication scaling for large-scale distributed learning. Future work will address memory constraints for models that exceed a single machine's RAM through matrix partitioning and explore low-rank approximations for updates that are not naturally rank-1, such as those generated in mini-batch training.

Summary updated

BibTeX
@misc{xie2014large,
  author = {Pengtao Xie and Jin Kyu Kim and Eric P. Xing},
  title = {{Large Scale Distributed Multiclass Logistic Regression}},
  year = {2014},
  eprint = {1409.5705},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1409.5705},
}
Figure