RaFM: Rank-Aware Factorization Machines

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

TL;DR

Rank-Aware Factorization Machines (RaFM) move away from the "one-size-fits-all" approach of standard Factorization Machines by assigning different embedding dimensions (ranks) to features based on their frequency. This adaptive approach significantly improves accuracy while reducing model size and computational overhead, making it highly effective for massive, long-tailed industrial datasets.

What Problem Does This Paper Address?

Factorization Machines (FMs) are a staple in recommendation systems and click-through rate (CTR) prediction because they efficiently model pairwise interactions between features. Traditionally, FMs assign a fixed embedding dimension $D$ to every feature.

However, real-world data is notoriously "long-tailed." As shown in the paper's analysis of datasets like MovieLens and Avazu, a tiny fraction of features appear millions of times, while the vast majority appear only once or twice.

Feature frequency distributions show a massive long tail where most features occur very rarely.

This creates a dilemma:

  1. Overfitting: Rare features don't have enough data to train a high-dimensional embedding, leading to noise.
  2. Underfitting: Frequent features might require more capacity than a small, fixed $D$ provides to capture complex interactions.

Methods

The authors propose RaFM, which allocates multiple embedding vectors of varying ranks to each feature. A feature $i$ is assigned a maximum rank $k_i$ based on its frequency.

The core innovation lies in the interaction rule: the pairwise interaction between feature $i$ and feature $j$ is computed using a rank $k_{ij} = \min(k_i, k_j)$. Intuitively, the interaction is only as complex as the "weakest" (least frequent) member of the pair allows.

Figure 2. The intuition of RaFM. (a) FM with a high dimension; (b) FM with a low dimension; (c) RaFM

To make this practical, the authors developed:

  • Efficient Computation: They proved that RaFM can be evaluated in $O(\sum D_k |F_k|)$ time. Because many features use very low ranks, this is often faster than a standard FM.
  • Bi-level Optimization: They introduced a training algorithm where lower-rank embeddings are treated as "projections" of higher-rank ones. This ensures that the model doesn't just explode in parameter count but stays consistent across different rank levels.

Datasets

The model was evaluated on a diverse set of benchmarks:

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

Key Insights and Ideas

  • Adaptive Capacity: Matching model capacity to data density is a fundamental win. By reducing the rank for rare features, RaFM effectively regularizes the model where it's most needed.
  • Identifying "Inactive Factors": The paper mathematically demonstrates that many potential parameters in a multi-rank setup are "inactive"—they never participate in interactions due to the $\min$ rank rule. By not storing or training these, RaFM achieves its efficiency.
  • Orthogonality: The authors note that RaFM's logic is independent of deep learning. It can be integrated into "DeepFM" or "Neural FM" architectures to potentially boost their performance as well.

Key Results

RaFM consistently outperformed standard FMs and other multi-rank baselines like DiFacto and MRMA across all datasets.

  • Performance vs. Size: On the MovieLens Tag dataset, RaFM achieved significantly lower logloss than any fixed-rank FM, even those with much higher parameter counts. RaFM outperforms fixed-rank FMs on the MovieLens Tag dataset.

  • Efficiency: In many tests, RaFM's model size was only 20%–66% of a standard FM, and training was up to 4x faster.

  • Industrial Impact: On Tencent's 1.7-billion-record dataset, RaFM achieved a similar AUC to a standard FM but used only 22% of the parameters. Compared to Logistic Regression, it boosted AUC by 1% while remaining computationally feasible for production. On industrial data, RaFM achieves high AUC with far fewer parameters than standard FM.
Figure 3. FM vs. RaFM in ML Tag
Figure 4. Comparisons of AUC and the model size on industrial level CTR dataset.

Limitations and Future Work

  • Rank Selection: Currently, the rank $k_i$ for each feature is chosen using a simple logarithmic heuristic based on frequency. The authors suggest that automated methods (like boosting or architecture search) might find even better rank assignments.
  • Field-Awareness: RaFM does not currently incorporate the concept of "fields" (used in FFMs). Combining rank-awareness with field-awareness is a suggested next step.
  • Hyperparameter Tuning: While RaFM reduces computational burden, it introduces more hyperparameters (the set of available ranks), which may require more tuning effort initially.

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