All models

DeepCTR-Torch NFM

NFM stacks a neural network on a factorization machine to learn non-linear feature interactions from sparse inputs.

Tabular and recommender · 211 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (15 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
NFM
Parameters
30.3K
Operations
211
Framework
PyTorch
Recurrent
No
Published
SIGIR 2017
Cited by
1,401 (as of 18 October 2026)
Authors
Xiangnan He, Tat-Seng Chua
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m655
Graph hash
a9cd372a87f1bc5454daa55cab67eae8f9de4129367cc95920f104f5e2172f4e
Skeleton hash
b614324b6f2f6731979180990fd5acb138216b5c571bebd1a285f80cc28d5c4d
Architecture hash
4e176f5d231845309056be3e21f6dc5bdfc593ffe2561168a5650457bcf9c443
Diagram SHA-256
29bc77eff46df167a7e9fd616365d0a8299eb141f72f876fb697aa0b69735a2b
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

About this model's family

NFM, the Neural Factorization Machine, is a model for prediction under sparse settings, the kind of input you get when user IDs and demographic fields are one-hot encoded. Those categorical predictors are converted to binary features via one-hot encoding, which leaves the feature vector highly sparse, and the paper's premise is that learning from such data well means accounting for interactions between features. Factorization Machines handle second-order interactions efficiently, but they model those interactions in a linear way, which the authors argue can be insufficient for the non-linear structure of real-world data.

The idea is to keep the FM's linear second-order interactions and add a neural network on top to model higher-order interactions non-linearly. Conceptually FM is a special case of NFM with no hidden layers. On two regression tasks a single hidden layer was enough for NFM to beat FM by a 7.3% relative improvement. Against Wide&Deep and DeepCross, the paper claims a shallower structure that performs better and is easier to train and tune. The three traced members are all the DeepCTR-Torch implementation, a package of deep-learning based CTR models that lists the Neural Factorization Machine among its models. The authors' own code supports two tasks, regression optimising RMSE and binary classification optimising Log Loss.

Key idea. NFM combines the linearity of FM in modelling second-order feature interactions with the non-linearity of a neural network for higher-order interactions, so that FM becomes the special case with no hidden layers.

  • NFM
  • Neural Factorization Machine
  • neural factorization machines
  • factorization machine
  • FM
  • sparse predictive analytics
  • CTR prediction
  • click-through rate
  • DeepCTR-Torch
  • DeepCTR
  • feature interactions
  • recommender

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{he2017neuralfactorizationmachinessparse,
      title={Neural Factorization Machines for Sparse Predictive Analytics}, 
      author={Xiangnan He and Tat-Seng Chua},
      year={2017},
      eprint={1708.05027},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1708.05027}, 
}