Duration: 60 minutes
Introduction
Master craftspeople follow principles that guide their work. Similarly, effective prompters follow proven strategies that consistently produce better results. In this lesson, you’ll learn the fundamental principles that separate mediocre prompts from exceptional ones.The Four Core Principles
Principle 1: Clarity & Specificity
Narrow the possibility space with precise instructions
Principle 2: Guide Reasoning
Direct the model’s thinking process step-by-step
Principle 3: Provide Context
Ground responses with relevant background information
Principle 4: Format Matters
Structure influences how models interpret your intent
Principle 1: Clarity and Specificity
The Problem with Vague Prompts
LLMs can interpret vague prompts in countless ways. Specificity narrows the possibility space, guiding the model toward your intended outcome.Examples: Vague vs. Specific
- ❌ Vague
- ✅ Specific
- Too broad - could cover any aspect
- No scope defined
- Unclear audience level
- No format specified
Specificity Checklist
When crafting prompts, ask yourself:What exactly do I want?
What exactly do I want?
- Define the core task clearly
- Specify the type of output (explanation, list, code, etc.)
- State the purpose or goal
Who is the audience?
Who is the audience?
- Technical level (beginner, intermediate, expert)
- Age group or background
- Prior knowledge assumptions
What constraints apply?
What constraints apply?
- Length (word count, character limit)
- Format (bullet points, paragraphs, JSON)
- Tone (formal, casual, professional)
- Style (technical, conversational, academic)
What should be included/excluded?
What should be included/excluded?
- Required elements
- Topics to avoid
- Specific examples needed
- Level of detail
Practice: Making Prompts Specific
- Exercise 1
- Exercise 2
Vague: “Write about dogs.”Your turn: Make this specific by defining:
- What aspect of dogs?
- What format?
- What audience?
- What length?
Sample Solution
Sample Solution
Principle 2: Guide the Reasoning Process
Why Reasoning Guidance Matters
LLMs can jump to conclusions. Explicit reasoning guidance activates deeper thinking and improves accuracy, especially for complex tasks.The “Let’s Think Step-by-Step” Phenomenon
Research shows that simply adding this phrase significantly improves LLM performance on reasoning tasks.- Without Guidance
- With Reasoning Guidance
Reasoning Patterns
Sequential Steps
Think-Then-Answer
Explain-Your-Work
Self-Verification
Complex Problem Example
Principle 3: Provide Reference Information
The Hallucination Problem
LLMs can generate plausible-sounding but incorrect information. Providing context grounds responses in facts.Without Context vs. With Context
- ❌ Without Context
- ✅ With Context (RAG Approach)
- Invent a plausible answer
- Admit it doesn’t know (better)
- Confuse with past Olympics
When to Provide Context
1
Factual Questions
Provide source documents, data, or verified information
2
Domain-Specific Tasks
Include relevant background, terminology, or constraints
3
Document Analysis
Supply the full document or relevant excerpts
4
Code Debugging
Include the actual code, error messages, and environment details
Context Best Practices
Be Relevant
Only include information pertinent to the task
Be Complete
Provide all necessary details to answer fully
Be Organized
Structure context logically (chronological, hierarchical)
Be Clear
Use delimiters to separate context from instructions
Principle 4: Format Matters
How Format Influences Interpretation
The way you structure your prompt significantly impacts how the model parses and responds to it.Format Comparison
- Unstructured
- Structured with Delimiters
- Code-Style Format
- Ambiguous boundaries
- Unclear what to translate
- No format guidance
Effective Formatting Techniques
Use Delimiters
Use Delimiters
Common delimiters:
- Triple quotes:
"""
- Triple backticks:
```
- XML tags:
<text>...</text>
- Brackets:
[...]
Label Sections Clearly
Label Sections Clearly
Use Structured Lists
Use Structured Lists
Specify Output Format
Specify Output Format
Common Pitfalls to Avoid
Watch out for these mistakes:
-
Assuming the LLM knows what you want
- ❌ “Fix this”
- ✅ “Fix the syntax error on line 5 where the function is missing a closing parenthesis”
-
Providing contradictory instructions
- ❌ “Be brief but comprehensive”
- ✅ “Provide a comprehensive overview in under 200 words”
-
Using ambiguous language
- ❌ “Make it better”
- ✅ “Improve readability by adding comments and using descriptive variable names”
-
Neglecting output format
- ❌ “List the items”
- ✅ “List the items as a numbered list with one item per line”
-
Information overload
- ❌ Dumping entire documents without focus
- ✅ Providing relevant excerpts with clear context
Putting It All Together
The Complete Prompt Framework
Here’s how to apply all four principles in a single prompt:Function Name
Purpose: [Brief description] Parameters:- param1: [type] - [description]
- param2: [type] - [description]
- Starting with a relatable real-world example
- Explaining the core concept in simple terms
- Describing how it differs from traditional programming
- Providing a concrete application example