# Local datasets and column mapping

Source: https://docs.surogate.ai/engine/examples/recipes/datasets/

<!-- From examples/datasets/README.md in the engine repo; configs and scripts it names are linked on GitHub. -->
This example shows how to train on your own local files, even when their columns
don't match the default names. [mixed.yaml](https://github.com/invergent-ai/surogate/blob/main/examples/datasets/mixed.yaml) combines two local training
files and a separate validation file. All paths are relative to the repository root:

```bash
surogate tokenize examples/datasets/mixed.yaml --debug
surogate sft examples/datasets/mixed.yaml
```

- [instructions.jsonl](https://github.com/invergent-ai/surogate/blob/main/examples/datasets/instructions.jsonl): maps `task`, `context`, and `answer` to
  instruction/input/output and supplies a fixed system prompt.
- [conversations.jsonl](https://github.com/invergent-ai/surogate/blob/main/examples/datasets/conversations.jsonl): maps the `dialog` column to chat messages.
- [validation.jsonl](https://github.com/invergent-ai/surogate/blob/main/examples/datasets/validation.jsonl): a separate held-out example, so the training
  data isn't split again for validation.

The small fixtures show data shapes and token masking; replace them for real
training. `sample_packing: false` keeps the tiny samples separate so you can inspect
them (`--debug` prints each token with its label); most model recipes enable packing.
The tokenizer formats instruction and conversation data for you and, under the default
loss scale, masks every token that isn't from the assistant.
Raw `type: text` data is shown in [pretraining](/engine/examples/recipes/pt/), `type: preference`
in [DPO](/engine/examples/recipes/dpo/), and automatic dataset detection in the model recipes.

For chat datasets split into prompt and completion message arrays, use
`messages_field: prompt` and `completion_field: completion`, as in the
[reverse-text recipe](https://github.com/invergent-ai/surogate/blob/main/examples/sft/reverse-text-qwen3.yaml). Conversation datasets may
also set `system_field`, `tools_field`, and `message_property_mappings`; see the
[dataset guide](/engine/guides/datasets/) for their expected shapes.

Next: the [config reference](/engine/reference/config/#dataset-settings) lists every
dataset option, including packing and validation splits.
