Dataset Preparation for AI Fine-Tuning: Formats and Best Practices
On this page
Which Formats Does the Platform Take?
Four: JSONL (JSON Lines), Parquet, CSV, and plain text. JSONL is the recommendation and the default — one valid JSON object per line, one training example per object. Parquet suits very large sets through columnar compression; CSV works for simple tabular data; plain text is the continued-pre-training format.
Everything passes validation at upload: structural correctness, required fields, encoding, data-type mismatches — and failures come back pointing at the offending rows or fields.
The Datasets page lists every uploaded set with format, size, and status:
What Belongs in an SFT Dataset?
Instruction-response pairs, in three fields: instruction (the query or task), input (optional context), and output (the desired response). The messages format — each example an array of role-content message objects — is supported too.
Example JSONL line: {"instruction": "Summarize the following article", "input": "The Federal Reserve announced...", "output": "The Fed raised interest rates by 25 basis points..."}
The output field is what the model learns to generate. Style, format, and quality must be consistent across examples — the model reproduces the patterns it is shown.
What Belongs in a Preference Dataset?
Paired responses for DPO, SimPO, ORPO, and CPO: prompt, chosen (preferred), rejected (less preferred). KTO drops the pairing: prompt, response, label (desirable or undesirable).
Example JSONL line: {"prompt": "Explain quantum entanglement", "chosen": "Quantum entanglement is a phenomenon where...", "rejected": "Entanglement is when particles are connected..."}
The quality gap between chosen and rejected carries the signal. Near-identical pairs, or a rejected that is actually better than the chosen, confuse it — sample the pairs before training.
What Raises Data to Good Enough?
Quality beats quantity: 5,000 high-quality examples routinely outperform 50,000 noisy ones. The bar has four parts — accurate (outputs factually correct), consistent (one format and style throughout), diverse (covering the input range production will see), and deduplicated (no repeated examples biasing the model).
The usual defects to hunt: truncated outputs, mixed formatting (markdown beside plain text), factual errors, outputs that never address the instruction, and encoding artifacts (broken Unicode, HTML entities in plain text).
How Does the Platform Validate Your Data?
At upload, validation runs automatically: format checks (valid JSON, correct delimiters), field detection (instruction/output columns identified), type validation (expected data types), and content checks (empty fields, excessively long examples, encoding issues).
The upload interface shows the validation results:
The preview then shows a sample of processed data before training — verify the instruction-output mapping, the column mapping, and a few examples for quality. Swapped columns and wrong field names die here instead of on GPU time.
Row-level browsing of field values:
How Does the Hugging Face Import Work?
Connect a HuggingFace token on the Integrations page, then import public and private datasets directly. Download, format conversion, and column mapping happen automatically; the mapping is adjustable before you confirm.
It is the fast path for established benchmark sets and for proprietary datasets living in a HuggingFace organisation.
The connection lives on the Integrations page:
Which Dataset Mistakes Cost the Most?
Inconsistent output formatting fails more fine-tunes than anything else. JSON in some examples, plain text in others — and the fine-tuned model flips between them unpredictably. Run a consistency audit before upload: same template, same delimiters, same length rules everywhere.
Chasing size is the next trap — low-quality examples slip in with the volume (the full sizing answer is in how much data do you need). A model trained on 50,000 noisy examples emits noise; one trained on 5,000 curated examples emits consistency. With a limited annotation budget, invest in revising good examples rather than producing more bad ones.
Encoding issues are common and sneaky: broken Unicode, HTML entities sitting in plain text (& for &), inconsistent line endings, invisible control characters. The model learns the artifacts and repeats them. Validation catches some; a manual sample inspection still earns its keep.
For preference data specifically, the signal must be consistent: annotators with different criteria — one rewarding concision, another detail — create contradictory training pressure. Write the guidelines, train the annotators, and measure inter-annotator agreement before the data touches a run.
Your First Dataset on Vidman AI
The Datasets page lists previously uploaded sets with format, size, and validation status. Upload accepts JSONL, Parquet, CSV, and plain text up to the workspace storage limit; validation runs immediately, and the preview confirms the processed data before any run uses it.
For HuggingFace teams, the import is a few clicks: connect the token once on the Integrations page, browse public and private sets from the platform, confirm the column mapping, and import — download, conversion, and validation handled. Useful for benchmarking against established public sets and for proprietary sets maintained on the Hub.
Uploaded and validated, a dataset serves any number of training runs and persists across sessions — comparing methods or hyperparameters on identical data becomes routine, which is the whole point of rigorous model development.
Related Articles
How Much Data Do You Need to Fine-Tune?
Fine-tuning dataset size: no magic number — the variables that decide yours, the knee where more data stops paying, and how to find it cheaply.
Supervised Fine-Tuning (SFT) for LLMs: A Complete Guide
Supervised fine-tuning end to end — dataset shape, adapter choice, the hyperparameters that matter, reading a training run, and the mistakes that ruin one.
DPO: Direct Preference Optimization for LLM Alignment
DPO aligns an LLM to human preferences with no reward model and no RL loop — the objective, the pair format, and when pairs beat labels.
Continued Pre-Training: Domain Adaptation for Large Language Models
When continued pre-training earns its place for domain adaptation — and when retrieval or SFT is the sharper tool.