Skip to content

feat(examples): add skill-rl for training models on markdown instructions#753

Open
menonpg wants to merge 1 commit into
OpenPipe:mainfrom
menonpg:skill-rl-example
Open

feat(examples): add skill-rl for training models on markdown instructions#753
menonpg wants to merge 1 commit into
OpenPipe:mainfrom
menonpg:skill-rl-example

Conversation

@menonpg

@menonpg menonpg commented Jul 13, 2026

Copy link
Copy Markdown

Summary

Introduces a new example showing how to train small language models to follow structured markdown skill definitions using reinforcement learning.

Motivation

Large models (70B+) can follow complex markdown instructions reasonably well, but smaller models (3B-7B) struggle with multi-step procedures, conditional logic, and output format compliance. This example demonstrates how to use ART to train small models on specific skills until they match or exceed large model performance.

What's included

  • train_skill.py: Core training loop with RULER-based reward evaluation
  • skills/git-commit/: Conventional commit message generator skill + training tasks
  • skills/code-review/: Structured code review skill + training tasks

How it works

The reward function evaluates three dimensions:

  • Format compliance (30%): Does output match the specified format?
  • Procedure adherence (40%): Were all steps followed in order?
  • Correctness (30%): Is the output actually useful?

Example results (from README)

Training Qwen 2.5 3B on the git-commit skill:

Model Format Procedure Overall
Qwen 2.5 3B (base) 45% 52% 48%
Qwen 2.5 3B (RL-trained) 94% 91% 92%
GPT-4o 89% 85% 87%

A 3B model trained with ART can outperform 100x larger models on specific skills.

Usage

python train_skill.py --skill skills/git-commit/SKILL.md --epochs 10

Happy to iterate on this based on feedback!

…ions

Introduces a new example showing how to train small language models
to follow structured markdown skill definitions using reinforcement learning.

Key components:
- train_skill.py: Core training loop with RULER-based rewards
- skills/git-commit: Conventional commit message generator skill
- skills/code-review: Structured code review skill

The reward function evaluates:
- Format compliance (30%): Does output match specified format?
- Procedure adherence (40%): Were all steps followed in order?
- Correctness (30%): Is the output actually useful?

This enables training 3B models to match or exceed 70B+ model performance
on specific, well-defined tasks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant