We present a static analysis for discovering differentiable or more generally smooth parts of a given probabilistic program, and show how the analysis can be used to improve the pathwise gradient estimator, one of the most popular methods for posterior inference and model learning. Our improvement increases the scope of the estimator from differentiable models to non-differentiable ones without requiring manual intervention of the user; the improved estimator automatically identifies differentiable parts of a given probabilistic program using our static analysis, and applies the pathwise gradient estimator to the identified parts while using a more general but less efficient estimator, called score estimator, for the rest of the program. Our analysis has a surprisingly subtle soundness argument, partly due to the misbehaviours of some target smoothness properties when viewed from the perspective of program analysis designers. For instance, some smoothness properties are not preserved by function composition, and this makes it difficult to analyse sequential composition soundly without heavily sacrificing precision. We formulate five assumptions on a target smoothness property, prove the soundness of our analysis under those assumptions, and show that our leading examples satisfy these assumptions. We also show that by using information from our analysis instantiated for differentiability, our improved gradient estimator satisfies an important differentiability requirement and thus computes the correct estimate on average (i.e., returns an unbiased estimate) under a regularity condition. Our experiments with representative probabilistic programs in the Pyro language show that our static analysis is capable of identifying smooth parts of those programs accurately, and making our improved pathwise gradient estimator exploit all the opportunities for high performance in those programs.
翻译:我们提出一个静态分析,以发现某个给定的概率程序的不同部分或更一般的更平稳部分,并展示如何利用该分析来改进路径性梯度测算仪,这是后推推和模型学习最受欢迎的方法之一。我们的改进将测算器的范围从不同的模型扩大到非差别性模型,而不需要用户人工干预;改进的估测器自动发现某个给定的概率性程序的不同部分,使用我们的静态分析,并将路径性梯度估测器应用于所确定的部分,同时使用一个更一般但效率更低的精确度估测算仪来改进路径性测算仪。我们的分析有一个令人惊讶的微妙论点,其部分原因是,从程序分析设计师的角度来看,某些目标性平滑度属性存在误差,而不需要用户手动干预;例如,一些平稳性特性没有被功能构成所保存,因此很难在不严重牺牲精确性的情况下对顺序性构成进行分析。我们在一个目标性平稳的精确性估测算器上设定了五个假设,用更精确的准确性估测算,用我们的准确性测算法来显示我们的准确性测算结果,从而显示我们的精确性分析这些精确性,从而显示我们的精确性分析的精确性,从而显示我们的精确性分析显示我们的精确性分析。我们对这些的精确性分析,在这些测算。