datafortuning

Prepare a dataset for LLM fine-tuning

A fine-tuning dataset is a file of examples: the input the model gets and the answer it should give. datafortuning builds that file from data you already have, checks it, lets you review what it flags, and splits it into train, validation and test sets.

Convert CSV to fine-tuning JSONL

Choose I have raw data, upload the CSV, and map one column to the user input and one to the answer. Add a system prompt if you want the same instruction on every example. Each row becomes one line in the chat format that most fine-tuning tools read:

ticket_id,message,category
T1000,My card was charged twice for the same coffee.,duplicate_transaction
{"messages": [
  {"role": "system", "content": "Classify the customer message. Answer with the category only."},
  {"role": "user", "content": "My card was charged twice for the same coffee."},
  {"role": "assistant", "content": "duplicate_transaction"}
]}

The model learns the last assistant message. JSONL works the same way: pick fields by path, such as ticket.body or labels[0].

Rows without an answer can still be imported. They wait in review with "needs a label"; type the answer to approve them. They are never exported as they are.

Turn LLM logs into training data

Choose I have LLM interactions and upload a CSV or JSONL export from your app or logging tool. Map what you have:

FieldWhat it does
Messages, or user inputThe conversation up to the answer, as a list of {role, content} (system, user and assistant turns are kept), or one input field. If the list ends with the model's reply, that reply is the response.
Model responseWhat the model answered. A candidate, not the truth.
Human correctionA corrected answer. Used instead of the model's answer, and approved.
FeedbackThumbs up or down, true or false, accepted or rejected, or a 1 to 5 rating (4 and 5 positive, 1 and 2 negative). A 1 on its own is read as a thumbs up. Anything else, or nothing, stays unknown.
StatusRecords marked error, failed, timeout, incomplete or cancelled are left out.
TaskKeep one task per dataset. If your logs mix tasks, choose which to keep; the rest are set aside with a reason.
Group ID, timestamp, cost, record IDGroup keeps a conversation or customer in one split. Timestamp lets you test on the most recent records. Record ID and cost are kept with the source record.

How each record starts in review:

Nothing with an unknown answer is approved for you. Use bulk approve on a filter, such as everything with a thumbs up, when you have checked a sample of it.

Clean an existing training file

Choose I have a training dataset. We read these formats, the same ones Tuneweights reads:

{"messages": [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]}
{"prompt": "...", "completion": "..."}
input,output            (CSV, with an optional system column)

What we check

Errors stop a record from being exported until you fix it:

Flags are for you to look at: duplicates, the same input with different answers, labels with fewer than 3 examples, and likely personal data (emails, phone numbers, card numbers, Aadhaar, PAN and SSN numbers, IP addresses).

Personal data detection uses fixed patterns. It misses things and flags some harmless numbers. Masking replaces what it finds with placeholders such as [EMAIL]; it is not anonymisation.

None of the checks can tell you if an answer is right. Review a sample of every group you approve.

Deduplicate a fine-tuning dataset

Two examples are duplicates when their messages are the same after we normalise Unicode, line endings and spaces (case is kept). The first copy stays; later copies are rejected with the reason "Exact copy of an earlier example", and you can bring any back. Examples with the same input and different answers are flagged as conflicting and stay in review until you choose. Reworded near-duplicates are not detected yet.

Split without leakage

The default is 80% train, 10% validation and 10% test. Examples with the same input, and records with the same group ID, always go to the same file, so the model is not tested on what it trained on. For classification, each label is spread across the files when there are enough examples; you are warned when there are not. You can also make the test set the most recent records, by timestamp.

The split uses a seed: the same data and seed always give the same split. Every export reports how many inputs and group IDs cross files (it should be 0). This catches exact matches only.

What you download

FileContents
train.jsonlExamples to train on
validation.jsonlExamples to check progress and tune settings
test.jsonlExamples for one final evaluation. Never train on them
manifest.jsonThe source record ID of every line, the field mapping, split settings and seed, and what was left out and why
quality_report.jsonCounts, reasons and label distribution from review
README.mdA summary of all of the above

Only approved examples without errors are exported. Record IDs and other source details stay in the manifest, never in the training messages. Each export is saved as a numbered version you can download again.

Fine-tune with Tuneweights

Tuneweights is optional. To use it, go to tuneweights.com and upload train.jsonl as the dataset and validation.jsonl as the evaluation file. It trains on all of train.jsonl and compares the base and fine-tuned models on validation.jsonl, which keeps related records apart from training. Keep test.jsonl for your own final check.

Limits and privacy

Try the sample or prepare a dataset.