一句话:提出基于细粒度值表示解释动态规划结果的方法,并用 Haskell 库支持从递推关系自动生成可解释实现。
动态规划广泛用于实现优化算法,但其通过聚合值比较作出的决策往往难以解释。本文提出一种可解释动态规划方法:在执行过程中保留被聚合值的细粒度表示,据此回答“为何得到此结果而非彼结果”,从而增强对结果正确性的信心。作者利用半环形式化动态规划,构建 Haskell 库,使程序员只需给出递推关系即可自动获得高效实现;动态规划还可作为类型类泛化,使普通程序平滑过渡到带细粒度表示并生成解释的版本。该库还支持预先推测用户对结果的疑问并自动生成相应解释。
Abstract In this paper, we present a method for explaining the results produced by dynamic programming (DP) algorithms. Our approach is based on retaining a granular representation of values that are aggregated during program execution. The explanations that are created from the granular representations can answer questions of why one result was obtained instead of another and therefore can increase the confidence in the correctness of program results. Our focus on dynamic programming is motivated by the fact that dynamic programming offers a systematic approach to implementing a large class of optimization algorithms which produce decisions based on aggregated value comparisons. It is those decisions that the granular representation can help explain. Moreover, the fact that dynamic programming can be formalized using semirings supports the creation of a Haskell library for dynamic programming that has two important features. First, it allows programmers to specify programs by recurrence relationships from which efficient implementations are derived automatically. Second, the dynamic programs can be formulated generically (as type classes), which supports the smooth transition from programs that only produce result to programs that can run with granular representation and also produce explanations. Finally, we also demonstrate how to anticipate user questions about program results and how to produce corresponding explanations automatically in advance.
DOI 原文 ·
@article{paperbot1235,
title = {Explainable dynamic programming},
author = {MARTIN ERWIG and PRASHANT KUMAR},
journal = {Journal of Functional Programming},
volume = {31},
year = {2021},
doi = {10.1017/s0956796821000083}
}