Abstract
We present Factorbird, a prototype of a parameter server approach for factorizing large matrices with Stochastic Gradient Descent-based algorithms. We designed Factorbird to meet the following desiderata: (a) scalability to tall and wide matrices with dozens of billions of non-zeros, (b) extensibility to different kinds of models and loss functions as long as they can be optimized using Stochastic Gradient Descent (SGD), and (c) adaptability to both batch and streaming scenarios. Factorbird uses a parameter server in order to scale to models that exceed the memory of an individual machine, and employs lock-free Hogwild!-style learning with a special partitioning scheme to drastically reduce conflicting updates. We also discuss other aspects of the design of our system such as how to efficiently grid search for hyperparameters at scale. We present experiments of Factorbird on a matrix built from a subset of Twitter's interaction graph, consisting of more than 38 billion non-zeros and about 200 million rows and columns, which is to the best of our knowledge the largest matrix on which factorization results have been reported in the literature.
Introduction
Modern recommender systems rely on matrix factorization to understand user preferences and item characteristics. However, as datasets grow to hundreds of millions of users and items, the resulting factor matrices become too large to fit into the memory of a single machine. Parallelizing this process using Stochastic Gradient Descent (SGD) introduces two major hurdles: memory and network bottlenecks, and concurrency issues. Specifically, when multiple machines attempt to update the same "popular" user or item vectors simultaneously, they create write conflicts that can degrade performance or lead to lost updates.
Methodology
Factorbird addresses these challenges through a specialized Parameter Server architecture designed to handle "Twitter-scale" matrices containing tens of billions of entries.
Hybrid Partitioning
Instead of distributing all parameters equally, Factorbird exploits the natural skew of social network graphs. In Twitter's graph, in-degree (followers) is significantly more skewed than out-degree (following). The system co-locates the most "active" factor matrix ($V$) directly on the learner machines alongside the input data ($M$). The other matrix ($U$) is stored on a dedicated cluster of parameter machines using Memcached. This intelligent partitioning reduces network traffic by approximately 50% and localizes the most frequent updates.
Hogwild! Execution and Hyperparameter Packing
To maximize speed, Factorbird uses a "lock-free" Hogwild! approach, allowing multiple threads to update parameters simultaneously without waiting for locks. While this technically allows for race conditions, the impact on accuracy for sparse matrices is negligible compared to the massive gain in throughput.
Furthermore, to find the best settings for learning rates ($\eta$) and regularization parameters ($\lambda$), the system "packs" multiple model variations into a single training run. By concatenating factor vectors, the system can test many combinations at once rather than running dozens of separate, expensive experiments.
Experimental Evaluation
The primary evaluation uses RealGraph, a massive dataset representing interactions between Twitter users. This dataset contains over 38 billion non-zeros and approximately 229 million rows by 195 million columns—roughly 385 times larger than the famous Netflix Prize dataset.
Key Results
- Unprecedented Scale: Factorbird successfully processed the 38-billion entry matrix. A single pass (epoch) through this data took approximately 2.5 hours using 50 learner machines.
- High Throughput: The system sustained over 4.2 million commands per second to the parameter server, updating roughly 400 million parameters every second.
- Qualitative Success: Visualizing the results showed that the system successfully learned social clusters. For example, European politicians, pop stars, and U.S. sports accounts were automatically grouped together in the latent factor space.
- Accuracy: Increasing model complexity consistently lowered the Root Mean Squared Error (RMSE) from a baseline of 0.3727 to 0.2477.
Conclusion and Future Work
Factorbird demonstrates that combining a parameter server architecture with skew-aware partitioning and lock-free execution enables matrix factorization at an unprecedented scale. While the current prototype successfully handles massive batch datasets, future work will focus on improving fault tolerance, addressing machine stragglers, and extending the system to real-time streaming scenarios where the model is updated as new interactions occur.
Summary updated