Playbooks

Model Training, Fine-Tuning & Evaluation — 2026 Guide

A practical 2026 reference covering fine-tuning techniques, alignment methods, training frameworks, data curation, distributed training, evaluation harnesses, model optimization, and the open-weight ecosystem.


A practical map of the model training and fine-tuning landscape — the techniques, tools, and trade-offs I reach for, minus the hype.

01 — The Training Landscape

Model training in 2026 is a stack of stages, each with its own technique, data requirement, and compute profile. Understanding where each stage sits prevents the most common mistake: applying the wrong technique to the wrong problem. Training is one layer of a larger system, and the AI architecture field guide is where I work out when to reach for it at all rather than prompting or RAG.

The model training stack (stages run top → bottom):

StageDescriptionCost & scale
Pre-trainingTrain from scratch on massive text corpus (trillions of tokens). Creates the base model. Only done by frontier labs.$M+ · months · 1000s GPUs
Continued pre-trainingExtend the base model with domain-specific corpus (medical, legal, code). Rare — needs large domain data.$10K–100K+ · weeks
Supervised fine-tuning (SFT)Train on (instruction, response) pairs to teach specific behavior, format, tone. The most common fine-tuning.$100–5K · hours–days
Preference alignmentDPO / ORPO / RLHF on (chosen, rejected) pairs to refine quality, safety, style. Usually after SFT.$100–5K · hours–days
Post-training optimizationQuantization, distillation, pruning to make the model smaller/faster/cheaper for inference.$0–100 · minutes–hours

Where you fit in: Most practitioners work at the SFT + alignment layers. Pre-training and continued pre-training are frontier-lab territory (Anthropic, OpenAI, Meta). Your job as an AI architect is to know which layer solves your problem and which technique to apply at that layer.

02 — Fine-Tuning Techniques

The central question: how many parameters do you actually need to change? The answer determines your compute cost, data requirement, and quality ceiling.

TechniqueWhat it changesVRAMData neededWhen to use
Full fine-tuningAll model weightsVery high (~16 bytes/param ≈ 8× fp16 model size)10K+ examplesDeep domain adaptation; rarely needed for most tasks
LoRASmall low-rank adapter matrices (0.1–1% of params)Moderate (model + adapters)500–5K examplesDefault for 2026 — best quality/cost ratio
QLoRASame as LoRA but base model stays 4-bit quantizedLow (~50–70% less than LoRA)500–5K examplesMemory-constrained (single GPU, consumer hardware)
DoRALoRA + weight decomposition (magnitude + direction)Slightly more than LoRA500–5K examplesWhen LoRA quality isn’t quite enough; marginal improvement

The 2026 default: QLoRA SFT is the starting point for almost every fine-tuning project. LoRA when you have GPU headroom and need maximum throughput. Full fine-tuning only when adapters demonstrably can’t close the quality gap (rare). Unsloth’s optimized kernels make QLoRA only slightly slower than LoRA while using about 4x less VRAM.

How LoRA works (the key insight)

  • Instead of updating a huge weight matrix W (billions of params), LoRA freezes W and trains two small matrices A and B such that the update is ΔW = A × B.
  • Rank r controls adapter size: r=8 is common, r=16–64 for harder tasks. Higher rank = more capacity but more compute.
  • At inference, merge the adapter into the base model (zero overhead) or keep separate (swap adapters per task).
  • QLoRA adds 4-bit NF4 quantization on the frozen base — gradients flow through dequantized weights during training, but the base never leaves 4-bit in memory.

LoRA vs QLoRA vs full fine-tuning — VRAM for a 70B model:

MethodVRAMHardware
Full fine-tune~1.1 TB VRAM (mixed-precision Adam ≈ 16 bytes/param — 2 weights + 2 grads + 8 optimizer + 4 fp32 master ≈ 8× fp16 size); ~16+ H100s, or ~400–600 GB with ZeRO-3/offloadMulti-GPU required
LoRA (16-bit base)~140 GB (base in 16-bit + small adapters + optimizer for adapters only)2–4 GPUs
QLoRA (4-bit base)~48 GB (base in 4-bit + adapters in 16-bit)Single H100 (80GB)

03 — Alignment & Preference Tuning

After SFT teaches the model what to do, alignment teaches it how well to do it — ranking outputs by human preference.

TechniqueHow it worksData formatWhen to use
RLHFTrain a reward model from preference pairs → optimize LLM with PPO against the reward(prompt, chosen, rejected) + reward modelFrontier alignment; most complex but most expressive. Labs only.
DPODirect Preference Optimization — skips the reward model; optimizes directly on preference pairs(prompt, chosen, rejected)2026 default for preference tuning. Simpler than RLHF, competitive quality.
ORPOMerges SFT and DPO into one stage — simplest pipeline(prompt, chosen, rejected)When you want the simplest possible pipeline and have preference data
KTOKahneman-Tversky Optimization — works with just thumbs-up/thumbs-down (no paired comparisons needed)(prompt, response, good/bad label)When you have binary feedback, not pairwise preferences
GRPOGroup Relative Policy Optimization — critic-free RL (introduced in DeepSeekMath, the method behind DeepSeek R1) using group-relative advantages; works with learned reward models or verifiable functions(prompt, group of responses, reward)General RL post-training; reasoning tasks. RLVR (verifiable rewards — math, code, logic) is one common application, not the only one
SimPO / IPOVariants of DPO addressing edge cases (length bias, BT-model assumption)Same as DPOWhen vanilla DPO produces length-biased or unstable results

The practical default: For most fine-tuning projects, SFT alone is enough. Add DPO/ORPO if you have preference pairs and want to refine quality/safety. Reach for GRPO for critic-free RL post-training — most commonly reasoning tasks with verifiable rewards (RLVR), though it also works with a learned reward model. RLHF is the frontier lab’s tool — most teams don’t need it.

Alignment technique decision tree:

QuestionAnswer
Do you have paired preference data (chosen vs rejected)?→ DPO (default) or ORPO (simpler)
Only binary feedback (thumbs up/down), no pairs?→ KTO
Want critic-free RL — a verifiable reward function (math, code tests) or a learned reward model?→ GRPO
Need maximum alignment control, budget for reward model training?→ RLHF (PPO)
No preference data at all?→ SFT only (generate synthetic preferences if needed)

04 — Training Frameworks & Tools

FrameworkWhat it isBest for2026 status
HF TRL (v1.0+)Hugging Face’s unified post-training library: SFTTrainer, DPOTrainer, GRPOTrainer, KTOTrainer, RLOOTrainer, RewardTrainer (ORPO sits in trl.experimental)Full control over the training loop; the “standard library” for fine-tuningv1.x (v1.0 shipped March 2026) — the default
UnslothOptimized kernels for LoRA/QLoRA — about 2x faster with up to ~70–80% less VRAM than a standard HF setup (vendor figures)Single-GPU fine-tuning; the fastest path to a working fine-tuneSeparate library that plugs into TRL’s trainers
AxolotlConfig-driven (YAML) fine-tuning framework — supports LoRA, QLoRA, full, DPO, GRPO, ORPO, reward modelingMulti-GPU pipelines; teams wanting declarative configs over codev0.19 (Sep 2026); active community
torchtitanPyTorch-native platform for training generative models, from the PyTorch team (pre-training plus SFT)Teams wanting no HF dependency; pure PyTorch ecosystemWhere PyTorch is consolidating LLM training; torchtune stopped active development in 2025
MLX-LMApple Silicon native — LoRA, QLoRA, DoRA on MacLocal fine-tuning on Mac (a 7B model fits in 32 GB; bigger models need proportionally more unified memory)Mature for Apple Silicon users
DeepSpeedDistributed training library (from Microsoft, now a PyTorch Foundation project) — ZeRO stages 1/2/3 for memory optimizationMulti-GPU/multi-node training; large models that don’t fit on one GPUEssential for full fine-tuning at scale
FSDP (Fully Sharded Data Parallel)PyTorch’s native distributed training — shards model across GPUs; FSDP2 (fully_shard) is the current APIMulti-GPU training without DeepSpeed dependencyBuilt into PyTorch; simpler than DeepSpeed

Starter recommendation: Unsloth + TRL for single-GPU QLoRA fine-tuning (fastest, easiest). Axolotl for multi-GPU or when you want YAML configs. DeepSpeed/FSDP when models don’t fit on a single GPU. torchtitan if you want pure PyTorch without HF abstractions.

Supporting tools

ToolFunction
Hugging Face TransformersModel loading, tokenization, inference — the foundation everything else builds on
Hugging Face PEFTLoRA/QLoRA/DoRA adapter management (save, load, merge adapters)
bitsandbytes4-bit/8-bit quantization for loading large models on limited VRAM
Weights & Biases (W&B)Experiment tracking, hyperparameter sweeps, model comparison dashboards
MLflowExperiment tracking + model registry (open-source alternative to W&B)
Hugging Face HubModel hosting, sharing, versioning — the “GitHub for models”

05 — Data Preparation & Curation

Data quality is the single biggest determinant of fine-tuning success. 5K well-curated examples consistently outperform 50K noisy ones.

Data formats by training type

Training typeData formatExample
SFT (instruction tuning){"instruction": "...", "response": "..."} or chat format with system/user/assistant turns{"instruction": "Summarize this email", "response": "The email discusses..."}
DPO / ORPO{"prompt": "...", "chosen": "...", "rejected": "..."}Two responses to the same prompt, one preferred
GRPO{"prompt": "...", "response": "...", "reward": 0.85}Response + verifiable reward score
Continued pre-trainingRaw text documents (no instruction format)Domain-specific corpus (medical literature, legal filings)

Data quality checklist

  • Deduplication: remove exact and near-duplicate examples — duplicates cause memorization, not generalization.
  • Contamination check: ensure evaluation data is not in the training set. This is the #1 cause of inflated metrics.
  • Quality filtering: remove low-quality, off-topic, or contradictory examples. Use an LLM judge to score quality if manual review is impractical.
  • Mix base data (5–20%): include general instruction data during domain SFT to prevent catastrophic forgetting — the model losing its general capabilities.
  • Balance: ensure class/topic distribution matches what you want the model to learn, not just what’s easiest to collect.
  • Privacy: PII redaction before training. Differential privacy if fine-tuning on user data.

Synthetic data (the 2026 shortcut)

Use a frontier model (Claude Opus 5.5, GPT-6 Astra) to generate training data — instruction-response pairs, preference comparisons, or domain examples. Standard practice in 2026, but requires evaluation: always validate synthetic data quality before training on it.

Common mistake: Fine-tuning on synthetic data generated by the same model you’re fine-tuning → model collapse (the model learns to imitate its own biases). Use a stronger model to generate training data for a weaker model (distillation pattern).

06 — Distributed Training

When a model doesn’t fit on one GPU, or you need faster training, you distribute across multiple GPUs/nodes.

StrategyWhat it doesUse when
Data Parallel (DDP)Each GPU has a full model copy; data is split across GPUs. Gradients averaged.Model fits on one GPU but you want faster training
FSDP (Fully Sharded)Shards model weights, gradients, and optimizer states across GPUsModel doesn’t fit on one GPU; PyTorch native
DeepSpeed ZeRO-1/2/3Progressive memory optimization — ZeRO-3 shards everythingVery large models; maximum memory efficiency
Tensor ParallelismSplits individual layers across GPUs (within a node)Very large layers that don’t fit on one GPU even sharded
Pipeline ParallelismSplits model layers sequentially across GPUsVery deep models; used alongside tensor parallelism

Key training optimizations

  • Mixed precision (bf16/fp16): train in half precision — 2x throughput, half memory, minimal quality loss. bf16 preferred (no loss scaling needed).
  • Gradient checkpointing: recompute activations during backward pass instead of storing them — saves a large share of activation memory at roughly a 20% speed cost.
  • Flash Attention (2/3/4): memory-efficient attention computation — essential for long sequences. Built into most frameworks. FlashAttention-2 is still the stable default; FlashAttention-3 (Hopper, FP8 forward pass) and FlashAttention-4 (Hopper and Blackwell) are the newer kernels, both still in beta.
  • Gradient accumulation: simulate larger batch sizes by accumulating gradients over multiple micro-batches before updating.
  • Checkpointing: save model state regularly during training — critical when using spot/preemptible GPUs that can be interrupted.

07 — Evaluation Harnesses & Benchmarks

The eval harness must exist before training starts. Without it, you cannot tell if a checkpoint is better than the last. This is the most under-invested area in most fine-tuning projects.

Evaluation frameworks

FrameworkWhat it doesBest for
lm-evaluation-harness (EleutherAI)Standardized benchmark suite: MMLU, GSM8K, HumanEval, HellaSwag — 60+ benchmarks with hundreds of subtasksBase model benchmarking; academic comparison. No substitute.
DeepEvalpytest-native LLM eval — 50+ metrics: hallucination, bias, toxicity, RAG faithfulness, agentic and multi-turnCI/CD integration; broad application eval; quality gates that block deploys
RAGASRAG-specific evaluation: context precision, context recall, faithfulness, response relevancyRAG pipeline evaluation; a widely used choice for retrieval quality
PromptfooYAML-driven multi-model comparison + red-teaming (150+ attack plugins); now part of OpenAI, still MIT open sourcePrompt/model selection; security testing; CLI-first workflow
LLM-as-judgeUse a stronger model to evaluate a weaker model’s output against rubricsScalable proxy for human eval; runs on 5–10% of production traces
Human evaluationDomain experts rate outputs on rubrics (accuracy, helpfulness, safety)Gold standard; expensive; use for final validation

The evaluation stack for fine-tuning: Before training: lm-evaluation-harness baseline on the base model. After each checkpoint: task-specific metrics (exact match, JSON validity, tool-call accuracy) + LLM-as-judge (faithfulness, instruction following, tone). Before production: human eval on a sample + Promptfoo red-teaming. In production: RAGAS for RAG quality + DeepEval as CI gate.

Key benchmarks to know

BenchmarkWhat it measures
MMLUBroad knowledge across 57 subjects. Historically the headline general-capability metric, but saturated by 2026 — MMLU-Pro and GPQA replaced it, and GPQA is now near its ceiling too; frontier launches lead with Humanity’s Last Exam and agentic suites (Terminal-Bench, OSWorld) instead
GSM8KGrade-school math reasoning
HumanEval / MBPPCode generation and programming ability
MTEBEmbedding model quality (the benchmark for RAG embedding models)
MT-Bench / Arena-Hard-AutoConversation quality on multi-turn and hard prompts (LLM-as-judge scored); MT-Bench is no longer maintained, Arena-Hard-Auto v2 is its successor
IFEvalInstruction following accuracy (does the model do exactly what you asked?)
TruthfulQAWhether the model repeats common misconceptions and falsehoods instead of the true answer (now largely retired from leaderboards)

Eval traps to avoid:

  • Evaluating only on the task you fine-tuned for — check for catastrophic forgetting on general benchmarks too.
  • Training data contaminating eval set — always hold out eval data before any training begins.
  • Trusting a single metric — use task metrics + LLM judge + human eval together.
  • Evaluating once — evaluate at every checkpoint and after every data change.

08 — Model Optimization (Post-Training)

After training, make the model smaller, faster, and cheaper for inference.

TechniqueWhat it doesSpeed-upQuality impact
Quantization (INT8)Reduce weight precision from 16-bit to 8-bit~2x throughput, ~50% memoryMinimal (< 1% accuracy loss typically)
Quantization (INT4 / GPTQ / AWQ)Reduce to 4-bit with calibrationUp to ~3x faster decoding, ~75% memorySlight (~1–3% loss); good enough for most production
GGUF (llama.cpp format)Optimized quantized format for CPU/local inferenceRuns on CPU/MacVaries by quant level (Q4_K_M is the sweet spot)
DistillationTrain a small model to mimic a large model’s outputs10–100x smaller/fasterDepends on task; can retain 90%+ of quality on narrow domains
PruningRemove unnecessary weights/neurons1.5–3x fasterModerate; less common than quantization in 2026
Speculative decodingSmall model drafts tokens, large model verifies — net faster generation2–3x generation speedIdentical output (verification ensures quality)

Trade-off — quantization level: INT8: nearly lossless, 2x savings — the safe default. INT4 (GPTQ/AWQ): 4x savings with slight quality loss — production-viable for most tasks. Aggressive (2-3 bit): large quality drop — only for latency-critical, accuracy-tolerant use cases. Always evaluate your specific task after quantization — generic benchmarks don’t predict domain-specific impact.

09 — Open-Weight Ecosystem

The base models you’ll fine-tune. “Open weights” means you download the weights and run/fine-tune them yourself.

FamilyProviderSizesStrengthsLicense
Llama 4MetaScout (109B MoE), Maverick (400B MoE), 17B active eachHuge fine-tuning ecosystem; since overtaken on capability (Meta’s newest open model is the 30B Muse Glimmer, Apache 2.0)Llama 4 Community License
gpt-ossOpenAI20B, 120B (MoE)Reasoning; 120B runs on a single 80 GB GPUApache 2.0
Qwen 3.5 / 3.8Alibaba0.8B–397B (3.5); 27B dense up to 2.4T MoE (3.8)Widest size range; thinking modeApache 2.0 (most sizes; the largest 3.8 models use Qwen’s own licenses)
Gemma 4GoogleE2B, E4B, 12B, 26B MoE, 31BEfficient; multimodal (vision, plus audio on E2B, E4B and 12B)Apache 2.0
Mistral 3 familyMistral AIMinistral 3 (3B/8B/14B), Small 4 (119B MoE), Large 3 (675B MoE)EU-hosted; multilingual; fast inferenceApache 2.0 (Medium 3.5: modified MIT)
DeepSeek V4DeepSeekV4-Flash (284B MoE), V4-Pro (1.6T MoE)Reasoning modes built in; 1M context; cost-efficientMIT
Phi-4Microsoft14BSmall but punches above weight; good for edgeMIT

How to choose a base model for fine-tuning: Start with the smallest model that does well on your task with good prompting. Fine-tuning a 7B model is 10x cheaper and faster than fine-tuning a 70B. If 7B SFT isn’t good enough, try 14B before jumping to 70B. Benchmark the base model with prompting first — if it’s already 90% there, fine-tuning the last 10% is much cheaper than starting from a weak base.

10 — The Complete Training Workflow

End-to-end fine-tuning workflow:

  1. Define task — set success metrics
  2. Build eval harness — before training
  3. Curate data — 500–5K examples
  4. Baseline — evaluate the base model
  5. SFT (QLoRA) — train + checkpoint
  6. Evaluate — vs baseline
  7. Alignment? — DPO if preference data
  8. Evaluate again — plus catastrophic forgetting check
  9. Merge adapter — and quantize (INT4/8)
  10. Deploy — vLLM / cloud endpoint
  11. Monitor — drift + quality → retrain as needed

Steps 10 and 11 are where this guide hands off: serving, drift detection, and the retraining loop are the subject of MLOps and AI production operations.

The golden rule: Steps 2 and 6 (evaluation) are the most important. Training without evaluation is like flying without instruments — you have no idea if you’re improving or crashing. Build the eval harness before you write a single line of training code.

11 — Cloud Training Services

ServiceProviderBest for
SageMaker AI TrainingAWSManaged training jobs + HyperPod for fault-tolerant large runs; deepest GPU selection
Gemini Enterprise Agent Platform Managed Training (formerly Vertex AI Training)GCPManaged training + TPU access; tight BigQuery integration
Azure ML computeAzureManaged training; ND-series GPUs (H100 through GB300); reservations and savings plans
Lambda Cloud / RunPod / Vast.aiGPU cloudsCheapest GPU hourly rates; no managed MLOps (you manage everything)
Google Colab ProGoogleQuick experiments; T4/L4/A100-class GPUs for prototyping (types vary by plan and availability); not for production training
Managed fine-tuning APIsTogether, Fireworks, Gemini tuning (Agent Platform)Upload data → get fine-tuned model endpoint; zero infra management

Trade-off — managed fine-tuning API vs self-managed: Managed API (Together, Fireworks, Gemini tuning) = upload data, get model, zero infra — but limited control over hyperparameters, training loop, and model architecture. (OpenAI is winding its fine-tuning platform down: closed to new organizations since May 2026, no new jobs for anyone from January 2027.) Self-managed (Unsloth on cloud GPU) = full control, cheaper per hour — but you own the entire training stack. Start with managed for validation; switch to self-managed for production optimization.

12 — Trade-off Master Reference

DecisionOption AOption BDefault
Fine-tuning methodQLoRA (memory-efficient)LoRA (higher throughput)QLoRA unless you have GPU headroom
Full fine-tune vs adapterFull (all params)LoRA/QLoRA (adapters only)Adapters unless proven insufficient
Alignment techniqueDPO (pairs needed)SFT only (no pairs)SFT alone; add DPO if you have preference data
Training frameworkUnsloth + TRL (easiest)Axolotl (YAML, multi-GPU)Unsloth for single-GPU; Axolotl for multi-GPU
Data quality vs quantity5K curated examples50K noisy examplesQuality wins — always curate first
Base model size7B (cheapest to fine-tune)70B (most capable)Smallest model that works on your task
Quantization levelINT8 (nearly lossless)INT4 (more savings)INT8 default; INT4 if memory/cost critical
Synthetic vs real dataSynthetic (frontier-generated)Real (human-created)Mix both; always validate synthetic quality
Eval approachAutomated (LLM judge)Human evaluationAutomated for iteration; human for final validation
Distributed strategyFSDP (PyTorch native)DeepSpeed ZeROFSDP for simplicity; DeepSpeed for maximum memory efficiency
Open weights vs API fine-tuningSelf-hosted (full control)API (Together/Fireworks/Gemini)API for validation; self-hosted for production control
Training hardwareCloud GPU (H100/B200)Cloud TPU (Trillium/Ironwood)GPU for flexibility; TPU for large-scale cost efficiency

Built from current frameworks, research papers, and production practice. Independent reference — not affiliated with any vendor. Framework versions and model availability change rapidly; verify before starting a training run.

Riddam Jain

Staff Engineer · Amsterdam

I write about cloud and application architecture, AI, and leading engineers. If this was useful, let's connect.