Strict output formats
The same JSON fields every time, without long instructions in each prompt.
Read more about Strict output formats
Always returning the same JSON fields for an invoice or a lead, without long instructions in every prompt.
Extra training on your own examples so a model does one job your way.
You continue training a pretrained model on example inputs and ideal outputs. Most projects train a small add-on such as LoRA, which is far cheaper.
Fine-tuning means continuing to train a pretrained model, such as a large language model, on a few hundred to a few thousand examples of the input you will give it and the output you want back. The most common form is supervised fine-tuning: pairs of prompt and ideal answer.
You can update every weight (full fine-tuning) or train a small add-on while the base stays frozen, as in LoRA. The second is far cheaper and is what most business projects use.
Gather real inputs and the outputs a skilled person would write.
Real inputs and the outputs a skilled person would write, usually stored as JSONL in a chat format.
Remove errors and unneeded personal data, and hold back a test set.
Remove errors and personal data you do not need, and hold back a test set the model never trains on.
A few passes on a GPU; a small LoRA run can take hours on one card.
Run a few passes over the data on a GPU. A LoRA run on a small open model can finish in hours on one card.
Compare against the base model on the test set and ship only if clearly better.
Compare the tuned model with the base model on the held-back set. Ship only if it is clearly better. See model evaluation.
The same JSON fields every time, without long instructions in each prompt.
Always returning the same JSON fields for an invoice or a lead, without long instructions in every prompt.
Replies that sound like your firm and use your product names correctly.
Replies that sound like your firm and use your product names and abbreviations correctly.
A tuned small model can match a larger one on one narrow task, at lower cost.
A tuned small model can match a much larger general model on one narrow task, which cuts inference cost and allows on-premise hosting.
A broker tuned a small open model on around a thousand labelled claim emails, so it uses exactly twelve categories and runs on its own server.
An insurance broker classifies incoming claim emails into twelve categories and extracts policy number, date of loss and claim type. A general model prompted with instructions gets the categories mostly right but keeps inventing its own labels. Fine-tuning a small open model on around a thousand past emails labelled by the claims team teaches it the exact twelve labels and field format, and it runs on the broker's own server.
Training on documents does not make facts reliable. Use RAG for facts.
Training on your policy documents does not make the model a reliable source of those facts. For facts, use RAG.
Try a clear prompt with examples first; if it works, tuning only adds cost.
Try good prompt engineering first. If a clear prompt with examples already works, tuning adds cost for nothing.
The model copies what it sees, mistakes and inconsistent labels included.
The model copies what it sees, including mistakes and inconsistent labels.
For a narrow task, a few hundred high-quality examples can be enough to see a difference; more varied tasks need more. Quality and consistency matter more than raw volume.
Several providers offer fine-tuning APIs for some of their models. You upload examples and they host the tuned version. With an open-weight model you can tune and host it yourself.
Not by itself. It can even weaken safety behaviour learned by the base model, so test outputs and keep guardrails in place.
Last updated