Production-grade ML training notebooks. DPO, RLHF, LoRA, Diffusion, Audio, Vision — all runnable for free on Kaggle T4x2 or Google Colab.
DPO skips reward modeling and RL entirely. It trains the model directly on human preference pairs using a reformulation of the RLHF objective.
loss = -log( sigmoid( β · [ log(P/P_ref)_chosen - log(P/P_ref)_rejected ] ) )
β controls conservatism. Higher β = model stays closer to the original.
Train the same model with 4 different alignment methods. Compare quality AND training performance side by side.
The complete 3-stage alignment pipeline on Qwen2.5-0.5B. SFT teaches instruction following, DPO aligns offline, PPO/RLHF aligns online.
Train all 3 methods on the same model and data. Compare GPU memory, speed, and output quality side by side.
Direct Preference Optimization on TinyLlama. Learn how DPO works by training it yourself with real preference pairs.
Production-grade distributed training. Same code scales from 1 GPU to 100 GPUs with Ray Train orchestration.
Two-stage alignment on free Kaggle GPUs. SFT teaches instruction following, then DPO aligns with preferences. Auto-detects your hardware.
Fine-tune LLaVA 7B vision-language model. LoRA in 8-bit, QLoRA in 4-bit, then DPO to prefer detailed image descriptions.
Teach Stable Diffusion a new style or concept. LoRA on UNet attention layers — tiny adapters (~1MB), same results.
LoRA fine-tune ViT-base on Food-101. A text transformer that reads image patches instead of words.
Fine-tune Whisper-small for speech-to-text with LoRA. Multi-GPU with DeepSpeed on freely available FLEURS data.
Fine-tune Qwen2-VL-2B on image+text data with LoRA and multi-GPU acceleration.
Actually train all 124M parameters of GPT-2 end-to-end. ZeRO-3 shards the entire model across GPUs + CPU.
The simplest possible distributed fine-tuning notebook. GPT-2 + LoRA + DeepSpeed on 500 Alpaca examples. Start here.
Run identical training with DDP, ZeRO-2, and ZeRO-3. See exactly how much speedup and memory savings each gives you.
See a raw model become an assistant. Generate text at Base → SFT → DPO and compare side-by-side. The simplest possible explanation of post-training.
Train Qwen2.5-1.5B to solve math problems using pure RL. No reward model, no CoT data — just "is the answer correct?" The algorithm behind DeepSeek-R1.
QLoRA fine-tune Qwen2.5-7B on A100 40GB. 2048-token sequences, 4-bit NF4, benchmarked on 4 Open LLM Leaderboard tasks vs Llama-2, Mistral, Llama-3.
Full fine-tuning with modern techniques: cosine LR, gradient checkpointing, weight decay. Benchmarked against TruthfulQA (Open LLM Leaderboard).
Evaluate model outputs using LLM and VLM judges. Three methods: automated metrics, rule-based scoring, and model-as-judge. All local, no API needed.
Treat agent reasoning as a search over executable traces. 10 strategies × 3 benchmarks (ARC / SWE / MLE-style), 5-dim weighted scoring, hybrid trace synthesis, beam-search pruning, plus a TraceEvaluator that diagnoses failures and emits concrete retry actions. Rescues 4/4 failing strategies (26/30 → 30/30).