Overview
Factorization Machines (FMs) are a staple for modeling feature interactions in high-dimensional sparse data, such as those found in recommender systems. However, they have traditionally been limited to second-order interactions due to prohibitive computational costs. This paper introduces the first efficient, linear-time algorithms—scaling at $O(dm)$—for training Higher-Order Factorization Machines (HOFMs) of any arbitrary order $m$. By leveraging a clever link to ANOVA kernels and dynamic programming, the authors make higher-order feature interactions practical for large-scale datasets.
The Problem with Higher-Order Interactions
In fields like personalized recommendation, the "magic" happens when you model how multiple features interact (e.g., a specific user liking a specific genre directed by a specific person). Standard FMs do this by approximating the weights of feature pairs using a low-rank matrix. While FMs for second-order interactions are well-studied and widely used, higher-order interactions (triplets, quadruplets, etc.) have historically been a computational nightmare.
Naively computing $m$-way interactions takes $O(d^m)$ time, where $d$ is the number of features. For a dataset with millions of features, even a 3rd-order model was historically impossible to train efficiently. Furthermore, original HOFM formulations required a separate parameter matrix for every single degree, leading to massive model sizes that were highly prone to overfitting.
Methodology: ANOVA Kernels and Dynamic Programming
The authors bridge the gap between FMs and the ANOVA kernel, a mathematical tool that computes sums of products of distinct feature combinations. Their core methodological contributions include:
- Linear-Time Dynamic Programming (DP): They propose a DP algorithm that evaluates the ANOVA kernel and its gradient in $O(dm)$ time. This turns a historically polynomial-time problem into a linear-time one, making arbitrary-order HOFMs practical for the first time.
- Efficient Solvers: Using the DP framework, they develop efficient solvers. While Stochastic Gradient (SG) scales linearly with the order $m$, they also provide a Coordinate Descent (CD) solver that is particularly effective for lower-order models (up to $m=4$).
- Shared Parameter Variants: To keep model sizes manageable and prevent overfitting, they introduce the inhomogeneous ANOVA kernel and the all-subsets kernel. These formulations allow the model to share parameters across different interaction orders.
- The "Dummy Feature" Trick: They demonstrate that an inhomogeneous HOFM (one that considers all orders up to $m$) can be trained using a standard homogeneous HOFM solver simply by appending "dummy" constant features to the input data.
Key Theoretical Insights
- Distinctness Matters: Unlike standard polynomial kernels, the ANOVA kernel only considers combinations of distinct features (e.g., it ignores $x_i^2$). This is crucial for categorical data where squaring a binary feature is mathematically redundant.
- Multi-linearity: The ANOVA kernel is multi-linear, meaning it is an affine function of any single feature weight. This property ensures the objective function is coordinate-wise convex, which theoretically justifies the use of Coordinate Descent.
- Kernel Machine Perspective: The paper reframes HOFMs as a type of kernel machine where the "support vectors" are actually learned parameters, providing a stronger theoretical grounding for why these models generalize well.
Key Results
The researchers evaluated their approach on four link prediction tasks (NIPS, Enzyme, Gene-Disease, and Movielens 100K). The results demonstrated significant improvements in both accuracy and efficiency:
- Accuracy Boost: HOFMs consistently outperformed 2nd-order FMs and low-rank bilinear regression. For example, on the NIPS co-authorship dataset, moving from $m=2$ to $m=3$ increased the AUC from 0.856 to 0.875.
- Model Compression: The "shared-augmented" HOFM variants achieved accuracy comparable to full HOFMs while using significantly fewer parameters, offering much faster prediction times.
- Solver Trade-offs: Coordinate Descent (CD) proved to be the fastest solver for lower-order interactions ($m \le 3$). However, because CD has a quadratic dependency on the order ($O(m^2)$), L-BFGS and SG (like AdaGrad) became much more advantageous as the interaction order $m$ increased.
Limitations and Future Work
While the proposed algorithms represent a massive leap forward for FMs, the authors note a few limitations. The current Coordinate Descent algorithm's $O(m^2)$ scaling makes it less ideal for extremely high-order interactions compared to the SG approach. Additionally, some solvers, particularly AdaGrad, exhibited sensitivity to learning rate hyper-parameters, requiring careful tuning.
Looking forward, the authors suggest that their DP algorithms could be integrated as custom layers in deep learning frameworks. This would allow ANOVA kernels to be combined with convolutional or recurrent layers, paving the way for even more expressive and complex neural architectures.
Summary updated