Fitting an energy model needs log Z, which is usually intractable. Score
matching sidesteps it by matching the gradient of the log density with
respect to x, in which Z – constant in x – has already cancelled.
Hyvarinen's result is that the objective then depends only on the model, so
the DATA's own score is never needed. That is the entire trick, and it is
what lets an unnormalised model be fitted at all.
Details
The Jacobian trace costs d extra evaluations per point when grad_score
is not supplied, which is what makes plain score matching expensive in high
dimension and motivated the sliced and denoising variants.
