NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Explaining Neural Matrix Factorization with Gradient Rollback

Carolin Lawrence, Timo Sztyler, Mathias Niepert

Introduction

Neural matrix factorization (NMF) models are foundational to modern recommender systems and knowledge graph embeddings. Despite their predictive power, these models often operate as "black boxes," making it difficult to discern which specific training examples drove a particular prediction. To address this, researchers utilize influence estimation to identify the training samples that most significantly impact a model's output.

Traditional methods like Influence Functions are computationally prohibitive for large-scale models due to the need for inverse Hessian calculations. The alternative—retraining the model without specific samples—is even more costly. This paper introduces Gradient Rollback (GR), a highly efficient method that provides faithful explanations by tracking parameter updates during training and "rolling them back" at test time.

Methodology: The Gradient Rollback Approach

The core innovation of Gradient Rollback lies in its simplicity: it records the cumulative changes made to model parameters by each training instance during the optimization process (e.g., SGD or Adam).

Overview of the Gradient Rollback mechanism, illustrating how updates to specific entity and relation embeddings are tracked and rolled back to explain predictions in a knowledge graph.

GR is uniquely suited for NMF models because of their inherent sparsity. In these architectures, a single training triple—consisting of a Subject, Relation, and Object—only updates the embeddings associated with those specific components. This sparsity ensures that the "influence table" remains manageable. At test time, to explain a prediction, the system identifies "adjacent" training triples (those sharing an entity or relation) and subtracts their stored updates from the final weights. The resulting difference in the prediction score serves as a highly accurate influence estimate.

Experimental Evaluation

The researchers evaluated GR across three standard benchmarks: NATIONS (a small country-relation knowledge base), FB15K-237 (a large-scale dataset derived from Freebase), and MOVIELENS (a classic user-movie rating dataset).

To validate the fidelity of GR, the authors employed the ROAR (RemOve And Retrain) method. They identified the most influential samples, removed them, and retrained the model from scratch to observe the actual change in prediction probability.

Extracted figure from page 7 of Explaining Neural Matrix Factorization with Gradient Rollback

Key Results

  • High Fidelity: GR demonstrated a strong Pearson correlation with actual retraining results, reaching up to 0.97 on the NATIONS dataset.
  • Efficiency: GR significantly outperformed existing state-of-the-art estimators like CRIAGE. For instance, on the MovieLens dataset, GR generated explanations in just 3 minutes, compared to the 3 hours required by CRIAGE.
  • Effectiveness: On NATIONS, removing the single most influential triple identified by GR caused a drop in prediction probability in over 90% of tested cases.

Insights and Future Directions

A profound theoretical contribution of this work is the link between GR and algorithmic stability. The authors prove that if a learning algorithm is stable (i.e., its output is not overly sensitive to single-point changes), rolling back gradients is a mathematically sound approximation of influence.

While GR is exceptionally efficient, it does require additional memory to store accumulated updates—roughly equivalent to a second copy of the model. Future work aims to extend this technique to "dense" models like Transformers or CNNs, where every training sample typically affects nearly every parameter, requiring new strategies to manage the update tracking overhead.

Summary updated

BibTeX
@inproceedings{lawrence2021explaining,
  author = {Carolin Lawrence and Timo Sztyler and Mathias Niepert},
  title = {{Explaining Neural Matrix Factorization with Gradient Rollback}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i6.16632},
}
Figure