paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Formal Specification and Testing for Reinforcement Learning

强化学习的形式化规约与测试
ICFP 7(ICFP)2023匹配度 4/10 · 论文将形式规约、DSL 解释器与属性测试用于强化学习系统的测试,属于 PL 方法在 ML 系统中的应用,与“PL→AI”方向有边缘交集;但它不涉及静态分析、LLM/Agentic 程序、浮点程序分析或贝叶斯程序分析,与用户核心研究问题距离较远。引用 8 inbox
Mahsa Varshosaz, Mohsen Ghaffari, Einar Broch Johnsen, Andrzej Wąsowski
crossref: 2026-09-10

AI 速览

一句话:为基于时序差分的强化学习提出形式规约,并以DSL解释器作测试预言机进行基于属性的测试与变异评估。

强化学习应用的开发通常带有探索性,缺乏系统化规约,导致规约难以复用且容易引入编程错误。本文面向强化学习问题与算法提出形式化规约,重点关注时序差分方法及其备份图定义,并为SARSA、Q-learning等一大类基于时序差分学习的应用构建测试框架。整个开发基于函数式编程方法:从纯规约与指称语义出发,到基于属性的测试,并使用领域特定项语言的组合解释器作为具体实现的测试预言机。作者在若干示例上展示该测试方法的有效性,并用变异测试进行评估,结果表明测试套件能杀死大量变异体(对75%的被测智能体可杀死90%的变异体)。更重要的是,近一半变异体由通用的一次编写、处处复用测试杀死,无需程序员额外工作。

问题
强化学习应用开发过程偏向探索性而非系统化,规约复用性低,容易引入编程错误。
方法
给出强化学习问题与时序差分算法的形式规约,并基于函数式纯规约、指称语义、组合解释器与基于属性的测试构建DSL测试预言机。
评估
在多个强化学习示例上验证测试框架,并使用变异测试评估有效性,显示高变异体杀死率及通用测试的复用效果。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@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}
}