Own Weights

How to prepare data for fine-tuning from your own records

How to prepare data for fine-tuning from production logs and past human decisions: the JSONL format, labels, cleaning and a clean train-test split.

Updated

To prepare data for fine-tuning, collect the inputs your system already received and the answers a person already approved, then turn each pair into one labeled example in a fixed format. Many companies already hold this in production logs, ticket systems and past review decisions, so the main work is selecting, cleaning and labeling, not gathering new data.

What a fine-tuning example looks like

Each example is one input and the correct output. For chat-style training, the dataset is a JSONL file, meaning one JSON object per line. Each object holds a list of messages: an optional system instruction, the user’s input, and the assistant’s correct answer. Here is a hypothetical example for clause extraction, with made-up text:

{"messages": [{"role": "system", "content": "Extract the governing law clause."}, {"role": "user", "content": "Contract text: ..."}, {"role": "assistant", "content": "This Agreement is governed by the laws of Delaware."}]}

Keep every line the same shape. A file where some lines are plain text and others are nested objects fails at load time or teaches the wrong thing. Field names depend on the training tool, so check its documentation before you export.

Can I use production logs to fine-tune a model?

Yes, but a log line is not yet a training example. A log usually shows the input and what the model output, and that output may be wrong. The example needs the correct answer, which you find in the record of what happened next. If a claims adjuster accepted, edited or rejected a suggestion, the adjuster’s final version is the label. Log only the outputs you are allowed to reuse. Check your customer contracts, your privacy notice and the terms of any API that produced the text.

Model outputs from a frontier API are a separate case. Their terms often restrict using them to train a competing model. Keep those outputs out of the training set and build labels from human decisions instead. See training on frontier model outputs for the risk.

Using historical human decisions as training data

Past decisions are often the cleanest source, because a person already settled the answer. Capture three things for each one: the input exactly as the reviewer saw it, the final decision, and the date. Store the input as it was at review time. If the record was edited later, rebuilding the input from the current database gives you text the reviewer never saw.

When a case was reversed, take the final decision. Drop cases that were never settled. When two reviewers disagreed, either write a rule that decides between them or remove the example.

Do I need labeled data to fine-tune?

For supervised fine-tuning, yes. The model learns from pairs of input and correct output, so each input needs an answer you trust. If you only have inputs, you can have the current model draft answers and have people correct them. The corrected answers become the labels. This is slower than reusing past decisions, but every label has been read by a person. Do not treat an unread model draft as a label.

How to clean and label data for fine-tuning

Write a short labeling guide before anyone labels. It should say what each answer type looks like, what to do when the text is missing, and how to handle partial matches. Have two people label the same sample of examples independently, then compare them. Where they disagree, fix the guide and relabel. Do this before labeling the rest, or the disagreement ends up in the training set.

Then clean the file:

  • Remove exact and near-duplicate examples. One repeated example can pull the model toward one pattern.
  • Drop examples where the answer does not match the input.
  • Remove empty answers, cut-off answers and text copied from an old system prompt.
  • Redact personal data you may not train on. The PII redaction guide covers what redaction catches and what it misses.
  • Normalize whitespace and encoding so the same text looks the same across examples.

Split before you train. Group examples by source, such as one contract or one customer account, so the same source never lands in both the training set and the test set. A random split by line leaks, and the test score comes out higher than the real accuracy. The guide to building a test set covers how to build one you can trust.

When this approach is the wrong choice

Fine-tuning fits a narrow task with a stable format and enough good examples. It is the wrong choice when the task changes every week, when the answer depends on broad knowledge the model lacks, or when volume is low enough that a prompt on a hosted API is cheaper to run and simpler to change. Fine-tuning vs prompt engineering helps you decide between them.

Talk to us about whether your own records are worth training on. Start with the free AI cost audit, which maps where your AI calls and spend sit in your code. You can see the full setup on the Own Weights homepage. The trained model runs in your own cloud account or on-prem, and you own the weights.

Questions

Do I need labeled data to fine-tune?

Yes, for supervised fine-tuning. Each training input needs a correct output you trust, and you can get those from past decisions or from reviewers correcting drafts the current model wrote.

Can I use production logs to fine-tune a model?

Only the outputs you have the right to reuse, and only after you attach a correct answer to each one. A raw log shows what a model said, which may have been wrong, so pair it with what happened next. Check your customer contracts and the terms of any API that produced the text.

What is the fine-tuning dataset format?

Most chat-style trainers take JSONL, one JSON object per line with a messages list holding the input and the correct assistant reply. Every line should use the same field names, so check your training tool's documentation for the exact keys before you export.

How do I clean data for fine-tuning?

Remove duplicates, drop examples whose answer does not match their input, and strip empty or cut-off outputs. Redact personal data you cannot train on, normalize whitespace, and split by source before training so the test set stays clean.

Can past human decisions be used as training data?

Yes. A reviewer's final decision is a label. Store the input as the reviewer saw it, along with the decision and its date, and drop cases that nobody ever settled.