Numerical Stability and Implementation To implement q-paths in practice, we begin by considering the log of the expression in Eq. (25), which is guaranteed to be non-negative becauseπ β,q (z) is an unnormalized density. 
logπ β,q (z) =(34)log π 0 (z) + 1 1 − q log 1 + (1 − q) · β · ln q π 1 (z) π 0 (z) ,q-path (blue) is still q = 1 − δ for small δ > 0.
We focus attention on ln qπ1 (z)/π 0 (z) term, which is potentially unstable for q = 1 since it takes importance weights w =π 1 (z)/π 0 (z) as input. Since we are usually given log weights in practice, we consider the identity mapping w = exp(log w) and reparameterize q = 1 − 1 ρ to obtain
ln q (exp log w) = 1 1 − q (exp log w) 1−q − 1 (35) = ρ (exp log w) 1 ρ − 1 (36) = ρ exp{ 1 ρ log w} − 1 .(37)
This suggests q should be chosen such that the exponential doesn't overflow or underflow, which can be accomplished by setting ρ on the order of
ρ = max i | log w i |.(38)
where i indexes a set of particles {z i }. This choice is reminiscent of the log-sum-exp trick and ensures | 1 ρ log w| ≤ 1. In Fig. 6, we explore the impact of changing the scale of log w on the numerical stability of q-paths. For the case of inferring global model parameters over N i.i.d. **data** points p(D) = N n=1 p(x n ), we can see that the scale of the unnormalized densitiesπ 1 (θ, D) = p(θ) N n=1 p(x n |θ) differs based on the number of datapoints, where increasing N decreases the magnitude of log w = logπ 1 (θ, D) with π 0 (θ) = p(θ).