<< All versions

Skill v1.0.1

currentAutomated scan100/100
ain3sh/.agents/ml-training

+5 new

──Details
PublishedNovember 6, 2026 at 05:12 AM
Content Hashsha256:f88a3a25b3afa2a3...
Git SHA1c03dbc46585
Bump Typepatch
Compare with v1.0.0
──Files
Files (1 file, 2.4 KB)
SKILL.md2.4 KBactive
SKILL.md · 71 lines · 2.4 KB

name: ml-training description: "LLM fine-tuning and alignment -- LoRA/QLoRA with PEFT, RLHF/DPO/GRPO with TRL, YAML-driven training with Axolotl. Use when fine-tuning language models, doing parameter-efficient training, preference alignment, reinforcement learning from human feedback, or configuring distributed training." disable-model-invocation: true metadata: version: "1.0.1"


LLM Fine-Tuning & Alignment

Decision Tree

What are you trying to do?
├── Fine-tune with LoRA/QLoRA (parameter-efficient)?
│ └── references/peft.md
├── Align model with human preferences (DPO/RLHF)?
│ └── references/trl.md
├── Full RLHF pipeline (SFT → Reward Model → PPO)?
│ └── references/trl.md
├── YAML-based training config (Axolotl)?
│ └── references/axolotl.md
└── Not sure which method?
└── See method selection below

Method Selection

MethodWhen to useMemory (7B)Reference
PEFT/LoRAFine-tune on limited GPU, train <1% params18 GBpeft.md
QLoRAFine-tune 70B on 24GB GPU6 GBpeft.md
SFT (TRL)Instruction tuning from prompt-completion pairs16 GBtrl.md
DPO (TRL)Preference alignment without reward model24 GBtrl.md
PPO (TRL)Full RLHF with reward model40 GBtrl.md
GRPO (TRL)Memory-efficient online RL24 GBtrl.md
AxolotlYAML-driven multi-method trainingvariesaxolotl.md

Quick Starts

LoRA fine-tuning (most common)

python
from peft import get_peft_model, LoraConfig
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B", device_map="auto")
model = get_peft_model(model, LoraConfig(r=16, lora_alpha=32, target_modules="all-linear"))
model.print_trainable_parameters() # ~0.17%

DPO alignment (simplest preference method)

python
from trl import DPOTrainer, DPOConfig
trainer = DPOTrainer(
model=model,
args=DPOConfig(output_dir="model-dpo", beta=0.1),
train_dataset=preference_dataset, # needs chosen/rejected columns
processing_class=tokenizer
)
trainer.train()

Axolotl (YAML config)

bash
accelerate launch -m axolotl.cli.train config.yaml
← v1.0.0All versions