Skip to content

Fine-tuning recipes for LLMs covering SFT, DPO, PPO/GRPO, and reward model training with HuggingFace TRL.

CCM score
59 of 100
skills.sh installs
1.1K
GitHub stars
14.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers full RLHF flow (SFT, reward model, PPO), DPO preference alignment, and GRPO online RL with reward functions
  • Includes runnable Python and CLI examples using TRL trainers, DPOConfig, GRPOConfig, and trl dpo/trl grpo commands
  • Requires preference data in chosen/rejected pairs for DPO and reward training, and prompt-completion pairs for SFT
  • Designed for practitioners aligning Transformers-based models with human feedback or custom reward signals

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill fine-tuning-with-trl -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

TRL - Transformer Reinforcement Learning

Quick start

TRL provides post-training methods for aligning language models with human preferences.

Installation:

pip install trl transformers datasets peft accelerate

Supervised Fine-Tuning (instruction tuning):

from trl import SFTTrainer

trainer = SFTTrainer(
    model="Qwen/Qwen2.5-0.5B",
    train_dataset=dataset,  # Prompt-completion pairs
)
trainer.train()

DPO (align with preferences):

from trl import DPOTrainer, DPOConfig

config = DPOConfig(output_dir="model-dpo", beta=0.1)
trainer = DPOTrainer(
    model=model,
    args=config,
    train_dataset=preference_dataset,  # chosen/rejected pairs
    processing_class=tokenizer
)
trainer.train()

Common workflows

Workflow 1: Full RLHF pipeline (SFT → Reward Model → PPO)

Complete pipeline from base model to human-aligned model.

Copy this checklist:

RLHF Training:
- [ ] Step 1: Supervised fine-tuning (SFT)
- [ ] Step 2: Train reward model
- [ ] Step 3: PPO reinforcement learning
- [ ] Step 4: Evaluate aligned model

Step 1: Supervised fine-tuning

Train base model on instruction-following data:

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
AI Agents & LLM Apps, Data Science & Analytics, Python
First seen
Jun 3, 2026

Questions

What does the fine-tuning-with-trl skill do?

fine-tuning-with-trl teaches an agent to post-train language models with TRL, covering SFT for instruction tuning, DPO for preference alignment, PPO and GRPO for reward optimization, and reward model training. It works with HuggingFace Transformers and is aimed at RLHF and training from human feedback.

How do I install the fine-tuning-with-trl skill?

Run npx -y skills add orchestra-research/ai-research-skills --skill fine-tuning-with-trl -y in your project. Once installed, fine-tuning-with-trl lets the agent walk through SFT, DPO, GRPO and reward model workflows with TRL.

What does fine-tuning-with-trl need to run?

fine-tuning-with-trl relies on the trl, transformers, datasets, peft, accelerate and torch packages, installed with pip. Its workflows also load models and datasets from HuggingFace, so fine-tuning-with-trl assumes a Python environment with those libraries.

Which AI Agents & LLM Apps skill should I use for preference alignment with TRL?

fine-tuning-with-trl is in the AI Agents & LLM Apps category on Claude Marketplaces, alongside microsoft-foundry and azure-ai. fine-tuning-with-trl sets itself apart by covering the full post-training path, from SFT through reward modeling to PPO and GRPO, with DPO for preference alignment.

More from orchestra-research/ai-research-skills

All 92

Similar to Fine Tuning With Trl

More AI Agents & LLM Apps