On the Mistaken Assumption of Interchangeable Deep Reinforcement Learning Implementations

📄 arXiv: 2503.22575v2 📥 PDF

作者: Rajdeep Singh Hundal, Yan Xiao, Xiaochun Cao, Jin Song Dong, Manuel Rigger

分类: cs.SE, cs.AI

发布日期: 2025-03-28 (更新: 2025-10-31)

备注: Added the ACM Functional v1.1 badge, the full publication citation, and a link to the publication on IEEE Xplore

期刊: IEEE/ACM 47th International Conference on Software Engineering (ICSE), Ottawa, ON, Canada, 2025, pp. 2225-2237

DOI: 10.1109/ICSE55347.2025.00222


💡 一句话要点

揭示深度强化学习实现互换性假设的误区,强调代码一致性的重要性

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)

关键词: 深度强化学习 实现差异 差异测试 代码一致性 PPO算法 实验可重复性 算法评估

📋 核心要点

  1. 现有深度强化学习研究常假设同一算法的不同实现可以互换,忽略了实现细节可能带来的影响。
  2. 该研究通过差异测试,对比同一算法的不同实现,揭示了实现间存在显著差异,并分析了代码层面的不一致性。
  3. 实验结果表明,实现差异足以影响算法性能和实验结论,强调了在DRL研究中关注实现细节的重要性。

📝 摘要(中文)

深度强化学习(DRL)是一种人工智能范式,其中智能体使用神经网络来学习在给定环境中采取哪些行动。DRL最近因能够解决复杂的环境而备受关注,如驾驶模拟器、3D机器人控制和多人在线竞技场视频游戏。目前存在许多用于训练这些智能体的最先进算法的实现,例如深度Q网络(DQN)和近端策略优化(PPO)算法。然而,研究常常错误地假设同一算法的实现是一致的,因此可以互换。在本文中,我们通过差异测试的角度,展示了研究实现不一致程度、它们对实现性能的影响以及它们对先前研究结论的影响的结果,这些结论是在实现可互换的假设下得出的。我们的差异测试结果显示,被测算法实现之间存在显着差异,表明它们不可互换。特别是,在56个游戏中测试的五个PPO实现中,三个实现在其总试验的50%中实现了超人的性能,而其他两个实现仅在其总试验的不到15%中实现了超人的性能。作为对实现源代码进行细致的手动分析的一部分,我们分析了实现差异,并确定代码级别的不一致是造成这些差异的主要原因。最后,我们复制了一项研究,表明这种实现可互换的假设足以颠覆实验结果。因此,这要求转变实现的使用方式。

🔬 方法详解

问题定义:现有深度强化学习研究常常假设同一算法的不同实现是等价的,可以互换使用。然而,不同实现的代码细节、参数设置等差异可能会导致性能差异,从而影响研究结论的可靠性。该论文旨在验证这一假设是否成立,并探究实现差异对DRL算法性能的影响。

核心思路:该论文的核心思路是通过差异测试,对比同一DRL算法的不同实现,观察它们的性能差异。如果不同实现的结果存在显著差异,则说明实现互换的假设不成立。此外,通过分析代码,找出导致性能差异的关键因素。

技术框架:该研究的技术框架主要包括以下几个步骤:1) 选择常用的DRL算法(如PPO)和多个开源实现;2) 在多个benchmark环境上运行这些实现;3) 对比不同实现的性能指标(如平均奖励、成功率等);4) 对比结果进行统计分析,判断是否存在显著差异;5) 对比实现的源代码,找出导致性能差异的关键代码片段。

关键创新:该论文的关键创新在于,它首次系统性地研究了DRL算法实现之间的差异,并证明了实现互换的假设是不成立的。这对于DRL研究的可靠性和可重复性具有重要意义。

关键设计:该研究的关键设计包括:1) 选择了多个常用的DRL算法实现,避免了结果的偶然性;2) 在多个benchmark环境上进行测试,保证了结果的泛化性;3) 采用了统计分析方法,保证了结果的可靠性;4) 通过代码分析,找到了导致性能差异的关键因素。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,同一PPO算法的不同实现,在56个游戏中表现出显著差异。例如,五个PPO实现中,三个实现在50%的试验中达到超人性能,而另外两个实现仅在不到15%的试验中达到。通过代码分析,发现代码层面的不一致是导致性能差异的主要原因。此外,复制实验表明,实现互换的假设足以颠覆实验结果。

🎯 应用场景

该研究成果对深度强化学习领域的实践和研究具有重要指导意义。开发者在选择DRL算法实现时,应充分考虑不同实现的差异,避免盲目使用。研究者在进行实验时,应明确说明所使用的实现版本和配置,以保证实验结果的可重复性和可比性。该研究也为DRL算法的标准化和规范化提供了参考。

📄 摘要(原文)

Deep Reinforcement Learning (DRL) is a paradigm of artificial intelligence where an agent uses a neural network to learn which actions to take in a given environment. DRL has recently gained traction from being able to solve complex environments like driving simulators, 3D robotic control, and multiplayer-online-battle-arena video games. Numerous implementations of the state-of-the-art algorithms responsible for training these agents, like the Deep Q-Network (DQN) and Proximal Policy Optimization (PPO) algorithms, currently exist. However, studies make the mistake of assuming implementations of the same algorithm to be consistent and thus, interchangeable. In this paper, through a differential testing lens, we present the results of studying the extent of implementation inconsistencies, their effect on the implementations' performance, as well as their impact on the conclusions of prior studies under the assumption of interchangeable implementations. The outcomes of our differential tests showed significant discrepancies between the tested algorithm implementations, indicating that they are not interchangeable. In particular, out of the five PPO implementations tested on 56 games, three implementations achieved superhuman performance for 50% of their total trials while the other two implementations only achieved superhuman performance for less than 15% of their total trials. As part of a meticulous manual analysis of the implementations' source code, we analyzed implementation discrepancies and determined that code-level inconsistencies primarily caused these discrepancies. Lastly, we replicated a study and showed that this assumption of implementation interchangeability was sufficient to flip experiment outcomes. Therefore, this calls for a shift in how implementations are being used.