Paper commentary
DeepFM: A Factorization-Machine based Neural Network for CTR Prediction
DeepFM shares one embedding between a factorization machine and a deep network
- Problem Click-through rate models have to capture both low-order and high-order feature interactions. Existing models lean toward one order, or they need hand-built wide features, so they miss some combinations.
- Method DeepFM runs a factorization machine and a feed-forward network over one shared embedding of the raw input fields. It adds their outputs and applies a sigmoid, so no feature engineering is needed.
- Results DeepFM reaches an AUC of 0.8715 on the Company Dataset and 0.8007 on the Criteo Dataset. Both are the highest AUC values in the paper's comparison table.
Why feature interactions are hard to capture
A CTR estimate decides the order of candidate items in a recommender, and in advertising the same estimate is multiplied by a bid before ranking. Either way the ranking is only as good as the estimate. The signal often sits in combinations of fields rather than in any single field. The authors give two app-market examples: app category combined with time of day, and app category combined with user gender and age.
Generalized linear models such as FTRL remain strong in practice, but a linear model cannot learn interactions by itself, so pairwise crosses must be added by hand. Such hand-made crosses generalize poorly to rare or unseen combinations. Factorization machines learn pairwise terms from latent vectors, yet in practice they are usually run with order-2 interactions only.
Deep networks can learn complex patterns from raw features, but the authors argue that deep models like PNN and FNN capture little low-order interaction. Wide & Deep combines a linear part with a deep part to cover both orders, but its wide part still needs hand-designed input features, and its two parts take different inputs.
How the shared embedding feeds both parts
Each categorical field is one-hot encoded and each continuous field is kept as a value or one-hot encoded after discretization. The fields are concatenated into one d-dimensional vector x, which is high-dimensional and extremely sparse. Every feature i gets a scalar weight w_i for its order-1 effect and a latent vector V_i. The same V_i serves the FM component for order-2 terms and the deep component for high-order terms.
The FM output adds a weighted sum of the inputs to the inner products of latent vectors over all feature pairs, each pair scaled by the product of its two input values. \[ y_{FM}=\langle w,x\rangle+\sum_{j_1=1}^{d}\sum_{j_2=j_1+1}^{d}\langle V_i,V_j\rangle x_{j_1}x_{j_2} \]
The embedding layer uses the FM latent vectors as its weights. Each field vector is compressed into a dense vector e_i of the same size k, and the layer output is the concatenation of these embeddings.
The deep component then runs the embedding output through layers of the form a^{(l+1)} = σ(W^{(l)}a^{(l)} + b^{(l)}), and a final sigmoid layer gives y_DNN from the last hidden output. \[ a^{(l+1)}=\sigma(W^{(l)}a^{(l)}+b^{(l)}) \]
The model adds the two outputs and applies a sigmoid, so the predicted CTR is the sigmoid of y_FM plus y_DNN. \[ \hat{y}=\operatorname{sigmoid}(y_{FM}+y_{DNN}) \] All parameters, including the w_i, the V_i and the network weights, are trained jointly, so the embedding is learned from the loss through both paths instead of being pre-trained by FM.
How DeepFM differs from FNN, PNN and Wide & Deep
FNN is a feed-forward network initialized from a pre-trained FM. The authors point to two costs: the embeddings may be over-shaped by FM, and the pre-training stage adds overhead. FNN also captures only high-order interactions. DeepFM avoids pre-training and learns both orders from the same embedding.
PNN places a product layer between the embedding layer and the first hidden layer, in inner-product, outer-product or combined variants. The authors find the outer-product approximation unstable, while the inner product is more reliable but costly, because the product output feeds every neuron of the first hidden layer. In DeepFM the FM output joins only the final sum, so it does not pass through a wide product layer.
Wide & Deep needs expertise feature engineering for its wide part, for example crosses between a user's installed apps and the impression apps. DeepFM learns those interactions directly from raw input. A simple variant replaces the LR wide part with FM. DeepFM differs from that variant because its FM and deep components share the feature embedding, so the back-propagated gradients from both low- and high-order terms shape the same representation.
Table 1 compares the four models on pre-training, high-order features, low-order features and feature engineering. DeepFM is the only model in that comparison that needs no pre-training and no feature engineering while capturing both orders.
Data, metrics and training settings
The Criteo Dataset includes 45 million users' click records, with 13 continuous features and 26 categorical ones. It is split randomly, with 90% for training and the remaining 10% for testing. The Company∗ Dataset comes from the game center of a commercial app store. Seven consecutive days of click records are used for training and the next day for testing, and the whole collection holds around 1 billion records.
Models are compared with AUC and Logloss. The nine models are LR, FM, FNN, three PNN variants, Wide & Deep, and DeepFM. Wide & Deep is run in two versions, LR & DNN and FM & DNN, in which the wide part is LR or FM. The authors wrote their own implementation with a shared optimizer for the wide and deep parts instead of using Google's API.
On Criteo the FNN and PNN settings follow prior work: dropout 0.5, a 400-400-400 network, Adam, and tanh for IPNN with relu for the other deep models. DeepFM uses the same settings for fairness. LR is optimized with FTRL and FM with Adam, and the FM latent dimension is 10. For Company∗ the settings were chosen through the parameter study reported later.
AUC and Logloss on both datasets
On the Company∗ Dataset DeepFM reaches an AUC of 0.8715 and a Logloss of 0.02618. The next best AUC in Table 2 is 0.8683, from FNN. On the Criteo Dataset DeepFM reaches an AUC of 0.8007 and a Logloss of 0.45083, the highest AUC and the lowest Logloss in the table.
Relative to LR, DeepFM's AUC is 0.86% higher on Company∗ and 4.18% higher on Criteo, and its Logloss is 1.15% and 5.60% lower. The LR result is the only one without explicit interaction terms, and it is the weakest model on both datasets.
Against the models that learn only one order, namely FM, FNN, IPNN, OPNN and PNN∗, DeepFM's AUC exceeds the second-best model by more than 0.37% on Company∗ and by more than 0.25% on Criteo. Logloss improves by more than 0.42% and 0.29% on those datasets.
Against LR & DNN and FM & DNN, which keep separate embeddings for the two parts, DeepFM's AUC is higher by more than 0.48% on Company∗ and by more than 0.33% on Criteo. Logloss is lower by more than 0.61% and 0.66% on those datasets. The authors attribute this gap to the shared embedding, which lets the high- and low-order terms shape one representation.
The authors note that a small offline AUC gain can translate into a larger online CTR gain. They cite a prior study in which Wide & Deep improved offline AUC over LR by 0.275% and online CTR by 3.9%; these are cited results, not measurements in this paper.
Training time relative to LR
Efficiency is measured on Criteo as the training time of each deep model divided by the training time of LR, on CPU and on GPU. FNN is less efficient because of its pre-training stage.
IPNN and PNN∗ gain more from the GPU than the other models, yet they remain expensive because their inner-product operations are inefficient. DeepFM is nearly the most efficient deep model in both tests.
Activation, dropout, width, depth and shape on Company∗
Dropout is tested at 1.0, 0.9, 0.8, 0.7, 0.6 and 0.5, and dropout here denotes the probability that a neuron is kept. Every model reaches its best result when dropout is set between 0.6 and 0.9. The authors read this as randomness that strengthens robustness.
Raising the neurons per layer from 400 to 800 leaves DeepFM stable, while OPNN gets worse. The authors attribute this to overfitting, and they consider 200 or 400 neurons per layer a good choice on their dataset.
Adding hidden layers first improves performance and then degrades it as depth keeps increasing. The authors again attribute the decline to overfitting.
With three hidden layers and 600 neurons in total, the four shapes are constant (200-200-200), increasing (100-200-300), decreasing (300-200-100) and diamond (150-300-150). The constant shape performs better than the other three, which agrees with earlier studies the authors cite.
Limitations
The hyper-parameter study was run only on the Company∗ Dataset, so the choices of activation, dropout, width, depth and shape were not checked on Criteo. The FNN and PNN settings on Criteo come from prior work and are reused for DeepFM, which the authors describe as the fair choice.
Table 2 reports a single AUC and Logloss per model and dataset, and the text does not describe repeated runs or variance. The training-time comparison covers only Criteo, so the efficiency of DeepFM on Company∗ is not measured in this paper.
The authors name two open directions: adding strategies such as pooling layers to learn the most useful high-order interactions, and training DeepFM on a GPU cluster for large-scale problems.
Paper info
- Authors
- Huifeng Guo, Ruiming Tang, Yunming Ye, Zhenguo Li, Xiuqiang He
- Venue
- arXiv · Preprint
- First published
- 2017-3-13
- Added
- 2026-11-12
- Updated
- 2017-3-13
- Version
- v1
- arXiv
- 1703.04247
- Category
- cs.IR · cs.CL
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Huifeng Guo, Ruiming Tang, Yunming Ye, Zhenguo Li, Xiuqiang He (2017). DeepFM: A Factorization-Machine based Neural Network for CTR Prediction. arXiv:1703.04247v1. https://arxiv.org/abs/1703.04247v1
BibTeX
@misc{guo2017deepfm,
title = {{DeepFM: A Factorization-Machine based Neural Network for CTR Prediction}},
author = {Huifeng Guo and Ruiming Tang and Yunming Ye and Zhenguo Li and Xiuqiang He},
year = {2017},
eprint = {1703.04247},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1703.04247v1}
}