arXiv:2410.18252cs.LGcs.AI2024-10ICLR被引 68

让语言模型强化学习异步训练,提速40%且不降性能。

Asynchronous RLHF: Faster and More Efficient Off-Policy RL for Language Models

  • 分离生成与训练,异步处理新旧样本,提升计算效率。
  • 在线DPO算法对旧数据鲁棒,模型越大越稳定,可容忍更高偏离策略。
  • 适用于追求训练速度的场景,尤其适合大模型微调任务。

当前RLHF主流采用同步、在线策略的强化学习:从大语言模型(LLM)生成样本,用奖励模型打分,并基于模型自身输出进行学习。尽管效果良好,但计算效率低下。受经典深度强化学习启发,我们提出将生成与学习过程解耦,实现异步采样与训练,即在新样本生成的同时,用历史样本持续训练,从而加快训练速度并优化算力利用。然而,异步训练依赖于一个未充分探索的范式:在线但离策略的RLHF——使用前一迭代版本模型生成的样本进行学习,导致训练信号减弱。我们研究的核心问题是:异步训练能容忍多大程度的离策略性?实验表明,在多种算法中,线上直接偏好优化(DPO)对离策略数据最为鲁棒,且随着模型规模增大,鲁棒性进一步增强。我们还探索了额外的计算优化,但发现它们会带来性能损失,形成权衡。通过在LLaMA 3.1 8B上训练通用聊天机器人,在指令遵循任务中比同步训练快约40%,最终性能相当;扩展至数学推理任务,也使Rho 1B在GSM8k上的微调速度提升约70%,准确率保持一致。

原文摘要 · Abstract (English)

The dominant paradigm for RLHF is online and on-policy RL: synchronously generating from the large language model (LLM) policy, labelling with a reward model, and learning using feedback on the LLM's own outputs. While performant, this paradigm is computationally inefficient. Inspired by classical deep RL literature, we propose separating generation and learning in RLHF. This enables asynchronous generation of new samples while simultaneously training on old samples, leading to faster training and more compute-optimal scaling. However, asynchronous training relies on an underexplored regime, online but off-policy RLHF: learning on samples from previous iterations of our model which give a worse training signal. We tackle the fundamental challenge in this regime: how much off-policyness can we tolerate for asynchronous training to speed up learning but maintain performance? Among several RLHF algorithms we test, online DPO is found to be most robust to off-policy data, and robustness increases with the scale of the policy model. We study further compute optimizations for asynchronous RLHF but find that they come at a performance cost, giving rise to a trade-off. We verify the scalability of asynchronous RLHF by training a general-purpose chatbot from LLaMA 3.1 8B on an instruction-following task ~40% faster than a synchronous run while matching final performance. Finally, we extend our results to math and reasoning to demonstrate asynchronous RL can finetune Rho 1B on GSM8k ~70% faster while matching synchronous accuracy.

强化学习大模型微调异步训练高效学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。