Solution

ID: past-exam-of-the-msc-in-advanced-computer-science-course-of-the-university-of-oxford/2021/bayesian-statistical-probabilistic-programming/2/d/solution

The two limiting-case names in the printed bullets are reversed. Fully reparameterized continuous choices give a reparameterization gradient; non-reparameterized discrete choices give a score-function gradient estimator. Here are both reductions, including the extra term that vanishes only after taking an expectation.
When all choices are reparameterized with parameter-independent base noise, and . The expression in part (c) becomes
Differentiating along the sampled transformation is precisely the pathwise gradient, also called the reparameterization gradient. There is no score function of the parameter-independent base law.
When all choices are discrete and left untransformed, and . Set and . Since has no variational parameter, the integrand in part (c) is
Normalization gives the zero-mean score function identity
Thus
The first expression is the usual score-function gradient estimator; the second has a constant score baseline of one. The two random integrands are generally different even though their expectations agree. A suitable constant score baseline can reduce variance, but one is not universally the optimal baseline.[ref]
For a concrete check, take with and , and a fixed target . Direct integration gives
Using , , the combined integrand has components , and . Their expectations are respectively , and , matching direct differentiation. Dropping the discrete score function term would incorrectly give zero for the first component. This calculation checks the combination without accepting the printed reversal.

New to topics? Read the docs here!