TRL documentation
TRL - Transformer Reinforcement Learning
Get started
API
Model ClassesTrainer ClassesTraining your own reward modelSupervised fine-tuningExtras - Better model output without reinforcement learning
Examples
You are viewing v0.4.7 version. A newer version v1.9.0 is available.

TRL - Transformer Reinforcement Learning
With the TRL (Transformer Reinforcement Learning) library you can train transformer language models with reinforcement learning. The library is integrated with 🤗 transformers.
TRL supports decoder models such as GPT-2, BLOOM, GPT-Neo which can all be optimized using Proximal Policy Optimization (PPO). You can find installation instructions in the installation guide and an introduction to the library in the Quickstart section. There is also a more in-depth example to tune GPT-2 to produce positive movie reviews.