Skip to content

Commit e131e95

Browse files
caitlinwheelesscaitlinwheeless
and
caitlinwheeless
authored
docs: DOC-259: Enhance Prompt and other fixes (#6591)
Co-authored-by: caitlinwheeless <[email protected]>
1 parent 407e456 commit e131e95

File tree

4 files changed

+38
-8
lines changed

4 files changed

+38
-8
lines changed

docs/source/guide/prompts_create.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ date: 2024-06-11 16:53:16
1414

1515
## Prerequisites
1616

17-
* An OpenAI API key or an Azure OpenAI key.
17+
* An API key for your LLM.
1818
* A project that meets the [criteria noted below](#Create-a-Prompt).
1919

2020
## Model provider API keys
2121

22-
You can specify one OpenAI API key and/or multiple Azure OpenAI keys per organization. Keys only need to be added once.
22+
You can specify one OpenAI API key and/or multiple custom and Azure OpenAI keys per organization. Keys only need to be added once.
2323

2424
Click **API Keys** in the top right of the Prompts page to open the **Model Provider API Keys** window:
2525

@@ -120,10 +120,11 @@ From the Prompts page, click **Create Prompt** in the upper right and then compl
120120
* For text classification, this means that the labeling configuration for the project must use `Choice` tags.
121121
* For NER, this means that the labeling configuration for the project must use `Label` tags.
122122
* The project must have one output type (`Choice` or `Label`) and not a mix of both.
123+
* The project cannot include multiple `Choices` or `Labels` blocks in its labeling configuration.
123124
* The project must include text data. While it can include other data types such as images or video, it must include `<Text>`.
124125
* You must have access to the project. If you are in the Manager role, you need to be added to the project to have access.
125126
* The project cannot be located in your Personal Sandbox workspace.
126-
* While projects connected to an ML backend will still appear in the list of eligible projects, we do not recommend using Prompts with an ML backend.
127+
* While projects connected to an ML backend will still appear in the list of eligible projects, we do not recommend using Prompts with an ML backend as this can interfere with how accuracy and score are calculated when evaluating the prompt.
127128

128129
## Types
129130

docs/source/guide/prompts_draft.md

+33-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ With your [Prompt created](prompts_create), you can begin drafting your prompt c
1818

1919
1. Select your base model.
2020

21-
The models that appear depend on the [API keys](prompts_create#Model-provider-API-keys) that you have configured for your organization. If you have added an OpenAI key, then you will see all supported OpenAI models. If you have added Azure OpenAI keys, then you will see one model per each deployment that you have added.
21+
The models that appear depend on the [API keys](prompts_create#Model-provider-API-keys) that you have configured for your organization. If you have added an OpenAI key, then you will see all supported OpenAI models. If you have other API keys, then you will see one model per each deployment that you have added.
2222

2323
For a description of all OpenAI models, see [OpenAI's models overview](https://platform.openai.com/docs/models/models-overview).
2424
2. In the **Prompt** field, enter your prompt. Keep in mind the following:
25-
* You must include the text class. (In the demo below, this is the `review` class.) Click the text class name to insert it into the prompt.
25+
* You must include the text variables. These appear directly above the prompt field. (In the demo below, this is the `review` variable.) Click the text variable name to insert it into the prompt.
2626
* Although not strictly required, you should provide definitions for each class to ensure prediction accuracy and to help [add context](#Add-context).
27+
28+
!!! info Tip
29+
You can generate an initial draft by simply adding the text variables and then [clicking **Enhance Prompt**](#Enhance-prompt).
30+
2731
3. Select your baseline:
2832
* **All Project Tasks** - Generate predictions for all tasks in the project. Depending on the size of your project, this might take some time to process. This does not generate an accuracy score for the prompt.
2933

@@ -162,19 +166,44 @@ NER
162166
</td>
163167
<td>
164168

165-
The cost to run the prompt evaluation based on the number of tokens required.
169+
The cost to run the prompt based on the number of tokens required.
166170

167171
</td>
168172
</tr>
169173
</table>
170174

175+
## Enhance prompt
176+
177+
You can use **Enhance Prompt** to help you construct and auto-refine your prompts.
178+
179+
At minimum, you need to insert the text variable first. (Click the text variable name to insert it into the prompt. These appear above the prompts field).
180+
181+
From the **Enhance Prompt** window you will need to select the **Teacher Model** that you want to use to write your prompt. As you auto-refine your prompt, you'll get the following:
182+
183+
* A new prompt displayed next to the previous prompt.
184+
* An explanation of the changes made.
185+
* The estimated cost spent auto-refining your prompt.
186+
187+
![Screenshot of enhance prompt modal](../images/prompts/enhance.png)
188+
189+
**How it works**
190+
191+
The **Task Subset** is used as the context when auto-refining the prompt. If you have ground truth data available, that will serve as the task subset. Otherwise, a sample of up to to 10 project tasks are used.
192+
193+
Auto-refinement applies your initial prompt and the Teacher Model to generate predictions on the task subset (which will be ground truth tasks or a sample dataset). If applicable, predictions are then compared to the ground truth for accuracy.
194+
195+
Your Teacher Model evaluates the initial prompt’s predictions against the ground truth (or sample task output) and identifies areas for improvement. It then suggests a refined prompt, aimed at achieving closer alignment with the desired outcomes.
196+
197+
198+
199+
171200
## Drafting effective prompts
172201

173202
For a comprehensive guide to drafting prompts, see [The Prompt Report: A Systematic Survey of Prompting Techniques](https://arxiv.org/abs/2406.06608) or OpenAI's guide to [Prompt Engineering](https://platform.openai.com/docs/guides/prompt-engineering).
174203

175204
### Text placement
176205

177-
When you place your text class in the prompt (`review` in the demo above), this placeholder will be replaced by the actual text.
206+
When you place your text variable in the prompt (`review` in the demo above), this placeholder will be replaced by the actual text.
178207

179208
Depending on the length and complexity of your text, inserting it into the middle of another sentence or thought could potentially confuse the LLM.
180209

docs/source/guide/prompts_overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ date: 2024-05-15 14:30:14
1313

1414
Use Prompts to evaluate and refine your LLM prompts and then generate predictions to automate your labeling process.
1515

16-
All you need to get started is an OpenAI API key and a project.
16+
All you need to get started is an LLM deployment API key and a project.
1717

1818
With Prompts, you can:
1919

Loading

0 commit comments

Comments
 (0)