# unnatural_instructions

<br />

- **Description**:

Dataset described in the paper: Unnatural Instructions: Tuning Language Models
with (Almost) No Human Labor (2022). Contains sets of natural-language
instructions, with optional constraints / LLM-generated reformulations.

- **Homepage** :
  <https://github.com/orhonovich/unnatural-instructions>

- **Source code** :
  [`tfds.text.unnatural_instructions.UnnaturalInstructions`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/text/unnatural_instructions/unnatural_instructions.py)

- **Versions**:

  - **`0.0.1`** (default): Initial release. Omit instructions / inputs, as they require additional processing to be used. Instruction_with_inputs and reformulations contain instructions and contexts.
- **Download size** : `17.48 MiB`

- **Dataset size** : `154.71 MiB`

- **Auto-cached**
  ([documentation](https://www.tensorflow.org/datasets/performances#auto-caching)):
  Only when `shuffle_files=False` (train)

- **Splits**:

| Split | Examples |
|---|---|
| `'train'` | 66,010 |

- **Feature structure**:

    FeaturesDict({
        'id': Text(shape=(), dtype=string),
        'instances': Sequence({
            'constraints': Text(shape=(), dtype=string),
            'input': Text(shape=(), dtype=string),
            'instruction_with_input': Text(shape=(), dtype=string),
            'output': Text(shape=(), dtype=string),
        }),
        'instruction': Text(shape=(), dtype=string),
        'reformulations': Sequence({
            'input': Text(shape=(), dtype=string),
            'instruction': Text(shape=(), dtype=string),
            'instruction_with_input': Text(shape=(), dtype=string),
            'output': Text(shape=(), dtype=string),
        }),
    })

- **Feature documentation**:

| Feature | Class | Shape | Dtype | Description |
|---|---|---|---|---|
|   | FeaturesDict |   |   |   |
| id | Text |   | string | Unique identifier for example. |
| instances | Sequence |   |   |   |
| instances/constraints | Text |   | string | Task-specific constraints. |
| instances/input | Text |   | string | Input to be fed into placeholders for given instruction. |
| instances/instruction_with_input | Text |   | string | Instructions with inputs supplied to placeholders. |
| instances/output | Text |   | string | Target output for given task. |
| instruction | Text |   | string | Instruction with placeholder for inputs. |
| reformulations | Sequence |   |   |   |
| reformulations/input | Text |   | string | Input to be fed into placeholders for given instruction. |
| reformulations/instruction | Text |   | string | Instruction with placeholder for inputs. |
| reformulations/instruction_with_input | Text |   | string | Instructions with inputs supplied to placeholders. |
| reformulations/output | Text |   | string | Target output for given task. |

- **Supervised keys** (See
  [`as_supervised` doc](https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args)):
  `None`

- **Figure**
  ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):
  Not supported.

- **Examples**
  ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):

<button id="displaydataframe">Display examples...</button>

- **Citation**:

    @misc{honovich2022unnatural,
          title = {Unnatural Instructions: Tuning Language Models with (Almost) No Human Labor},
          author = {Honovich, Or and Scialom, Thomas and Levy, Omer and Schick, Timo},
          url = {https://arxiv.org/abs/2212.09689},
          publisher = {arXiv},
          year={2022}
    }