Most fine-tuning failures trace back to data, not to the training run. Before training, confirm you have the right to use the data, remove personal and secret material, deduplicate, label consistently, split off an untouched eval set, and record where everything came from.
Sourcing and rights
- Know the origin. Write down where each source came from: support logs, internal docs, public datasets, model generated text.
- Check permission. Confirm you may use it for training. Customer data often has contract limits. Public does not mean free to use.
- Check licences. Datasets and scraped text carry licences. Record them next to the data.
Privacy and secrets
- Strip personal data. Names, emails, phone numbers and account ids from logs should be removed or masked. A model can memorise and repeat training text.
- Scan for secrets. API keys, tokens and passwords turn up in chat logs and code samples. Run a secret scanner over the whole set.
- Decide what must never be learnable. If the model must not reveal something, do not train on it.
Quality
- Deduplicate. Remove exact and near duplicates. They bias the model and make eval scores look better than they are.
- Fix labels. Sample at least a hundred rows and check them by hand. One bad pattern repeated many times becomes a habit.
- Cover the edges. Include empty inputs, very long inputs, adversarial wording and cases where the right answer is to decline.
Structure and splits
- Use one consistent format. Provider and library formats differ, but the idea is the same: an input and the ideal output. The OpenAI guide describes supervised tuning as training on correct example responses and preference tuning as training on pairs of correct and incorrect responses. Pick the shape that matches your method. See SFT, DPO and reinforcement fine-tuning compared.
- Split before you look. Set aside an eval set drawn from real inputs and never train on it. Also keep a validation set for tuning settings. Leaks between splits give false confidence.
Provenance
- Version everything. Hash the final files, record the cleaning scripts and keep the commit id. When a regression appears, you need to know which data produced which model.
A word on the tooling
Data pipelines are software. They pull in parsing libraries, notebooks and training frameworks, each with its own vulnerabilities. Keep them in the same dependency scanning and SBOM process as your services. Safeguard's SBOM and dependency scanning covers manifests in these repositories, and the free scan is a quick way to look at one.
Quick check
Why split off the eval set before cleaning?
So no decision you make while cleaning or labelling is shaped by the eval examples. Duplicates between train and eval also inflate scores.
Can I train on customer chat logs?
Only if your contract and privacy notices allow it, and after removing personal data and secrets. Ask legal before you start.
Sources
- OpenAI model optimization guide, fetched 19 October 2026.
Last reviewed: 19 October 2026.