一句话:为基于时序差分的强化学习提出形式规约,并以DSL解释器作测试预言机进行基于属性的测试与变异评估。
强化学习应用的开发通常带有探索性,缺乏系统化规约,导致规约难以复用且容易引入编程错误。本文面向强化学习问题与算法提出形式化规约,重点关注时序差分方法及其备份图定义,并为SARSA、Q-learning等一大类基于时序差分学习的应用构建测试框架。整个开发基于函数式编程方法:从纯规约与指称语义出发,到基于属性的测试,并使用领域特定项语言的组合解释器作为具体实现的测试预言机。作者在若干示例上展示该测试方法的有效性,并用变异测试进行评估,结果表明测试套件能杀死大量变异体(对75%的被测智能体可杀死90%的变异体)。更重要的是,近一半变异体由通用的一次编写、处处复用测试杀死,无需程序员额外工作。
The development process for reinforcement learning applications is still exploratory rather than systematic. This exploratory nature reduces reuse of specifications between applications and increases the chances of introducing programming errors. This paper takes a step towards systematizing the development of reinforcement learning applications. We introduce a formal specification of reinforcement learning problems and algorithms, with a particular focus on temporal difference methods and their definitions in backup diagrams. We further develop a test harness for a large class of reinforcement learning applications based on temporal difference learning, including SARSA and Q-learning. The entire development is rooted in functional programming methods; starting with pure specifications and denotational semantics, ending with property-based testing and using compositional interpreters for a domain-specific term language as a test oracle for concrete implementations. We demonstrate the usefulness of this testing method on a number of examples, and evaluate with mutation testing. We show that our test suite is effective in killing mutants (90% mutants killed for 75% of subject agents). More importantly, almost half of all mutants are killed by generic write-once-use-everywhere tests that apply to any reinforcement learning problem modeled using our library, without any additional effort from the programmer.
@article{paperbot1927,
title = {Formal Specification and Testing for Reinforcement Learning},
author = {Mahsa Varshosaz and Mohsen Ghaffari and Einar Broch Johnsen and Andrzej Wąsowski},
journal = {Proceedings of the ACM on Programming Languages},
volume = {7},
number = {ICFP},
year = {2023},
doi = {10.1145/3607835}
}