Chapter 3: Basic Prompt Structures
π― Learning Objectivesβ
After completing this chapter, you will be able to:
- Identify and apply four basic prompt structures
- Choose the right structure for different tasks
- Convert between different prompt formats
- Combine structures for complex tasks
π Introductionβ
Now that you understand prompt components and types, it's time to explore the structural formats you can use. Different structures work better for different tasks, and knowing when to use each is a key skill.
The Four Basic Structuresβ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FOUR BASIC PROMPT STRUCTURES β
βββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ€
β 1. QUESTION β Ask directly for information β
βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β 2. INSTRUCTION β Command the AI to perform a task β
βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β 3. COMPLETION β Start a sentence for AI to finish β
βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β 4. CONVERSATIONβ Role-play or dialogue format β
βββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββ
Structure 1: Question Formatβ
The most intuitive structureβsimply ask a question.
Characteristicsβ
| Aspect | Description |
|---|---|
| Format | Interrogative sentence (who, what, when, where, why, how) |
| Tone | Conversational, natural |
| Best for | Information retrieval, explanations, definitions |
| Limitation | May produce varied response lengths |
Examplesβ
Simple Question:
What are the three branches of the U.S. government?
Comparative Question:
What are the key differences between Python and JavaScript
for web development?
Analytical Question:
Why did the Roman Empire fall, and what lessons can modern
societies learn from it?
Hypothetical Question:
What would happen to Earth's climate if all ice caps
melted overnight?
Enhancing Question Promptsβ
Add constraints to get more useful responses:
Basic: "What is machine learning?"
Enhanced: "What is machine learning? Explain in 3 paragraphs:
1. A simple definition
2. How it differs from traditional programming
3. One real-world application"
Structure 2: Instruction Formatβ
Give direct commands or directions to the AI.
Characteristicsβ
| Aspect | Description |
|---|---|
| Format | Imperative sentences (verbs: write, create, analyze) |
| Tone | Direct, task-oriented |
| Best for | Content creation, analysis, transformations |
| Advantage | Clear expectations, predictable outputs |
Examplesβ
Content Creation:
Write a 150-word product description for a wireless
Bluetooth speaker targeting young professionals.
Emphasize portability and sound quality.
Analysis:
Analyze the following sales data and identify the top
3 performing products and potential reasons for their success:
[sales data here]
Transformation:
Rewrite this technical paragraph for a general audience
with no scientific background:
"The mitochondria facilitate oxidative phosphorylation
through the electron transport chain, generating ATP
via chemiosmotic coupling."
Organization:
Organize these project tasks into a prioritized list
based on dependencies and importance:
- Design UI mockups
- Set up database
- Write unit tests
- Deploy to production
- Define requirements
- Implement backend API
Instruction Verbs by Categoryβ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INSTRUCTION VERBS β
ββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββ€
β CREATION β Write, Create, Generate, Compose, Draft β
ββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββ€
β ANALYSIS β Analyze, Evaluate, Assess, Review, Compare β
ββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββ€
β TRANSFORMATION β Convert, Translate, Rewrite, Simplify β
ββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββ€
β ORGANIZATION β List, Categorize, Prioritize, Outline β
ββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββ€
β EXPLANATION β Explain, Describe, Clarify, Define β
ββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββ€
β PROBLEM SOLVINGβ Solve, Debug, Fix, Optimize, Improve β
ββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββ
Structure 3: Completion Formatβ
Start a sentence or paragraph and let the AI complete it.
Characteristicsβ
| Aspect | Description |
|---|---|
| Format | Incomplete sentence or text |
| Tone | Varies based on starter |
| Best for | Creative writing, brainstorming, specific styles |
| Advantage | Sets the exact tone and direction |
Examplesβ
Creative Completion:
The detective entered the abandoned warehouse, her
flashlight cutting through the darkness. She noticed
immediately that something was wrong because
Technical Completion:
The main advantages of using a NoSQL database over
a traditional SQL database include:
1.
Professional Completion:
Thank you for your interest in our company. After careful
review of your application, we are pleased to inform you that
List Completion:
Essential skills every software developer should master:
- Version control with Git
-
Completion vs. Instructionβ
Same task, different structures:
Instruction Format:
List 5 benefits of exercise.
Completion Format:
The top 5 benefits of regular exercise are:
1. Improved cardiovascular health, which
2.
The completion format gives you more control over the opening and style.
Structure 4: Conversation Formatβ
Create a dialogue or role-play scenario.
Characteristicsβ
| Aspect | Description |
|---|---|
| Format | Dialogue with defined roles |
| Tone | Interactive, contextual |
| Best for | Simulations, tutoring, customer service scenarios |
| Advantage | Natural follow-ups, maintained context |
Examplesβ
Role-Play:
You are a patient customer service representative for
a software company. I am a frustrated customer whose
subscription was charged twice.
Customer: Hi, I just noticed I was charged twice for
my monthly subscription. This is really frustrating!
Representative:
Interview Simulation:
You are an experienced interviewer for a senior developer
position. Ask me technical questions about system design,
one at a time, and evaluate my responses.
Interviewer: Let's begin. Can you tell me about a time
when you had to design a system to handle millions of
concurrent users?
Candidate: [waiting for your response]
Educational Dialogue:
You are a patient Socratic tutor teaching calculus.
Guide me to understand derivatives through questions
rather than direct explanations.
Student: I don't understand what a derivative is.
Tutor:
Conversation Techniquesβ
Setting the Scene:
Setting: A job interview at a tech startup
Characters:
- Interviewer (you): Friendly but thorough CTO
- Candidate (me): Applying for product manager role
Begin the interview with an icebreaker question.
Multi-Turn Instructions:
We're going to have a conversation about my business idea.
Ask me clarifying questions one at a time. After 5 questions,
provide a brief assessment of the idea's viability.
My idea: An app that connects pet owners with local pet sitters.
Choosing the Right Structureβ
Decision Frameworkβ
What's your primary goal?
ββ Get information/answers
β ββ Use QUESTION format
β
ββ Create or transform content
β ββ Use INSTRUCTION format
β
ββ Control style/tone precisely
β ββ Use COMPLETION format
β
ββ Simulate interaction/dialogue
ββ Use CONVERSATION format
Structure Comparison Tableβ
| Use Case | Recommended Structure | Example Start |
|---|---|---|
| Factual lookup | Question | "What is...?" |
| Writing content | Instruction | "Write a..." |
| Brainstorming | Completion | "Ideas for..." |
| Training scenarios | Conversation | "You are a..." |
| Code generation | Instruction | "Create a function that..." |
| Summarization | Instruction | "Summarize the following..." |
| Creative writing | Completion | "The story begins when..." |
| Problem solving | Question | "How would you solve...?" |
Combining Structuresβ
Advanced prompts often combine multiple structures:
Example: Instruction + Conversationβ
You are a helpful coding assistant. I'll describe bugs in
my code, and you'll help me fix them.
Rules:
1. Ask clarifying questions if needed
2. Explain the bug before providing the fix
3. Suggest how to prevent similar bugs
I'll start:
My Python script crashes with "IndexError: list index out
of range" when processing user data. Here's the code:
[code]
Example: Question + Completionβ
What are the main causes of climate change?
Format your answer as:
"The primary causes of climate change include:
1. [cause]: [explanation]
2. [cause]: [explanation]
..."
Example: Instruction + Questionβ
Analyze the following business proposal and answer these
questions:
1. What are the main strengths?
2. What are potential risks?
3. What's missing from the proposal?
[proposal text]
Practical Exerciseβ
Exercise: Structure Transformationβ
Take this basic question and rewrite it in all four structures:
Original: "What are the benefits of meditation?"
View Solutions
Question Format:
What are the top 5 scientifically-proven benefits of
regular meditation practice?
Instruction Format:
List and explain 5 key benefits of meditation, including
scientific evidence for each. Format as bullet points.
Completion Format:
Based on scientific research, the main benefits of
regular meditation include:
β’ Reduced stress levels, which occurs because
β’
Conversation Format:
You are a meditation instructor explaining the benefits
to a skeptical beginner.
Student: I've heard meditation is good for you, but what
does it actually do? I'm skeptical about all the claims.
Instructor:
Key Takeawaysβ
- Question format is best for information retrieval and explanations
- Instruction format provides clear direction for content creation and analysis
- Completion format gives precise control over style and tone
- Conversation format enables interactive, contextual exchanges
- Combine structures for complex tasks
- Choose based on your goal, desired control level, and task type
What's Next?β
Congratulations! You've completed Module 2. Test your knowledge with the Module 2 Quiz.