-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Update TRL README with GRPO example details and usage instructi…
…ons (#76)
- Loading branch information
1 parent
a8e11e7
commit 7b72c34
Showing
3 changed files
with
37 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
1. Install the requirements in the txt file | ||
# TRL Examples | ||
|
||
``` | ||
This directory contains examples using the [TRL (Transformer Reinforcement Learning) library](https://github.com/huggingface/trl) to fine-tune language models with reinforcement learning techniques. | ||
|
||
## GRPO Example | ||
|
||
The main example demonstrates using GRPO (Group Relative Policy Optimization) to fine-tune a language model on reasoning tasks from reasoning-gym. It includes: | ||
|
||
- Custom reward functions for answer accuracy and format compliance | ||
- Integration with reasoning-gym datasets | ||
- Configurable training parameters via YAML config | ||
- Wandb logging and model checkpointing | ||
- Evaluation on held-out test sets | ||
|
||
## Setup | ||
|
||
1. Install the required dependencies: | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## Usage | ||
|
||
1. Configure the training parameters in `config/grpo.yaml` | ||
2. Run the training script: | ||
|
||
```bash | ||
python main_grpo_reward.py | ||
``` | ||
|
||
The model will be trained using GRPO with the specified reasoning-gym dataset and evaluation metrics will be logged to Weights & Biases. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters