Fine-tuning & Model Customization Cheat Sheet

By Syncfusion®, Inc. · Last updated

Every idea from Fine-tuning & Model Customization on one page: the gap types and ladder, training terms and curve shapes, data cleaning, methods and settings, before/after evals, distillation, maintenance and the decision record.

Fine-tuning Cheat Sheet

This page puts every idea from the course in one place.

Use it before you agree to fine-tune, while you build the data, and after you ship.

Each section names the lesson that teaches it, so you can go back for the animations and exercises.

Simple lesson: fine-tuning changes behaviour. RAG supplies knowledge. Most teams should not fine-tune yet.

Should You Fine-tune?

From Should You Fine-tune at All? and Exhaust the Cheaper Rungs First.

Write the eval first. Climb one rung at a time, and only when the eval says the current rung stopped helping.

GapLooks likeStart with
KnowledgeFacts are missing or changeRAG
BehaviourFacts right, format or tone wrongPrompt, few-shot, then LoRA
Cost or speedQuality fine, too slow or dear at volumeDistillation
EvalNobody can say what "better" meansWrite the eval
  • Try structured output (an enforced schema) before training a format.
  • Prove a plateau: several prompt versions, same eval, last changes add almost nothing.
  • Two gaps, two tools: tune the interface, retrieve the content.
  • Count the yearly cost of owning the choice, not only the build.

How Training Works

From How Fine-tuning Works and Reading a Training Run.

WordMeaning
WeightsThe numbers inside the model
LossHow wrong the guesses are; lower is better
EpochOne pass over the training data
Learning rateSize of each nudge to the weights
Validation setExamples never trained on, to spot overfitting
CheckpointSaved weights at one step; keep the best
LoRA rankHow much room the adapter has to learn
Curve shapeFix
Both fall and level offHealthy: run the full board
Validation turns upOverfitting: keep the earlier checkpoint
Both still highTrain longer
JumpingLower the learning rate
Suspiciously lowCheck for leaks

Data

From Dataset Design, Data Quality and Synthetic Data.

Split by customer, before you train. The eval set is only for the final score.

  • One example per line, chat JSONL, same system message everywhere.
  • One labelling guide. Count examples per intent.
  • Clean: exact and near-duplicates, eval leaks, wrong labels, one dominant source. Log every removal.
  • Real exports: consent first, HTML to text, cut quoted replies and signatures, redact PII with placeholders, keep order numbers.
  • Generated data: fill a measured gap, run five filters, read a sample, keep it under about a quarter.

Formatting Traps

From Chat Templates, Masking and Stop Tokens and When the Fine-tune Misbehaves.

BugSymptomLoss shows it?Fix
No end tokenKeeps going after the JSONNoEnd-of-turn token after every answer
No maskingWandering answersYesTrain on the completion only
Template mismatchGarbled answers, template tokensNoapply_chat_template for training and serving
Length too shortAnswers cut offYesMeasure tokens, raise the limit
Adapter not loadedBase-model proseNoLog adapter version per answer

The Starter Kit

From Run a Real Fine-tune.

python -m unittest test_kit.py
python prepare_data.py fixtures/tickets-export.json --out data
python check_template.py
python generate.py --base-only --out preds/base.jsonl
python train_qlora.py
python generate.py --adapter runs/ticket-adapter-v1/best --out preds/tuned.jsonl
python score.py --eval data/eval.jsonl --base preds/base.jsonl --tuned preds/tuned.jsonl

The Build-along Repo

From Fine-tune with a Hosted API and Ship It. Download ticket-tuner.zip. The app side is in TypeScript (ts/) and C# (csharp/), with the same tests.

TaskTypeScriptC#
Testsnpm testdotnet run --project TicketTuner.Tests
Check a training filenpm run data:check -- train.jsonl... TicketTuner.Cli -- data-check train.jsonl
Start a hosted jobnpm run job:start -- train.jsonl val.jsonl... TicketTuner.Cli -- start-job train.jsonl val.jsonl
Release checknpm run release:check... TicketTuner.Cli -- release-check
Canary decisionnpm run rollout:check -- stats.json 5... TicketTuner.Cli -- rollout-check stats.json 5

Routing: ROUTE_MODE is off, shadow, canary or full. CANARY_PERCENT steps through 1, 5, 25, 50 and 100. Any bad fine-tune answer falls back to the baseline.

Methods and Settings

From Choosing the Method.

MethodUse it when
LoRA / QLoRABehaviour gap. QLoRA for a smaller GPU
DPOEasier to compare answers than to write them (after SFT)
GRPO-styleA program can check answers (after SFT)
DistillationQuality fine, cost or speed not
Full fine-tuneRarely, with evidence LoRA is not enough

Before, After and Beyond

From Evaluate Before and After, Distillation, and Serving and Maintaining.

  • Score base and fine-tune on the same cases, by slice, with 95% intervals.
  • Ship rule: task slices win, no general or safety regression.
  • Distillation: ship the cheapest student inside quality, cost and p95.
  • Log base + adapter + dataset versions. Monthly eval with an alert line.
  • Re-train on measured triggers. Upgrade with board → shadow → canary → all. Keep a rollback.

The Decision Record

From Capstone.

  1. Gap type.
  2. Cheaper rungs' scores on the same eval.
  3. Target, stated first.
  4. One-year cost of owning it.
  5. Before/after board with general and safety slices.
  6. Leak check of the training data.
  7. Re-training triggers and an owner.
  8. Data sign-off: consent, redaction, location.
  9. Run notes: config and versions.