offline RL | TD3+BC:在最大化 Q advantage 时添加 BC loss 的极简算法

发布时间 2023-11-19 17:10:18作者: MoonOut



0 abstract

Offline reinforcement learning (RL) defines the task of learning from a fixed batch of data. Due to errors in value estimation from out-of-distribution actions, most offline RL algorithms take the approach of constraining or regularizing the policy with the actions contained in the dataset. Built on pre-existing RL algorithms, modifications to make an RL algorithm work offline comes at the cost of additional complexity. Offline RL algorithms introduce new hyperparameters and often leverage secondary components such as generative models, while adjusting the underlying RL algorithm. In this paper we aim to make a deep RL algorithm work while making minimal changes. We find that we can match the performance of state-of-the-art offline RL algorithms by simply adding a behavior cloning term to the policy update of an online RL algorithm and normalizing the data. The resulting algorithm is a simple to implement and tune baseline, while more than halving the overall run time by removing the additional computational overheads of previous methods.

  • 背景:
    • Offline RL 定义了从 a fixed batch of data 中学习的任务。
    • 由于 OOD action 的 value estimation error,大多数 offline RL 算法使用 ID action 去约束或正则化策略。
    • 因此,可以说建立在原来的 online RL 算法之上,让它变成 offline RL,是以增加复杂性为代价的: offline RL 算法引入了新的超参数,并且通常利用生成模型(generative models)等辅助组件,同时还会调整底层的 RL 算法。
  • method & result:
    • 本文的目标是,让 DRL 算法在最小更改下 work。
    • 我们发现,只需在 online RL 算法的策略更新中,添加行为克隆项(behavior cloning term)并 normalize 数据,就可匹配 sota offline RL 算法的性能。
    • 我们的算法是易于实现和 tune 的 baseline,同时,通过消除先前 offline 方法的额外计算开销,将总体运行时间缩短了一半以上。

4 Challenges in Offline RL - offline RL 中的挑战

  • Implementation and Tuning Complexities - 算法实现与微调的复杂度。
  • Extra Computation Requirement - 额外的计算需求。
    • CQL 好像会有 log sum exp 的操作,计算量大。
  • Instability of Trained Policies - 训出来的策略的不稳定性。
    • 在 online RL 中,如果当前策略不尽如人意,我们可以使用策略先前迭代的 checkpoint,或者干脆继续训练。
    • 但是,在 offline RL 中,根据定义,评估应该只发生一次,这大大增加了评估时单个策略的重要性。
    • 我们重点介绍了 offline RL 中的两种不稳定性。
    • 图 2 显示,offline trained policy 在单次评估期间表现出巨大的 performance 差异。因此,即使平均表现合理,agent 在某些 episode 上仍可能表现不佳。
    • 图 3 表示了一组评估(应该是同一 episode 内)的不稳定性,这意味着 agent 的 performance 可能取决于,为 evaluation 选择的特定停止点。(可能是猎豹跑着跑着就栽了嘛?)

5 A Minimalist Offline RL Algorithm - 极简 Offline RL 算法

  • 主要的 method 就是公式 3 4 5,其中:
    • 公式 3 纳入了一个 behavior cloning 的 loss;
    • 公式 4 是 observation 归一化;
    • 公式 5 让 Q advantage 跟 behavior cloning 的 loss 可比。

6 Experiments

  • settings:
    • 主要使用两个 baselines: CQL、Fisher-BRC。
    • 其他 baselines: BRAC 和 AWAC(据作者说算法简单)、Behavior Cloning。
    • benchmark: D4RL benchmark of OpenAI gym MuJoCo tasks。
  • results:
    • 看图就好了。
    • 比较了算法们的训练时间,TD3 + BC 训练时间最短。
    • 图 2 3 显示的稳定性问题。(见上面 section 4 的笔记)
  • ablation:
    • 师兄提到的一点:可以预见的是,删除 state normalization 的影响是最小的,但它仍然有好处,并且只是一个微小的调整。对应 Figure 5 最后一张图。