\[\pi^{*}(y|x)=\frac{1}{Z(x)}\pi_{\text{ref}}(y|x)\exp\left(\frac{1}{\beta}r(x,y)\right),\]which is a valid probability distribution as \(\pi^{*}(y|x)\geq 0\) for all \(y\) and \(\sum_{y}\pi^{*}(y|x)=1\).