#158 · Primary category: Deep Learning Frameworks

TextRL

chatgpt controlled-nlg gpt-2 gpt-3 language-model nlg nlp pytorch reinforcement-learning rlhf

Implementation of ChatGPT RLHF (Reinforcement Learning with Human Feedback) on any generation model in huggingface's transformer (blommz-176B/bloom/gpt/bart/T5/MetaICL)

Project last updated:04/23/26

GitHub Stars

564

Forks

61

Contributors

3

License

MIT

Why we included this project

TextRL is for teams that want to fine-tune a language model with reinforcement learning but would rather not wrestle the raw HuggingFace TRL API. It layers a single configuration dataclass and one trainer class per algorithm family over TRL, so switching between GRPO, RLOO, DPO, KTO, or reward-model training usually means editing a few config fields instead of rewriting the training loop. Rewards are plain callables you can decorate and compose, and any HuggingFace pipeline can act as a classifier-based reward, which is handy when you want generation steered toward a measurable target. The library also covers the fiddly parts of real runs, including LoRA and QLoRA loading, accelerate-based distributed launches, and optional vLLM rollout for GRPO. If you already work inside TRL, this gives you a leaner interface for RLHF experiments without losing the underlying trainers.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category