> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oumi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CHECK DATASET QUALITY

> Find rows with structural problems using quality tests and statistics, and remove them

A row with an empty turn or a missing user message can fail training or teach a model the wrong pattern. Oumi runs quality tests on every new version of a dataset, whether you upload it, generate it, delete rows, or restore a version. The tests flag the rows with structural problems, so you can remove them before you train or evaluate.

Quality tests check structure, not content. They don't detect wrong answers, duplicate rows, or repetitive phrasing. To check content, read rows in [Data Explorer](https://docs.oumi.ai/guides/datasets/manage.md#review-rows-in-data-explorer), or run an [evaluation](https://docs.oumi.ai/guides/evaluations.md).

## THE QUALITY TESTS

| Test | Severity | What it flags | Why it matters |
| - | - | - | - |
| `Non-alternating user/assistant turns` | High | Two user or two assistant messages in a row | Most chat templates expect user and assistant turns to alternate, so these rows can fail to format for training. Consecutive tool calls and results are allowed. |
| `Empty turns detected` | High | A message with no text | An empty message gives the model nothing to learn from. An assistant message that makes a tool call and has no text is not flagged. |
| `No user message` | High | A conversation with no user message | An evaluation has no prompt to send, and training has no request to learn a response to. |
| `System message not at start` | Medium | A system message after the first message | Models expect the system message first, and some chat templates reject it anywhere else. |
| `Total tokens exceed 8000` | Medium | A conversation longer than the threshold | Long rows can be cut off during training or exceed a model's context window. Keep them if your model supports long context. |

## REVIEW THE RESULTS

1. On the **Datasets** page, click the status in the **Quality Tests** column, such as `3/5 Tests Passed`. You can also open the dataset and click the **Quality Tests** tab.
2. Expand a test to see the rows that failed it and the reason for each failure.
3. Click a row to open the conversation.

![Quality Tests tab with four failed tests and the Empty turns detected test expanded to show its two failed rows](https://mintcdn.com/oumi/D0vKyXNqx2ohrLV9/images/datasets-quality-tests.jpg?fit=max\&auto=format\&n=D0vKyXNqx2ohrLV9\&q=85\&s=1af4adf6f821d05ec58c8bbd9afbf4d3)

Read a few flagged rows before you remove them. A flagged row can still be useful. For example, keep long rows if your model supports long context.

To analyze the results outside Oumi, click `Export Quality Tests` and choose JSONL or Parquet.

### STATISTICS

The **Statistics** tab summarizes the dataset as a whole. For each metric, such as tokens per row, turns per row, and tool turns, it shows the minimum, median, maximum, and total. Use it to check that the dataset matches what you expect, such as the number of turns in a multi-turn dataset, or the token count against your model's context window.

## REMOVE FAILED ROWS

1. On the **Quality Tests** tab, click `Delete Failed Rows`.
2. Select the tests whose failed rows you want to remove.
3. Choose where to save the result:
   * `Save to New Dataset` creates a separate dataset without the failed rows, and leaves this dataset unchanged. Choose it when evaluations or training runs use this dataset and should keep using the original.
   * `Delete Rows` removes the rows in a new version of this dataset. Oumi runs the quality tests again on the new version.

![Delete Failed Rows dialog with four failed tests selected and the Save to New Dataset and Delete Rows buttons](https://mintcdn.com/oumi/D0vKyXNqx2ohrLV9/images/datasets-delete-failed-rows.jpg?fit=max\&auto=format\&n=D0vKyXNqx2ohrLV9\&q=85\&s=95593c835621e5d93fd69c75e74f9207)

`Delete Failed Rows` appears only on the latest version. `Delete Rows` keeps the earlier version, so you can [restore it](https://docs.oumi.ai/guides/datasets/manage.md#versions) if you remove too much.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.