Quant Memo
Advanced

SmoothGrad and Attribution Noise

SmoothGrad cleans up noisy gradient-based feature attributions by averaging them over many slightly-perturbed copies of the same input, trading a bit of computation for a much clearer picture of what a model is actually responding to.

Prerequisites: Saliency Maps and Raw Gradient Attribution

A basic saliency map explains a model's prediction by taking the gradient of the output with respect to each input feature — how much a tiny nudge to that feature would move the prediction. For deep, highly nonlinear models this gradient is often jagged and visually noisy, lighting up seemingly irrelevant features alongside the genuinely important ones, because the gradient at any single point can be dominated by local wiggles in the model's function that have nothing to do with the broader pattern it learned.

SmoothGrad fixes this with a deliberately counterintuitive trick: add small random noise to the input, compute the gradient-based attribution again, repeat this many times with different random noise each time, and average the results. Averaging over many noisy perturbations cancels out the jagged, point-specific artifacts while the genuinely important features — whose gradients stay large and consistent across nearby points — survive the averaging and stand out clearly.

SmoothGrad improves a gradient-based attribution not by changing the underlying method, but by averaging it over many randomly perturbed copies of the same input, which cancels the noisy artifacts specific to any one point while preserving genuinely robust signal.

Worked example

A model classifies news headlines by sentiment. A raw gradient-based attribution on one headline highlights a handful of scattered, seemingly random words alongside the genuinely sentiment-bearing ones. Running SmoothGrad — adding small random perturbations fifty times, recomputing the gradient attribution each time, and averaging — causes the scattered noise to wash out across the fifty runs while the words consistently flagged as important across nearly all of them (the actual sentiment-carrying words) remain highlighted.

Related concepts

Further reading

  • Smilkov et al., 'SmoothGrad: Removing Noise by Adding Noise'
ShareTwitterLinkedIn