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

# Prompt and response generation

> Learn how to create fine-tuning datasets of prompts and responses for LLMs.

You can prepare a dataset of prompts and responses to fine-tune large language models (LLMs). Labelbox supports dataset creation for a variety of fine-tuning tasks including summarization, classification, question-answering, and generation.

<Frame caption="Fine-tuning is useful when an LLM needs to learn something specific outside of the data it was trained on. In this case, the model is being fine-tuned to extract product SKUs from reviews.">
  <img src="https://mintcdn.com/labelbox-1db23ff4/Y2wXEmSLwSvn6HCD/images/docs/44ea498-Screenshot_2023-06-28_at_3.31.16_PM.png?fit=max&auto=format&n=Y2wXEmSLwSvn6HCD&q=85&s=f29ff1a1f0394c1d7e40c40c949c3716" width="3024" height="1730" data-path="images/docs/44ea498-Screenshot_2023-06-28_at_3.31.16_PM.png" />
</Frame>

## Set up prompt and response generation

When you set up a prompt and response generation project, you will be prompted to specify *how* you will use the editor with the following three options:

<Frame>
  <img src="https://mintcdn.com/labelbox-1db23ff4/_MDTDLWsYj4TKxT6/images/docs/a6130e9-select-llm-project-type.png?fit=max&auto=format&n=_MDTDLWsYj4TKxT6&q=85&s=77f3d82a2a8a12b36f2d0ed8db76a621" alt="" width="3024" height="962" data-path="images/docs/a6130e9-select-llm-project-type.png" />
</Frame>

* **Humans generate prompts and responses**: In the editor, the prompt and response fields will be required. This will indicate to your team they should create a prompt and a response from scratch.
* **Humans generate prompts**: In the editor, only the prompt field will be required. This will indicate to your team that they should create a prompt from scratch.
* **Humans generate responses to uploaded prompts**: In the editor, a previously uploaded prompt will appear. Your team will need to create responses for that prompt.

<Info>
  ### Benchmark and consensus support

  [Benchmarks](/docs/benchmark) and [Consensus](/docs/consensus) are only available for the **Humans generate responses to uploaded prompts** option.
</Info>

### Specify prompts and/or responses

When setting up the project,

* If you select **Humans generate prompts**, you will need to specify a prompt for your labelers to reference so they can generate more prompts. Prompts are restricted to free-form text format. You can optionally set a character minimum and maximum for prompt data.

* If you select **Humans generate prompts and responses**, you will need to specify a prompt *and* a response for your labelers to reference so they can generate more prompts and responses. See [Supported prompt formats](#supported-prompt-formats) and [Supported response format](#supported-response-formats) for supported format types.

<Warning>
  ### Markdown editor size limit

  When using the Markdown editor to specify a prompt or response, limit the character count to fewer than 6,000 characters.
</Warning>

### Import prompts

During the project setup, if you select **Humans generate responses to uploaded prompts** as your LLM data generation workflow, you will need to create an import file containing links to a set of prompts in text format. Then, upload your import file and send the prompts to the project.

Follow these steps to upload prompt data to Labelbox:

1. Create the import file containing links to the prompts. See [Import text data](/reference/import-text-data) to learn how to structure your import file.
2. [Upload the import file](/docs/datasets-datarows#create-a-dataset-via-the-app-ui) to Labelbox.
3. Save the prompts in a batch and send the batch to your project. See [Batches](/docs/batches) for instructions.

<Info>
  ### Data row size limit

  To view the maximum size allowed for a data row, visit our [limits](/docs/limits) page.
</Info>

## Supported prompt formats

If you selected an LLM data generation workflow that involves generating a prompt in the editor, you will need to specify a prompt to use as the ontology. Each LLM data generation ontology is limited to one prompt.

| Feature                     | Import format | Export format                                                    |
| --------------------------- | ------------- | ---------------------------------------------------------------- |
| **Prompt - Free-form text** | N/A           | [See payload](/reference/export-text-annotations#free-form-text) |

## Supported response formats

If you selected an LLM data generation workflow that involves generating a response in the editor, you will need to specify a set of responses to use as the ontology. Below are the supported formats you may include when you are specifying responses in your ontology. Responses can be applied at the global level and/or nested within other responses. LLM data generation ontologies support multiple responses.

| Feature                  | Import format | Export format                                                    |
| ------------------------ | ------------- | ---------------------------------------------------------------- |
| **Response - Text**      | N/A           | [See payload](/reference/export-text-annotations#radio)          |
| **Response - Radio**     | N/A           | [See payload](/reference/export-text-annotations#checklist)      |
| **Response - Checklist** | N/A           | [See payload](/reference/export-text-annotations#free-form-text) |

### Response - Text

Create a text response by selecting a response type of **Text** during ontology creation. You can optionally set a character minimum and maximum for text-type responses.

<Frame>
  <img src="https://mintcdn.com/labelbox-1db23ff4/Y2wXEmSLwSvn6HCD/images/docs/4d8b3b2-Screenshot_2023-06-28_at_5.13.57_PM.png?fit=max&auto=format&n=Y2wXEmSLwSvn6HCD&q=85&s=5dcf9d617472477f1c654e5377aab2a5" alt="" width="1810" height="1104" data-path="images/docs/4d8b3b2-Screenshot_2023-06-28_at_5.13.57_PM.png" />
</Frame>

### Response - Radio

Create a radio response by selecting a response type of **Radio** during ontology creation. Radio responses support nested sub-classifications.

<Frame>
  <img src="https://mintcdn.com/labelbox-1db23ff4/60Lzt2PDK3fJCHcg/images/docs/ff2aff1-Screenshot_2023-06-28_at_5.22.59_PM.png?fit=max&auto=format&n=60Lzt2PDK3fJCHcg&q=85&s=003cde5983989f137b8ab339b45e50f1" alt="" width="1880" height="1152" data-path="images/docs/ff2aff1-Screenshot_2023-06-28_at_5.22.59_PM.png" />
</Frame>

### Response - Checklist

Create a checklist response by selecting a response type of **Checklist** during ontology creation. Checklist responses support nested sub-classifications.

<Frame>
  <img src="https://mintcdn.com/labelbox-1db23ff4/_MDTDLWsYj4TKxT6/images/docs/b71d123-Screenshot_2023-06-28_at_5.29.44_PM.png?fit=max&auto=format&n=_MDTDLWsYj4TKxT6&q=85&s=3013d2c773ecd98acaa67c7dddbe61f0" alt="" width="1828" height="1208" data-path="images/docs/b71d123-Screenshot_2023-06-28_at_5.29.44_PM.png" />
</Frame>
