$npx skillfedfor your agent

fine-tuning-with-trl

This skill teaches you to apply reinforcement learning techniques for aligning language models with human preferences. It covers supervised fine-tuning for instruction following, direct preference optimization for preference alignment, PPO and GRPO for reward-based training, and reward model development—all integrated with HuggingFace Transformers.

Fine-tuning-with-trl enables you to align language models using supervised fine-tuning, DPO, PPO, and GRPO reinforcement learning methods.

AI-generated summary based on this skill's SKILL.md

2,795 327 MITupdated by moltis-org

Decision gist · record as of 2026-07-27

Fine-tuning-with-trl enables you to align language models using supervised fine-tuning, DPO, PPO, and GRPO reinforcement learning methods. This skill teaches you to apply reinforcement learning techniques for aligning language models with human preferences. It covers supervised fine-tuning for instruction following, direct preference optimization for preference alignment, PPO and GRPO for reward-based training, and reward model development—all integrated with HuggingFace Transformers.

manual: git clone https://github.com/moltis-org/moltis → cp -r moltis/crates/skills/src/assets/mlops/training/fine-tuning-with-trl ~/.claude/skills/fine-tuning-with-trl
crates/skills/src/assets/mlops/training/fine-tuning-with-trl/SKILL.md · version 25d21b22

Use it when

  • fine-tuning-with-trl covers multiple alignment approaches: DPO (direct preference optimization) for preference-based training without.
  • Yes.

Verify before relying

Read SKILL.md below before installing (7 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

moltis-org/moltis/fine-tuning-with-trl · repository language: Rust

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I fine-tune an LLM with reinforcement learning using fine-tuning-with-trl?

fine-tuning-with-trl teaches you to apply reinforcement learning techniques for aligning language models with human preferences. You'll learn supervised fine-tuning for instruction following, direct preference optimization (DPO) for preference alignment, and PPO/GRPO for reward-based training—all integrated with HuggingFace Transformers to build complete alignment workflows.

What alignment methods does fine-tuning-with-trl cover for human preference matching?

fine-tuning-with-trl covers multiple alignment approaches: DPO (direct preference optimization) for preference-based training without explicit reward models, PPO (proximal policy optimization) for reinforcement learning from human feedback, and GRPO for memory-efficient online RL training. Each method integrates with HuggingFace to align models with human preferences at different scales.

Can I train a reward model for RLHF pipelines with fine-tuning-with-trl?

Yes. fine-tuning-with-trl includes reward model training as a core component of its full RLHF workflow. You'll learn to develop reward models that score model outputs, which then guide policy optimization through PPO or other RL methods to create complete preference-aligned language model training pipelines.

Does fine-tuning-with-trl support memory-efficient online RL training?

Yes. fine-tuning-with-trl includes GRPO (Group Relative Policy Optimization) for memory-efficient online reinforcement learning training. GRPO reduces memory overhead compared to traditional PPO while maintaining effective policy optimization, making it practical for fine-tuning larger models on limited hardware.

What is the license for fine-tuning-with-trl?

fine-tuning-with-trl is released under the MIT license, allowing free use, modification, and distribution for both commercial and personal projects with minimal restrictions.

How does fine-tuning-with-trl implement a full RLHF workflow?

fine-tuning-with-trl guides you through the complete RLHF pipeline: starting with supervised fine-tuning (SFT) for instruction following, building reward models to score outputs, then applying PPO or DPO for policy optimization. This end-to-end approach integrates all components needed to align language models with human feedback.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

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): ```python 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

(truncated - see the full file via the links below)

File tree — 7 files
crates/skills/src/assets/mlops/training/fine-tuning-with-trl/SKILL.md
crates/skills/src/assets/mlops/training/fine-tuning-with-trl/references/dpo-variants.md
crates/skills/src/assets/mlops/training/fine-tuning-with-trl/references/grpo-training.md
crates/skills/src/assets/mlops/training/fine-tuning-with-trl/references/online-rl.md
crates/skills/src/assets/mlops/training/fine-tuning-with-trl/references/reward-modeling.md
crates/skills/src/assets/mlops/training/fine-tuning-with-trl/references/sft-training.md
crates/skills/src/assets/mlops/training/fine-tuning-with-trl/templates/basic_grpo_training.py

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Fine-tune language models using reinforcement learning methods”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

fine-tuning-with-trl
by Orchestra-Research · Orchestra-Research/AI-Research-SKILLs

Fine-tuning with TRL provides post-training methods to align language models with human preferences through multiple approaches. Train models on instruction data with SFT, optimize for preference alignment via DPO without a separate reward model, or run full RLHF pipelines combining supervised fine-tuning, reward modeling, and PPO optimization. GRPO offers memory-efficient online reinforcement learning for resource-constrained setups.

MITupdated Jun 2026
★ 11,165repo stars
fine-tuning-with-trl
by NousResearch · NousResearch/hermes-agent

This skill teaches post-training techniques for aligning language models to human preferences. It covers supervised fine-tuning, direct preference optimization (DPO), and online reinforcement learning methods like RLOO and GRPO, with complete workflows and practical examples.

MITupdated Jul 2026
★ 221,503repo stars
llamafactory
by Prism-Shadow · Prism-Shadow/penguin-harness

LlamaFactory streamlines LLM fine-tuning through YAML-driven configs, supporting LoRA, QLoRA, and full-parameter training methods like SFT and DPO. Register datasets, train your model, merge adapters, and export for standalone deployment or API serving. The skill guides you through GPU requirements, base model selection, and inference setup.

Apache-2.0updated Jul 2026
★ 205repo stars
colab-finetuning
by synthetic-sciences · synthetic-sciences/openscience

Run Unsloth-powered LLM training directly on Google Colab GPUs from openscience, connecting via WebSocket bridge for remote execution. Supports supervised fine-tuning, reinforcement learning, preference optimization, vision, and text-to-speech workflows across free T4 through paid A100 tiers.

Apache-2.0updated Jul 2026
★ 2,896repo stars
Unsloth Training
by duyet · duyet/codex-claude-plugins

Unsloth Training accelerates LLM fine-tuning through GRPO (reinforcement learning with reward functions) and SFT (supervised learning with input-output pairs). It cuts VRAM usage by 60% with FP8 training, speeds up mixed-length datasets via automatic packing, and supports vision model tuning, mobile deployment via ExecuTorch, and export to GGUF, Ollama, and vLLM.

no license declared → metadata onlyupdated Jul 2026
★ 8repo stars
huggingface-llm-trainer
by huggingface · huggingface/skills

Train language models on managed Hugging Face infrastructure using TRL's supervised fine-tuning, preference optimization, and reinforcement learning methods. The skill handles cloud GPU job submission, dataset validation, hardware selection, and automatic model persistence to the Hub, with optional GGUF conversion for local deployment via Ollama or llama.cpp.

Apache-2.0updated Jul 2026
★ 10,878repo stars

More skills llm-fine-tuning (MIT) · hugging-face-model-trainer (Apache-2.0) · Unsloth Training Skill (unlicensed) · unsloth-fine-tuning (Apache-2.0)

Tags
preference-alignmentreinforcement-learningmodel-traininghuman-feedbackrl-optimizationinstruction-followingpolicy-trainingreward-scoring