Elements of a Prompt
When working with AI models, the prompt - the input instruction - plays a crucial role. Certain building blocks recur again and again. A prompt consists of one or more of the following elements:
Instruction
Describes the concrete task the model should perform.
Context
Provides additional information that helps generate more precise answers.
Input Data
Contains the actual input or question for which an answer is sought.
Output Indicator
Indicates in which format or in what way the answer should be provided.
To illustrate these elements, let’s look at a simple example of a text classification task:
Klassifizieren Sie den Text in neutral, negativ oder positiv
Text: Ich denke, das Essen war okay.
Stimmung:Stimmung: neutral
In this example, the instruction is to classify the text. The text itself provides the input data, and the cue “Stimmung:” indicates the format in which the answer should appear. In this case, no additional context was used, but it could be added to support the model more effectively.
Not every prompt needs to include all four elements. Which ones you use always depends on the specific task.