rlhf.md 1.25 KB
Newer Older
Harry Mellor's avatar
Harry Mellor committed
1
2
# Reinforcement Learning from Human Feedback

3
Reinforcement Learning from Human Feedback (RLHF) is a technique that fine-tunes language models using human-generated preference data to align model outputs with desired behaviors.
Harry Mellor's avatar
Harry Mellor committed
4

Daniel Han's avatar
Daniel Han committed
5
vLLM can be used to generate the completions for RLHF. Some ways to do this include using libraries like [TRL](https://github.com/huggingface/trl), [OpenRLHF](https://github.com/OpenRLHF/OpenRLHF), [verl](https://github.com/volcengine/verl) and [unsloth](https://github.com/unslothai/unsloth).
Harry Mellor's avatar
Harry Mellor committed
6
7
8

See the following basic examples to get started if you don't want to use an existing library:

9
10
11
- [Training and inference processes are located on separate GPUs (inspired by OpenRLHF)](../examples/offline_inference/rlhf.md)
- [Training and inference processes are colocated on the same GPUs using Ray](../examples/offline_inference/rlhf_colocate.md)
- [Utilities for performing RLHF with vLLM](../examples/offline_inference/rlhf_utils.md)
Daniel Han's avatar
Daniel Han committed
12
13
14

See the following notebooks showing how to use vLLM for GRPO:

15
- [Efficient Online Training with GRPO and vLLM in TRL](https://huggingface.co/learn/cookbook/grpo_vllm_online_training)
Daniel Han's avatar
Daniel Han committed
16
- [Qwen-3 4B GRPO using Unsloth + vLLM](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_(4B)-GRPO.ipynb)