关于最优决策树的条件分支
On Conditional Branches in Optimal Decision Trees
摘要:
决策树是最基本的编程抽象之一。一种常用的决策树类型是字母二叉树,它使用(不失一般性)"小于“与”大于或等于“测试来确定$n$结果事件之一。为已知的结果事件的概率分布找到最优的字母二叉树的过程通常具有基本假设,即每个决策的成本(时间)是均匀的,因此与决策的结果无关。然而,这种假设在要为给定的微处理器优化软件的情况下是不正确的,例如,编译switch语句或微调程序瓶颈。微处理器的操作通常意味着更可能的决策结果的成本可以或将比不太可能的决策结果少-通常少得多。在这里,我们制定了各种各样的$O(n^3)$ -时间$O(n^2)$ -空间动态规划算法来解决这种最佳的二进制决策树问题,优化处理器的行为与预测分支能力,静态和动态。在静态的情况下,我们使用现有的结果来达到基于熵的性能界限。这种公式化的解决方案在实践中往往比文献中公式化的“最优”决策树更快,并且对于小问题,很容易值得在寻找更好的解决方案时付出额外的复杂性。该方法可应用于霍夫曼码的快速译码。
英文摘要:
The decision tree is one of the most fundamental programming abstractions. A commonly used type of decision tree is the alphabetic binary tree, which uses (without loss of generality) ``less than'' versus ''greater than or equal to'' tests in order to determine one of $n$ outcome events. The process of finding an optimal alphabetic binary tree for a known probability distribution on outcome events usually has the underlying assumption that the cost (time) per decision is uniform and thus independent of the outcome of the decision. This assumption, however, is incorrect in the case of software to be optimized for a given microprocessor, e.g., in compiling switch statements or in fine-tuning program bottlenecks. The operation of the microprocessor generally means that the cost for the more likely decision outcome can or will be less -- often far less -- than the less likely decision outcome. Here we formulate a variety of $O(n^3)$-time $O(n^2)$-space dynamic programming algorithms to solve such optimal binary decision tree problems, optimizing for the behavior of processors with predictive branch capabilities, both static and dynamic. In the static case, we use existing results to arrive at entropy-based performance bounds. Solutions to this formulation are often faster in practice than ``optimal'' decision trees as formulated in the literature, and, for small problems, are easily worth the extra complexity in finding the better solution. This can be applied in fast implementation of decoding Huffman codes.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。