Prepare department-specific training examples
Supervised fine-tuning uses examples of which output should follow an input. An independent test and reliable labels matter more than raw volume.
Lessons in this path
How to do it
- Use approved or synthetic examples. Ask subject experts to label the target answer, format and exceptions. Remove duplicates and separate unnecessary personal data from the learning task.
- Split cases by group or time window into training, validation and test. Keep similar requests from the same incident together. Use validation to select an adapter and keep the held-out test for final evaluation.
- LoRA trains a small set of added parameters while the base model stays frozen. QLoRA uses a quantized base model and a trainable adapter. Confirm support for the selected model, runtime and hardware.
Apply the method · AI for startups
A support startup wants more reliable ticket labels. Unclear categories and duplicates matter more than model size at the start.
Agree on labels with support and product, include multi-category cases and write a rule for asking a clarification or escalating.
Example for a test environment
One synthetic JSONL record in a conversational format. Build distinct examples and verify the data format required by the training tool before using them.
{"messages":[{"role":"user","content":"When will order TEST-018 arrive? The source says it is processing and has no confirmed delivery date."},{"role":"assistant","content":"Draft: Your order is being processed. Evidence: synthetic test record. Open question: ask the owner to confirm a date."}]}Apply this in your organization
Train against a stable target. Keep tickets from the same interaction together so near-duplicates do not leak into evaluation.
How is a training set built in practice?
A training set is a collection of example pairs of input and desired output, usually in JSONL format (one JSON line per example). The effort lies less in the format than in domain quality. Proceed as follows:
- Write an annotation guideline: what is the correct output, how edge cases are handled, which phrasings are prohibited. Without a guideline, each expert decides differently.
- Draw a sample of real cases reflecting everyday distribution, and deliberately add rare but important cases.
- Pseudonymise or remove personal data before data leaves the source system. Spot-check that it worked.
- Have part of the examples annotated twice and measure agreement. Low agreement signals an unclear guideline.
- Split into training, validation and test, grouped by case or customer, and document the split.
Quality check: how do you recognise a good dataset?
Check the points below before every training run. Each of them has led to models that looked good in testing and failed in production.
| Check | Why | How to check |
|---|---|---|
| No duplicates | Duplicates skew weighting and test results | Search for exact and near-identical texts |
| No leakage between training and test | Otherwise the test measures memorisation | Check grouping by case |
| Balanced classes | Rare cases are otherwise ignored | Count distribution per category |
| Consistent format | The model learns inconsistency too | Automatic schema validation |
| Documented provenance | Evidence for rights, privacy and later error analysis | Source, date, approval per batch |
Going deeper: synthetic data, LoRA parameters and data rights
Synthetic data (examples generated by a model) helps add rare cases or start without real customer data. Risks: it may be too clean, inherit the generating model's errors and miss the real distribution. A mix works well where experts review synthetic examples and the test set consists of real, approved cases wherever possible.
With LoRA (low-rank adaptation, training small additional matrices instead of the whole model), rank, learning rate and number of epochs mainly determine the result. A higher rank allows more adaptation but raises the risk of overfitting. Start with the documented defaults, change one parameter at a time and decide based on validation data. QLoRA reduces memory needs through a quantised base model, making training possible on smaller hardware.
On data rights: check whether contracts, consent and purpose limitation cover use for training, and whether the base model licence permits your adaptation and use. In enterprises this belongs in a formal approval; solo professionals should at least document that they only use their own or synthetic data. This is orientation, not legal advice.
Example: a customer service team builds 800 examples
A fictional service team wants response drafts in the fixed format “draft, evidence, open question”. It pulls 600 real, pseudonymised enquiries from the past year and adds 200 synthetic cases for rare situations such as complaints with legal implications. Two experts double-annotate 100 cases; agreement on “escalate yes or no” is low at first.
The cause: the guideline did not define whether goodwill requests are escalated. After an addition, agreement rises markedly. The split is by customer, so no customer appears in both training and test. The test set contains only real cases. The team documents provenance, pseudonymisation and approval in a datasheet versioned together with the adapter.
Common mistakes
- Using historical replies unchecked as target output. They contain past errors and inconsistencies too.
- Splitting randomly instead of by case. Similar cases in the test lead to inflated results.
- Using only synthetic data for testing. The test then measures how well one model imitates another.
Frequently asked questions
Can I use customer data for training?
Only if the legal basis and purpose cover it and you minimise the data. Pseudonymisation reduces risk but does not replace the assessment. Clarify this with your data protection adviser; this is not legal advice.
How long does data preparation take?
It is usually the largest part of the project. As a rough orientation, several days of expert time for a few hundred well-checked examples is realistic, not counting the guideline and alignment.
Try it yourself
Write three synthetic input and output pairs: a common supported question, missing evidence and a case that needs escalation. Define the expected behavior for each.
Check your result
Is there a separate held-out test set, and can you account for where the data came from and how it was approved and reviewed?