Computational models of human language often involve combinatorial problems. For instance, a probabilistic parser may marginalize over exponentially many trees to make predictions. Algorithms for such problems often employ dynamic programming and are not always unique. Finding one with optimal asymptotic runtime can be unintuitive, time-consuming, and error-prone. Our work aims to automate this laborious process. Given an initial correct declarative program, we search for a sequence of semantics-preserving transformations to improve its running time as much as possible. To this end, we describe a set of program transformations, a simple metric for assessing the efficiency of a transformed program, and a heuristic search procedure to improve this metric. We show that in practice, automated search -- like the mental search performed by human programmers -- can find substantial improvements to the initial program. Empirically, we show that many common speed-ups described in the NLP literature could have been discovered automatically by our system.
翻译:人类语言的计算模型往往涉及组合问题。 例如, 概率分析器可能会在成倍增长的树木上边缘化, 从而做出预测。 这些问题的分解器通常使用动态程序, 并且并不总是独特的。 找到一个最佳的无症状运行时间, 可能是不直观的, 耗时的, 并且容易出错。 我们的工作目标是使这个繁忙的过程自动化。 初步正确的声明程序, 我们尽可能地寻找一系列语义保留转换的序列, 来改善它的运行时间。 为此, 我们描述一套程序转换, 一个用于评估一个已转变程序效率的简单度量度, 以及一个用于改进这一度量的超乎寻常的搜索程序。 我们显示, 在实践中, 自动搜索( 和人类程序员进行的精神搜索一样) 能够找到对初始程序的重大改进。 我们很生动地表明, 许多在 NLP 文献中描述的常见速变过程可以被我们的系统自动发现 。