Skip to main content
QUICK REVIEW

[Paper Review] Interpretation of Prediction Models Using the Input Gradient

Yotam Hechtlinger|arXiv (Cornell University)|Nov 23, 2016
Topic ModelingComputer Science4 references61 citations
TL;DR

This paper proposes using input gradients—partial derivatives of a model's output with respect to its inputs—as a general, model-agnostic method to interpret complex prediction models, including deep neural networks in NLP. It demonstrates that gradients reveal feature importance and enable global linear approximations, achieving 99.6% agreement with the original model on a sentiment classification task using a Bag of Words representation.

ABSTRACT

State of the art machine learning algorithms are highly optimized to provide the optimal prediction possible, naturally resulting in complex models. While these models often outperform simpler more interpretable models by order of magnitudes, in terms of understanding the way the model functions, we are often facing a "black box". In this paper we suggest a simple method to interpret the behavior of any predictive model, both for regression and classification. Given a particular model, the information required to interpret it can be obtained by studying the partial derivatives of the model with respect to the input. We exemplify this insight by interpreting convolutional and multi-layer neural networks in the field of natural language processing.

Motivation & Objective

  • To develop a general, model-agnostic method for interpreting complex prediction models, particularly deep neural networks.
  • To address the interpretability challenge in 'black-box' models where traditional parameter-based analysis fails.
  • To demonstrate that input gradients provide meaningful insights into feature importance and model behavior.
  • To show that gradients can be used to create accurate linear approximations of complex, non-linear models.
  • To validate the method on real NLP tasks using both word embeddings and Bag of Words representations.

Proposed method

  • Compute the gradient of the model output with respect to each input feature, i.e., ∇f(x) = (∂f/∂x₁, ..., ∂f/∂xₚ), to assess feature influence.
  • Use backpropagation to efficiently compute gradients in neural networks, leveraging the chain rule.
  • Calculate the average gradient vector g̃ = (ḡ₁, ..., ḡₚ) over the test set to obtain a global measure of feature importance.
  • Use the average gradient vector g̃ to approximate the model’s decision boundary via a linear classifier: predict 1 if ⟨g̃, x_new⟩ > 0.
  • Apply the method to both local interpretation (e.g., individual sentences) and global interpretation (e.g., word-level influence across the dataset).
  • Handle non-differentiable features (e.g., binary BoW) by treating them as continuous in a small neighborhood, enabling gradient estimation.

Experimental results

Research questions

  • RQ1Can input gradients serve as a general-purpose interpretability tool for any prediction model, regardless of complexity?
  • RQ2How well do input gradients reflect the true influence of input features on model predictions in deep learning models?
  • RQ3Can the average gradient vector provide a reliable global approximation of a complex model’s decision boundary?
  • RQ4To what extent can a linear classifier based on average gradients replicate the predictions of a non-linear model?
  • RQ5How do gradients reveal meaningful, interpretable patterns in NLP tasks such as sentiment classification?

Key findings

  • The average gradient vector g̃ provides a trustworthy, global estimate of feature importance, with top-ranked words like 'excellent' and 'worst' showing high interpretability.
  • A linear classifier based on g̃ achieved 99.6% agreement with the original model on the test set, indicating that the decision boundary is approximately linear.
  • The method successfully identified influential words in individual sentences, such as 'ape' in 'ape was outstanding', based on high gradient norms.
  • Even for non-differentiable features like binary BoW vectors, gradient estimation via local perturbation remains effective and informative.
  • The approach generalizes across model types, including convolutional and multi-layer neural networks in NLP.
  • The gradient-based method outperforms traditional parameter-based interpretation in complex models where no direct parameter-feature mapping exists.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.