- Blog
- Analysis of Prompt Elements
Analysis of Prompt Elements
Analysis of Prompt Elements
If you have engaged with numerous examples and applications of prompt engineering, you will notice that prompt words are composed of several key elements.Prompt words can include any of the following elements:
- Instruction: A specific task or directive for the model to execute.
- Context: External information or additional contextual details provided to guide the language model’s response.
- Input Data: The content or question entered by the user.
- Output Indication: Specification of the output type or format.
To better demonstrate the elements of prompt words, here is a simple prompt designed for a text classification task:Prompt
Plaintext
Please classify the text as neutral, negative, or positive Text: I think the food is okay. Sentiment:
In the prompt example above, the instruction is "classify the text as neutral, negative, or positive". The input data is the part "I think the food is okay", and the output indication used is "Sentiment:". Note that this basic example does not use context, though context can also be provided as part of the prompt. For instance, the context for this text classification prompt could include additional examples provided within the prompt to help the model better understand the task and guide the expected output type.
Note that the required format for prompts depends on the type of task you want the language model to perform, and not all of the above elements are mandatory. We will provide more specific examples in subsequent guides.