Q1. What are the essential components of a basic prompt structure?
A basic prompt typically has three core components:
• Instruction – tells the model what to do (e.g., "Summarize", "Translate", "List")
• Context – optional background information that helps the model understand the situation
• Input data – the specific text or question you want the model to act upon
Example: Instruction: "Translate the following sentence to French." Input data: "Hello, how are you?"
Without clear separation of components, the model may misinterpret the task.
• Instruction – tells the model what to do (e.g., "Summarize", "Translate", "List")
• Context – optional background information that helps the model understand the situation
• Input data – the specific text or question you want the model to act upon
Example: Instruction: "Translate the following sentence to French." Input data: "Hello, how are you?"
Without clear separation of components, the model may misinterpret the task.
Q2. How do you structure a prompt for a classification task?
For classification, include:
1. The instruction (what to classify into which categories)
2. The categories (list possible labels)
3. The input text
4. Desired output format
Example: "Classify the customer review as 'Positive', 'Neutral', or 'Negative'. Output only the label. Review: The battery life is amazing but the screen is too dim."
This structured prompt leaves no ambiguity about the expected output.
1. The instruction (what to classify into which categories)
2. The categories (list possible labels)
3. The input text
4. Desired output format
Example: "Classify the customer review as 'Positive', 'Neutral', or 'Negative'. Output only the label. Review: The battery life is amazing but the screen is too dim."
This structured prompt leaves no ambiguity about the expected output.
Q3. Why should you put the instruction at the beginning or end of a prompt?
Research shows LLMs pay more attention to the start and end of a prompt (primacy/recency effect).
Instructions in the middle are more likely to be ignored or forgotten (lost in the middle problem).
Place the main instruction either first (after any system message) or last (right before the expected output).
For example: "List three benefits of exercise." then provide context, OR provide context then "Based on the above, list three benefits."
This improves instruction following.
Instructions in the middle are more likely to be ignored or forgotten (lost in the middle problem).
Place the main instruction either first (after any system message) or last (right before the expected output).
For example: "List three benefits of exercise." then provide context, OR provide context then "Based on the above, list three benefits."
This improves instruction following.
Q4. How does adding separators (like ### or ---) improve prompt structure?
Separators visually and logically divide different parts of the prompt.
They help the model distinguish between instruction, context, examples, and input.
Example:
Without separators, the model might blend instruction and input together, causing confusion.
Consistent separators lead to more reliable outputs.
They help the model distinguish between instruction, context, examples, and input.
Example:
Instruction: Summarize the text below.
###
Text: ... (long paragraph)
###
Summary: ...Without separators, the model might blend instruction and input together, causing confusion.
Consistent separators lead to more reliable outputs.
Q5. What is the difference between a task description and an input placeholder?
Task description tells the model what to do (action).
Input placeholder indicates where the variable data goes.
Example:
The placeholder is replaced with actual data when sending the prompt.
This separation allows you to reuse the same prompt template for different inputs.
It's especially useful in applications like chatbots or batch processing.
Input placeholder indicates where the variable data goes.
Example:
Task: Translate the following from English to Spanish.
Input: {user_input}The placeholder is replaced with actual data when sending the prompt.
This separation allows you to reuse the same prompt template for different inputs.
It's especially useful in applications like chatbots or batch processing.
