March 13, 2024

Prompt Design

In prompt structure, various components come together to create a prompt.

These components include:

  1. Instruction: A specific task or action you want the model to perform.
  2. Context: Additional information or context to guide the model towards better responses.
  3. Input Data: The question or information you want the model to respond to.
  4. Output Indicator: The format or type of the output.

To illustrate these elements, consider the following prompt example for a text classification task:

Prompt

Determine the mood of the following statement as either joyful, sorrowful, or indifferent.
Text: The weather today makes me feel gloomy.
Mood:

In the example above, the task description is to "Determine the mood of the following statement as either joyful, sorrowful, or indifferent", which directs the classification process. The input data is "The weather today makes me feel gloomy.", and the output label is indicated by "Mood:".

While this simple illustration doesn't incorporate contextual information, adding such details could enhance the prompt. For example, providing additional mood classification examples within the prompt can assist the model in better grasping the assignment and guiding the expected output type.

Get API Key