mirror of
https://github.com/wassname/alignment-handbook.git
synced 2026-06-27 16:14:07 +08:00
Update readme
This commit is contained in:
@@ -1,20 +1,36 @@
|
|||||||
# The RLHF Handbook
|
# The RLHF Handbook
|
||||||
|
|
||||||
Robust recipes for RLHF
|
Robust recipes for Reinforcement Learning from Human Feedback (RLHF) and related techniques to steer language models.
|
||||||
|
|
||||||
## Developing
|
## What is this?
|
||||||
To view this locally, run the following (need to point to a specific language if previewing only one section, preview/`build_doc` does not use the `--language` flag):
|
|
||||||
```shell
|
|
||||||
doc-builder preview rlhf-handbook {docs_dir} --not_python_module
|
|
||||||
```
|
|
||||||
Example `docs_dir` is `~/Documents/HuggingFace/dev/rlhf-handbook/chapters/en`
|
|
||||||
|
|
||||||
## Installation
|
Just one year ago, chatbots were out of fashion and most people hadn't heard about techniques like RLHF to align language models with human preferences. Then, OpenAI broke the internet with ChatGPT and Meta followed suit by releasing the Llama series of language models which enabled the ML community to build their very own capable chatbots. This has led to a rich ecosystem of datasets and models that have mostly focused on teaching language models to follow instructions through supervised fine-tuning (SFT).
|
||||||
Create a new conda environment with:
|
|
||||||
```shell
|
However, we know from the [InstructGPT](https://huggingface.co/papers/2203.02155) and [Llama2](https://huggingface.co/papers/2307.09288) papers that significant gains in helpfulness and safety can be had by augmenting SFT with human (or AI) preferences. At the same time, combining reinforcement learning with NLP is a fairly novel idea and there are few pubic resources available on how to train these models, what data to collect, and what metrics to measure for best downstream performance.
|
||||||
conda create -n rlhf-handbook python=3.10
|
|
||||||
```
|
The RLHF Handbook aims to fill that gap by providing the community with a series of robust training recipes that span the whole RLHF pipeline.
|
||||||
Install the limited requirements with
|
|
||||||
```shell
|
## Contents
|
||||||
pip install -r requirements.txt
|
|
||||||
|
The initial release of the handbook will focus on the following techniques:
|
||||||
|
|
||||||
|
* **Supervised fine-tuning:** teach languge language models to follow instructions and tips on how to collect and curate your own training dataset.
|
||||||
|
* **Reward modeling:** teach language models to distinguish model responses according to human or AI preferences.
|
||||||
|
* **Rejection sampling:** a simple, but powerful technique to boost the performance of your SFT model.
|
||||||
|
* **Proximal policy optimization (PPO):** the workhorse of RLHF, but notoriously sensitive to hyperparameters (like all good RL algorithms).
|
||||||
|
* **Direct preference optimisation (DPO):** a powerful and promising alternative to PPO.
|
||||||
|
|
||||||
|
## Citation
|
||||||
|
|
||||||
|
If you find the content of this repo useful in your work, please cite it as follows:
|
||||||
|
|
||||||
|
```bibtex
|
||||||
|
@misc{rlhf_handbook2023,
|
||||||
|
author = {Lewis Tunstall and Edward Beeching and Nathan Lambert and Nazneen Rajani and Thomas Wolf},
|
||||||
|
title = {The RLHF Handbook},
|
||||||
|
year = {2023},
|
||||||
|
publisher = {GitHub},
|
||||||
|
journal = {GitHub repository},
|
||||||
|
howpublished = {\url{https://github.com/huggingface/rlhf-handbook}}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
- title: Unit 0. Welcome to the course!
|
- title: Unit 0. Welcome to the RLHF Handbook!
|
||||||
sections:
|
sections:
|
||||||
- local: chapter0/introduction
|
- local: chapter0/introduction
|
||||||
title: What to expect from the course
|
title: What is this about?
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
# Welcome to the RLHF Handbook!
|
# Welcome to the RLHF Handbook!
|
||||||
We are going to...
|
|
||||||
|
Stay tuned for more details 🤗
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
hf-doc-builder>=0.4.0
|
|
||||||
black>=23.3.0
|
|
||||||
watchdog>=3.0.0
|
|
||||||
Reference in New Issue
Block a user