RaFM: Rank-Aware Factorization Machines

Xiaoshuang Chen, Yin Zheng, Jiaxing Wang, Wenye Ma, Junzhou Huang

TL;DR

Standard Factorization Machines (FMs) use a "one-size-fits-all" approach by assigning the same embedding rank to every feature, regardless of how often it appears. RaFM (Rank-Aware Factorization Machines) breaks this mold by allocating variable ranks based on feature frequency, significantly reducing overfitting for rare features and underfitting for common ones. The result is a model that is more accurate, smaller in memory, and often faster to train than traditional FMs.

The "Goldilocks" Problem in Factorization Machines

Factorization Machines are a staple in recommendation systems and click-through rate (CTR) prediction because they excel at modeling interactions between sparse features. However, real-world datasets follow a long-tail or power-law distribution: a handful of features appear millions of times, while the vast majority appear only once or twice.

Feature occurrence distribution showing a power-law curve

Existing FM models typically assign a fixed rank (e.g., a vector of size 128) to every single feature. This creates a dilemma:

  1. Overfitting: Rare features don't have enough data to "fill" a high-dimensional vector, leading the model to memorize noise.
  2. Underfitting: Frequent features are too complex to be captured by a low-dimensional vector, leaving performance on the table.

While some researchers have tried using multiple ranks before, previous attempts either sacrificed accuracy through crude truncation or became computationally bloated.

Introducing Rank-Aware Factorization Machines (RaFM)

The authors introduce RaFM, which assigns an embedding rank $D_{k_i}$ to each feature $i$ based on its frequency.

Comparison of fixed-rank FMs vs. RaFM

Key technical components include:

  • Rank-Aware Interaction: When two features $i$ and $j$ interact, the model uses a rank $k_{ij} = \min(k_i, k_j)$. This ensures that the interaction is only as complex as the "weakest" (least frequent) feature can support.
  • Nested Embeddings: Instead of treating different ranks as independent, RaFM views lower-rank embeddings as "projections" of higher-rank ones. This allows the model to maintain a concise set of parameters.
  • Efficient Training: The authors propose a bi-level optimization strategy. They mathematically prove that the gradient direction for their complex objective is parallel to a much simpler gradient calculation. This allows them to use a modified Stochastic Gradient Descent (SGD) that only updates "active" factors, keeping the computational burden low.

Datasets and Evaluation

The researchers evaluated RaFM on a wide variety of benchmarks:

  • Regression: MovieLens 10M, MovieLens 20M, and Amazon Movie (AMovie).
  • Classification: Frappe, MovieLens Tag (ML Tag), Avazu, and Criteo.
  • Industrial Scale: A massive news CTR dataset provided by Tencent, containing 1.7 billion records and 120 million features.

Key Insights and Results

  • The Frequency-Rank Heuristic: The authors found that setting the rank $k_i$ such that $D_{k_i}$ is closest to the log-frequency of the feature ($\log n_i$) works remarkably well, removing the need for exhaustive grid searches for every feature's rank.
  • Computational Efficiency: A major breakthrough is the proof that RaFM can be stored and trained as efficiently as—or even more efficiently than—a single fixed-rank FM. By identifying and ignoring "inactive factors" (dimensions that will never be used in an interaction), they drastically prune the model's footprint.
  • Better Accuracy & Smaller Models: RaFM consistently outperformed standard FMs and other multi-rank baselines. On the Tencent industrial dataset, RaFM achieved a higher AUC than a standard FM while using only 22% of the parameters.
  • Faster Training: Because RaFM ignores inactive factors, it is often much faster. In some tests, RaFM reached better performance in just 17% to 43% of the training time required by a standard FM.

Limitations and Future Work

  • Hyperparameter Sensitivity: While the log-frequency heuristic for choosing ranks works well, it is still a heuristic. Using boosting or automated architecture search methods to pick ranks could yield even better results.
  • Deep Learning Integration: The current paper focuses on the "shallow" factorization machine. Future work involves integrating rank-awareness into deep neural networks (like DeepFM) to see if the benefits scale to more complex architectures.
  • Dynamic Data: The paper assumes feature frequencies are known upfront. In a streaming setting where feature frequencies change over time, the model would need a way to dynamically adjust ranks.

Summary updated

BibTeX
@inproceedings{chen2019rafm,
  author = {Xiaoshuang Chen and Yin Zheng and Jiaxing Wang and Wenye Ma and Junzhou Huang},
  title = {{RaFM: Rank-Aware Factorization Machines}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
  url = {https://openreview.net/forum?id=HyZ8m2ZOWS},
}
Figure