RLHF · PbRL | 选择 near on-policy query,加速 policy learning 收敛速度

发布时间 2023-12-17 15:31:47作者: MoonOut

0 abstract

Preference-based reinforcement learning (PbRL) provides a natural way to align RL agents’ behavior with human desired outcomes, but is often restrained by costly human feedback. To improve feedback efficiency, most existing PbRL methods focus on selecting queries to maximally improve the overall quality of the reward model, but counter-intuitively, we find that this may not necessarily lead to improved performance. To unravel this mystery, we identify a long-neglected issue in the query selection schemes of existing PbRL studies: Query-Policy Misalignment. We show that the seemingly informative queries selected to improve the overall quality of reward model actually may not align with RL agents’ interests, thus offering little help on policy learning and eventually resulting in poor feedback efficiency. We show that this issue can be effectively addressed via near on-policy query and a specially designed hybrid experience replay, which together enforce the bidirectional query-policy alignment. Simple yet elegant, our method can be easily incorporated into existing approaches by changing only a few lines of code. We showcase in comprehensive experiments that our method achieves substantial gains in both human feedback and RL sample efficiency, demonstrating the importance of addressing query-policy misalignment in PbRL tasks.

  • background: PbRL 提供了一种自然的方法,使 RL agent 的行为与人类期望一致,但 human feedback 通常 expensive。为了提高 feedback-efficiency,现有的大多数 PbRL 方法,都侧重于 query selection 的优化,希望选择 reward model 质量提升的 queries,但与直觉相反,我们发现,这不一定会导致性能提高。
  • 问题:为了解开这个谜团,我们在现有 PbRL 工作的 query selection 方案中,发现了一个长期被忽视的问题:query 与 policy 的 misalignment。我们发现,选择的看似 informative 的 query,实际上可能与 RL agent 的兴趣不一致,因此对 policy learning 几乎没有帮助,最终导致 feedback-efficiency 低下。
  • method:我们表明,这个问题可以通过 ① near on-policy query + ② 专门设计的 hybrid experience replay 来有效解决,它们共同强制 query-policy 的 alignment。简单而优雅,只需更改几行代码,该技术即可轻松合并到现有方法中。
  • result:实验表明,我们的方法在 human feedback-efficiency 和 RL sample-efficiency 方面,都取得了实质性的收益,这证明,解决 PbRL 任务中 query-policy misalignment 的问题,具有重要性。

4 query-policy misalignment & 5 query-policy alignment (QPA)

query-policy misalignment:

  • a motivating example:在一个 agent 从坐标 (0,0) 跑到 (10,10) 的环境中,发现基于 disagreement 选取的 queries,都跟当前策略真正会访问的 state-action 分布不太一样。
  • 相当于,teacher 提供了一些情况下的 preference,但 policy 根本不会遇到这些情况;reward function 可能全局上更好了,但对于 policy learning 没什么贡献。(感觉像我导会说的话,world model 更好了,但控制真的需要这么好的 world model 嘛,world model 更好会直接让控制更好嘛,之类的话)

near on-policy query selection:

  • 直译:几乎 on-policy 的 query selection。
  • 直接把当前 policy 最新生产的 trajectory,拿去当 queried segments。
  • 作者声称很好实现,把存储 query selection 的 replay buffer 的 size 改小即可,这样 replay buffer 里就只能存下最新生产的 trajectory 了。

关键技术:

  • ① near on-policy query selection,就像前面说的那样。
  • ② hybrid experience replay。
    • 在学 Q function 的时候,对于(比如说)DQN ,因为是 off-policy 算法,所以一般会随机采样一些 transition,来最小化 TD-error、更新 Q function。
    • 这里提出了新的采样策略:一半数据直接从 near on-policy 的 replay buffer 里面采样,另一半则均匀随机 uniform 采样。
    • 作者声称,这样可以实现 1. 提高 Q learning 效率、2. 让 Q function 不至于落入局部最优 的权衡。

理论 insight:

  • \(\|\hat r_\psi-r\|_{d^\pi}\le\epsilon\)\(\|Q^\pi_{\hat r_\psi}-\hat Q^\pi_{\hat r_\psi}\|_{d^\pi}\le\alpha\) ,则有 upper bound \(\|Q_r^\pi-\hat Q^\pi_{\hat r_\psi}\|_{d^{\pi}} \le\frac{\epsilon}{1-\gamma}+\alpha\)
  • hat r_ψ :学到的 reward model;r :ground truth reward;Q hat : Q-learning 学出来的 Q function;Q 真正的 Q value。
  • Q value 需要在同一 policy 的 state-action 分布下计算( \(d^\pi\) 下标)。理论 insight:希望分布 \(d^\pi\) 下的 reward model 与 ground truth reward 尽可能接近,因此要多在分布 \(d^\pi\) 下学 reward。

关键技术:

  • ③ 还使用了 reward learning 的 data augmentation(类似 这篇博客 4.2 节 记录的做法)。后面做了对 data augmentation 的 ablation。

(一个实验画图的细节: figure 6 中,黑色虚线表示最后一个 feedback 收集步骤)