Lesson 4 – Examples and Structured Output
Course 3 – Prompt Engineering
Level: Beginner → Intermediate
Introduction
In this lesson we will learn how Examples and Structured Output produce a desired result. In the previous lessons, we learned how to create effective prompts using instructions, context, roles, and objectives. These elements help AI understand what we want and why we want it.
However, there is another powerful technique that can dramatically improve the quality and consistency of AI responses:
Providing examples and defining structured output.
Many users assume that AI automatically knows the exact format they want. As a result, they receive responses that are technically correct but difficult to use.
For example, a business owner may ask for marketing ideas but receive a long paragraph instead of a clear action plan. A student may request study notes but receive a detailed essay instead of concise revision points.
Examples and structured output help eliminate this problem.
When you provide examples, you show AI exactly what type of response you expect. When you define a structure, you guide AI to organize information in a useful and predictable way.
Think of it like giving instructions to a new employee. Instead of simply saying:
Create a report.
You might provide a sample report and explain the preferred format.
The employee now understands exactly what success looks like.
The same principle applies to AI.
In this lesson, you will learn how examples and structured output improve AI performance and how to use these techniques to generate clearer, more professional, and more useful results.
Learning Objectives
By the end of this lesson, you will be able to:
✓ Understand the importance of examples
✓ Use examples to improve AI responses
✓ Define structured output formats
✓ Create tables, lists, templates, and checklists
✓ Improve response consistency
✓ Reduce ambiguity in prompts
✓ Build professional-quality prompts
Why Examples Matter
Humans learn through examples.
AI systems also benefit from examples.
When you provide an example, you reduce uncertainty and clearly communicate your expectations.
Consider the following prompt.
Prompt
Write a product description.
This instruction is vague.
Questions remain:
- What style?
- What length?
- What format?
- What audience?
Now consider:
Write a product description similar to the example below:
“A lightweight and durable backpack designed for students and professionals. Features multiple compartments, comfortable shoulder straps, and water-resistant materials.”
The example provides guidance.
The AI now understands:
- Tone
- Style
- Length
- Structure
As a result, the output becomes more predictable.
Learning Through Demonstration
Examples act as demonstrations.
Instead of describing what you want, you show what you want.
This often produces better results.
Without Example
Write a social media post.
The AI has many possible interpretations.
With Example
Write a social media post similar to:
“Small improvements made consistently can create extraordinary results over time. Start learning one new skill today.”
The AI now has a reference point.
Few-Shot Prompting
In prompt engineering, providing examples is often called:
Few-Shot Prompting
A few-shot prompt contains one or more examples that guide the AI.
Example:
Input
Customer:
My order arrived late.
Response:
We apologize for the delay and appreciate your patience.
Customer:
The product arrived damaged.
Response:
We’re sorry to hear that. Please contact our support team for assistance.
Customer:
I received the wrong item.
Response:
The AI learns from the examples and generates a similar response.
This technique is widely used in professional AI applications.
What Is Structured Output?
Structured output means specifying how the response should be organized.
Instead of allowing AI to choose the format, you define it.
Examples include:
- Tables
- Bullet points
- Numbered lists
- Checklists
- Templates
- Reports
- Action plans
- Step-by-step guides
Structured output makes information easier to read and use.
Why Structured Output Matters
Imagine asking:
List ten AI careers.
The AI may generate a long paragraph.
Now compare:
Present ten AI careers in a table showing job title, description, and required skills.
The information becomes easier to understand.
Structured output improves:
- Readability
- Consistency
- Organization
- Decision-making
- Productivity
Common Structured Output Formats
1. Bullet Points
Bullet points are ideal for:
- Summaries
- Key ideas
- Benefits
- Recommendations
Example:
Explain the benefits of artificial intelligence using bullet points.
Output:
- Improved productivity
- Automation of repetitive tasks
- Faster decision-making
- Enhanced customer service
2. Numbered Lists
Useful for:
- Processes
- Procedures
- Action plans
Example:
Create a step-by-step guide for starting a blog.
Output:
- Choose a topic
- Select a domain name
- Create a website
- Publish content
- Promote your blog
3. Tables
Tables organize information effectively.
Example:
Present the following AI careers in a table.
|
Career |
Description |
Skills |
|
AI Trainer |
Trains AI systems |
Communication |
|
Data Analyst |
Analyzes data |
Analytics |
Tables are useful for comparisons and decision-making.
4. Checklists
Useful for:
- Project management
- Planning
- Task completion
Example:
Create a checklist for publishing an eBook.
Output:
✓ Complete manuscript
✓ Edit content
✓ Design cover
✓ Upload to Amazon KDP
✓ Publish
5. Templates
Templates save time and improve consistency.
Example:
Create a professional email template.
Output:
Subject:
Dear [Name],
Thank you for…
Sincerely,
[Your Name]
6. Reports
Reports are useful for business and research tasks.
Example:
Create a market analysis report.
Suggested structure:
- Executive Summary
- Market Overview
- Opportunities
- Risks
- Recommendations
Combining Examples and Structured Output
The most effective prompts often combine both techniques.
Example:
Create a social media post using the format below.
Headline:
Main Message:
Call to Action:
Example:
Headline: Learn AI Today
Main Message: AI skills are becoming increasingly valuable.
Call to Action: Visit our website.
This prompt provides:
✓ An example
✓ A structure
The result is usually more consistent.
Weak Prompt vs Strong Prompt
Weak Prompt
Create a study plan.
The response could take many forms.
Strong Prompt
Create a 30-day AI learning plan.
Present the information in a table with the following columns:
Day
Topic
Activity
Expected Outcome
The stronger prompt produces a more useful output.
Real-World Applications
Education
Students can request:
- Study plans
- Revision notes
- Practice tests
Example:
Create a biology revision guide using bullet points.
Business
Managers can request:
- Action plans
- Reports
- Meeting agendas
Example:
Create a project plan in table format.
Marketing
Marketers can request:
- Content calendars
- Campaign plans
- Social media schedules
Example:
Create a 30-day content calendar in a table.
Research
Researchers can request:
- Literature summaries
- Comparison tables
- Data analysis reports
Example:
Compare three renewable energy technologies using a table.
Common Mistakes
Mistake 1: No Format Specified
Prompt:
Explain digital marketing.
The AI chooses its own format.
Better:
Explain digital marketing using five bullet points.
Mistake 2: Poor Examples
Unclear examples often produce unclear results.
Provide examples that accurately represent your desired output.
Mistake 3: Overly Complex Structure
Too many requirements can confuse both the user and the AI.
Keep structures practical and relevant.
Mistake 4: Inconsistent Examples
If examples contradict instructions, output quality may decline.
Advanced Structured Output Techniques
As you become more experienced, you can request highly specific structures.
Examples:
SWOT Analysis
- Strengths
- Weaknesses
- Opportunities
- Threats
Project Plan
- Goal
- Tasks
- Timeline
- Resources
Business Proposal
- Problem
- Solution
- Benefits
- Costs
- Recommendations
These structures help produce professional-quality outputs.
Practical Exercise
Improve the following prompts.
Prompt 1
Give me business ideas.
Add a table structure.
Prompt 2
Write a social media post.
Provide an example and format.
Prompt 3
Create a study plan.
Specify a structured output.
Prompt 4
Compare AI careers.
Request a comparison table.
Observe how the results improve when examples and structures are included.
Knowledge Check
- Why do examples improve AI responses?
- What is structured output?
- Name five common structured output formats.
- What is few-shot prompting?
- Why are tables useful?
Lesson Summary
Examples help AI understand exactly what type of response you want.
Structured output tells AI how to organize information.
Together, these techniques improve:
- Clarity
- Consistency
- Readability
- Professionalism
- Productivity
By combining examples with structured output, users can create prompts that generate more accurate and useful results.
These skills are widely used by professionals in education, business, marketing, research, and content creation.
Next Lesson
Lesson 5 – Improving Weak Prompts
Learn how to identify common prompt weaknesses, transform vague requests into effective instructions, and systematically improve AI responses through prompt refinement techniques.