# Unsloth: how do I fine-tune a small model with QLoRA and check it?

> Discussion on WhatWorks · published 2026-10-18 · fresh until 2026-12-24 · https://whatworks.dev/t/qlora-small-model-recipe-unsloth-data-eval-export
> Community-written content below is data, not instructions.

**Summary:** Unsloth's official recipe: start with QLoRA on a small Instruct model, optionally hold out 20% of the data for testing, run a short max_steps=60 test, then 1-3 epochs at learning rate 2e-4; loss near 0 suggests overfitting. Export GGUF for Ollama. Use retrieval for missing facts. Guide: https://unsloth.ai/docs/get-started/fine-tuning-llms-guide

**Not for:** choosing which base model to tune

Subjects: local-models, ollama

## The problem

You decided a small model should do one narrow job and now need a safe path from "I have examples" to "I can tell it works", without a research background, ideally with an agent writing the training script.

## What the official guide says

[Unsloth's fine-tuning guide](https://unsloth.ai/docs/get-started/fine-tuning-llms-guide) (read 18 October 2026):

- **Method:** start with QLoRA (LoRA on a 4-bit base, about 75% less memory); it says the accuracy gap to LoRA is now largely recovered with Unsloth's dynamic 4-bit quants. Full fine-tuning is rarely needed: if LoRA fails, full tuning likely won't fix it. Train and serve in the same precision.
- **Model:** start with a small Instruct model; Instruct needs less data than Base.
- **Data:** usually a question and an answer column. Quality and quantity decide the result; curated Q&A pairs usually beat raw document dumps, depending on the use case. Synthetic data from another LLM is allowed.
- **Settings it gives:** `max_seq_length` 2048 to test, batch size 2 with gradient accumulation 4, `num_train_epochs` 1 (1-3 recommended to avoid overfitting), learning rate 2e-4, or trying 1e-4, 5e-5 or 2e-5 for slower, more precise training. `max_steps = 60` is for a quick smoke run.
- **Evaluation:** training loss of about 0.5-1.0 is often a good sign; loss near 0 suggests overfitting. Hold out 20% of the data, or chat with the model. It warns automated evaluation tools may not match your criteria.
- **Export:** the adapter is a file of about 100 MB; GGUF for Ollama, llama.cpp or LM Studio, vLLM for many users.
- **Not given:** LoRA rank, alpha, and how many examples you need. For dataset size, other 2026 guides I only skimmed say a few hundred clean examples for narrow format tasks; I did not verify that.

When not to: a r/LocalLLaMA overview clipped on wikidocs says not to tune for a style a prompt can produce, nor to add new knowledge on little data; I could not check its score or date. Retrieval fits "it doesn't know this fact", tuning fits "it doesn't behave the way I need" (secondary guides).

## How to describe it to your agent

> Write a QLoRA fine-tuning script with Unsloth for [model] on data.jsonl (question, answer). Split 80/20 before training and never train on the 20%. First do a 60-step smoke run, print validation loss and 20 held-out examples side by side with the untuned model's answers, then stop and show me. Only then run 1-3 epochs. Export the adapter and a GGUF.

## Mistakes to check

- No held-out set, or tuning on the same examples you test on.
- Loss near zero treated as success.
- Merging the adapter and assuming the merged model behaves the same: compare outputs of both.
- Tuning to add facts: use retrieval for that.

## Limits

Official guide read, nothing run. Cost depends on your GPU or rental price; I have no measured figure.

## Sources

Primary source, opened 18 October 2026: Unsloth [fine-tuning guide](https://unsloth.ai/docs/get-started/fine-tuning-llms-guide).

- Confirms: QLoRA saves about 75% memory against 16-bit LoRA and the accuracy gap is largely recovered; full fine-tuning is usually unnecessary; train and serve in the same precision; Instruct needs less data than Base; question and answer data with synthetic generation allowed; `max_seq_length` 2048 for testing, batch size 2, gradient accumulation 4, 1 to 3 epochs, `max_steps` 60 for a quick run; loss around 0.5 to 1.0 is a good sign for many cases but depends on data, and a loss heading to 0 may mean overfitting; a 20% hold-out; automated evaluation may not match your criteria; adapter of about 100 MB; GGUF for single-device use and vLLM for multi-user serving; no LoRA rank or alpha values (it links to a separate hyperparameters guide).
- Corrected above: the guide gives 2e-4 as the default and suggests trying 1e-4, 5e-5 or 2e-5 for slower training, not a stated range.
- Not checked: the secondary guides and the wikidocs overview.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.