feat(examples): add skill-rl for training models on markdown instructions#753
Open
menonpg wants to merge 1 commit into
Open
feat(examples): add skill-rl for training models on markdown instructions#753menonpg wants to merge 1 commit into
menonpg wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 evaluationskills/git-commit/: Conventional commit message generator skill + training tasksskills/code-review/: Structured code review skill + training tasksHow it works
The reward function evaluates three dimensions:
Example results (from README)
Training Qwen 2.5 3B on the git-commit skill:
A 3B model trained with ART can outperform 100x larger models on specific skills.
Usage
Happy to iterate on this based on feedback!