# Upload a dataset

Upload a file or import a Hugging Face dataset, and tell Arena which columns hold what, so you can pick it as training data in an experiment.

Datasets belong to your organization, so every project can use them. Each dataset has one type:

| Type           | Each row holds                                          |
|----------------|---------------------------------------------------------|
| **SFT**        | A prompt and the target reply                           |
| **Preference** | A prompt, a chosen reply and a rejected reply           |
| **Reasoning**  | A question and an answer your reward function can check |
| **Traces**     | A recorded conversation                                 |

The type decides which algorithms can train on it. See [Algorithms by training data](../reference/algorithms.md#by-training-data).

## Upload the data

The web app takes a CSV or Parquet file, a folder in Hugging Face layout (Parquet files per config), or a dataset you search for on Hugging Face. The CLI also takes JSONL.

### Web app

1. Click **Datasets** in the sidebar, then **New dataset**.
2. Enter a **Dataset name** and an optional **Description**, and choose the **Type**.
3. Add the data. Search Hugging Face in **Select dataset**, or click **Upload a CSV or Parquet** or **Upload a folder**. When the dataset has more than one configuration, such as `main` and `socratic` for GSM8K, choose one in **Select configuration**.
   ![The New Dataset panel with name, description, type and data source fields](tutorials/_images/upload-reasoning-dataset/02-create-dataset-modal.png)The **New Dataset** panel.
4. Click **Create**. The dataset opens so you can map its columns.
5. Each type has its roles across the top of the table: click a role, then the column that holds it. Click a role again to clear it. When every role is set, click **Confirm Selection**.

Confirm the columns before you use the dataset in an experiment. The wizard won’t move on from a dataset whose roles aren’t set.

### CLI

Create the dataset and map its columns in one command. The keys of `--column-mapping` are Arena’s role names; the values are your file’s column names.

```bash
arena datasets create math-word-problems \
    --category reasoning \
    --file ./reasoning.csv \
    --column-mapping '{"question": "question", "answer": "answer"}'
```

To import from Hugging Face instead of a file, pass `--hf-dataset`, `--hf-split` and, when the dataset has more than one configuration, `--hf-config`. The commands for each type are below. Flags are in the [command reference](../cli/command-reference.md).

```bash
arena datasets list
```

## SFT

Each row is a prompt and the reply the model should learn to write. Map **Prompt** and **Target**. Example: [`sft.csv`](/_downloads/330c4a58b606472c4eb9c121570f8f19/sft.csv), with `instruction` and `response` columns.

CLI:

```bash
arena datasets create support-tickets-sft \
    --category sft \
    --file ./sft.csv \
    --column-mapping '{"prompt": "instruction", "target": "response"}'
```

If your data is whole conversations, with several turns or tool calls, use [Traces](train-on-traces.md) instead.

## Preference

Each row is a prompt with a better and a worse reply. In the web app, map **Question** (the prompt), **Chosen** and **Rejected**. The CLI calls the **Question** role `prompt`. Example: [`prefs.csv`](/_downloads/a902a2232278bbefcf587bed38a729de/prefs.csv).

CLI:

```bash
arena datasets create assistant-prefs \
    --category preference \
    --file ./prefs.csv \
    --column-mapping '{"prompt": "prompt", "chosen": "chosen", "rejected": "rejected"}'
```

## Reasoning

Each row is a question and an answer. During training the model writes its own answer and your reward function scores it against the row’s answer, so the answer must be something code can check, such as a number. Map **Question** and **Answer**. Example: [`reasoning.csv`](/_downloads/4b53606af46a504e94f898a04acfe97f/reasoning.csv).

CLI:

```bash
arena datasets create gsm8k \
    --category reasoning \
    --hf-dataset openai/gsm8k \
    --hf-config main \
    --hf-split train \
    --column-mapping '{"question": "question", "answer": "answer"}'
```

A reasoning experiment also needs a prompt template and a reward function: see [Write prompts and reward functions](prompts-and-rewards.md).

## Traces

Traces are conversations recorded from a model or agent, in the OpenAI chat format. They have no columns to map. See [Train on traces](train-on-traces.md).
