All models

recbole.NFM

A factorization machine deepened with neural layers for prediction from sparse categorical features.

Tabular and recommender · 99 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 (23 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
23.5K
Operations
99
Framework
PyTorch
Recurrent
No
Published
SIGIR 2017
Cited by
1,402 (as of 22 October 2026)
Authors
Xiangnan He, Tat-Seng Chua
License
MIT
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
m8650
Graph hash
64487c962fcb2684bb226c05288bbd2c3523967a17197f4e71b6f9d5c577d490
Skeleton hash
299946dfabc22f36846404145397ccbd6a420927582cc66a4d3e2060789a78d7
Architecture hash
ef2d998ca37f5e9c7f22d8cfa163fbe6a7167e2d2b7c34e2c2f4fb5230a30f01
Diagram SHA-256
96f7006e2b2cd80e78d533d69234a6f40bcdd632fedc2a228f9dd596235fce43
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

Neural Factorization Machine (NFM) is a model for prediction under sparse settings, the kind that arise when categorical variables are one-hot encoded. The paper starts from Factorization Machines (FMs), which it says model feature interactions in a linear way that can be insufficient for real-world data. NFM combines the linearity of FM in modeling second-order feature interactions with the non-linearity of a neural network in modeling higher-order ones.

Its central operation is Bi-Interaction pooling, which turns a set of feature embedding vectors into one vector that encodes the second-order interactions between features. A stack of fully connected layers sits above the pooling layer. The authors point out that the pooling introduces no extra model parameter and can be computed in linear time. FM itself can be seen as a special case of NFM without hidden layers.

On two regression tasks, the paper reports that NFM with only one hidden layer outperforms FM with a 7.3% relative improvement. The authors' own implementation supports two tasks, regression and binary classification.

Key idea. NFM stacks non-linear layers above a Bi-Interaction pooling layer, so that a factorization machine's second-order feature interactions feed a neural network that models higher-order ones.

  • nfm
  • neural factorization machine
  • neural factorization machines
  • sparse prediction
  • feature interactions
  • bi-interaction pooling
  • context-aware recommendation
  • recbole nfm

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}, 
}