Liabooks Home|PRISM News
AI Prompt Masterclass: The Art of Getting the Answers You Want
Tech

AI Prompt Masterclass: The Art of Getting the Answers You Want

8 min read


1. What is Prompt Engineering?

Definition

Prompt engineering is the art of designing inputs (prompts) to get desired results from AI models.

It's not simply "asking questions." It's designing effective communication with AI.

Why Does It Matter?

Same AI, same question—but how you ask completely changes the results.

Example: Marketing Strategy Request

Bad Prompt:

"Tell me about marketing strategy"

Good Prompt:

"You are a marketing consultant for small businesses. Create a 7-day social media content calendar for a local coffee shop that wants to increase foot traffic on a $500 monthly budget. Include post ideas, best posting times, and engagement strategies for Instagram and Facebook."

Result Difference: The first gives generic advice; the second provides an immediately actionable specific plan.


2. 5 Principles of Good Prompts

Principle 1: Clarity

Remove ambiguity. The more AI has to guess your intent, the more inaccurate it becomes.

❌ "Write something good"
✅ "Write a 1,500-word blog post for a B2B SaaS startup. Topic: 'Remote work productivity tools'. Tone: professional but friendly."

Principle 2: Context

Give AI background information for more relevant answers.

✅ "I'm a frontend developer with 3 years of experience. I need to choose a state management library for a React project. Team of 5, medium-sized project. Compare Redux, Zustand, and Jotai."

Principle 3: Specificity

Specify the format, length, and structure of desired output.

✅ "Compare the 3 options in a table format. Columns: 'Pros', 'Cons', 'Best Use Case'."

Principle 4: Positive Instructions

"Do this" is more effective than "don't do that."

❌ "Don't write too long"
✅ "Summarize in 300 words or less"

Principle 5: Iteration

No prompt is perfect on the first try. Review results and modify.

1st: Results too generic → Add specific examples
2nd: Format doesn't match → Specify output format
3rd: Tone too stiff → Add role assignment

3. Core Technique 1: Zero-shot vs Few-shot

Zero-shot Prompting

Direct instruction without examples. Relies entirely on AI's existing knowledge.

Prompt: "Analyze the sentiment of this sentence: 'This product is absolutely terrible'"
Response: "Negative sentiment (dissatisfaction, disappointment)"

Best for: Simple tasks, patterns AI already knows well

Few-shot Prompting

Provide 1-3 examples so AI can learn the pattern.

Prompt:
"Analyze sentiment in this format:

Input: 'Shipping was surprisingly fast!'
Output: Positive (surprise, satisfaction)

Input: 'It's just okay'
Output: Neutral (indifference)

Input: 'Never buying again'
Output: ???"

Response: "Negative (disappointment, rejection)"

Best for:

  • When specific format is needed
  • Matching tone/style
  • Classification tasks

Comparison

FeatureZero-shotFew-shot
Examples needed✅ (1-3)
ConsistencyLowerHigher
Token usageLessMore
Best tasksSimple Q&AFormat/Classification

4. Core Technique 2: Chain-of-Thought

The Magic Phrase: "Think Step by Step"

Adding "Think step by step" to complex problems dramatically improves accuracy.

Example: Math Problem

Zero-shot:

Prompt: "What is 8 + 3 × 2 - 4 ÷ 2?"
Response: "12" (might be wrong)

Chain-of-Thought:

Prompt: "What is 8 + 3 × 2 - 4 ÷ 2? Show your work step by step."
Response:
"1. First multiplication: 3 × 2 = 6
2. Division: 4 ÷ 2 = 2
3. Addition: 8 + 6 = 14
4. Subtraction: 14 - 2 = 12
Answer: 12"

When to Use

Task TypeChain-of-Thought Effectiveness
Math problems⭐⭐⭐⭐⭐
Logic puzzles⭐⭐⭐⭐⭐
Code debugging⭐⭐⭐⭐
Decision making⭐⭐⭐⭐
Simple questions⭐ (unnecessary)

5. Core Technique 3: Role Prompting

Give AI a Persona

Assigning a role maintains consistent tone, expertise, and perspective.

Basic Format

"You are a [role]. [Context]. Please perform [task]."

Practical Examples

Legal Advice:

"You are a startup-specialized lawyer with 10 years of experience. 
List 5 key considerations when drafting an equity distribution agreement with co-founders.
Explain in terms a non-expert can understand."

Technical Writing:

"You are a senior backend developer and tech blogger.
Write a 'Docker vs Kubernetes' comparison article for junior developers.
Include real use cases and when to choose each."

Marketing Copy:

"You are an Apple marketing copywriter.
Write 5 landing page headlines for a new wireless earbuds product.
Use Apple's minimalist, impactful style."

6. Core Technique 4: Output Format Specification

Why Format Matters

Makes AI responses predictable and easier to post-process.

Format Methods

1. Explicit Structure:

"Answer in this format:
## Summary
## Pros
- Item 1
- Item 2
## Cons
- Item 1
- Item 2
## Conclusion"

2. Table Format:

"Organize in a table: | Item | Description | Score |"

3. JSON Format (for developers):

"Respond in this JSON format:
{
  "summary": "string",
  "pros": ["string"],
  "cons": ["string"],
  "score": number
}"

Anchoring

Specifying how the response starts improves format compliance.

Prompt: "Analyze this code's issues. Start with 'Analysis Result:'"
Response: "Analysis Result: 
1. Potential memory leak..."

7. Core Technique 5: Prompt Chaining

Break Complex Tasks into Steps

Instead of one massive prompt, divide into multiple sequential steps.

Example: Blog Post Writing

Step 1: Create Outline

"Create an outline for a blog post on 'How AI is transforming education'.
5 sections, 2-3 key points each."

Step 2: Expand Section

"Expand 'Section 2: Personalized Learning' to 500 words.
Include specific examples."

Step 3: Write Introduction

"Based on the content above, write an engaging introduction.
Start with a question or statistic."

Step 4: Final Review

"Review the entire article. Check for natural flow and remove redundancies."

Benefits of Chaining

BenefitDescription
Quality improvementCan provide feedback/corrections at each step
ControlGuide in desired direction
DebuggingEasy to identify where problems occurred
Complex tasks possibleAccomplish what single prompts cannot

8. 10 Practical Prompt Templates

1. Writing (Blog/Article)

You are a [field] content specialist.

Write a [length] article about [topic].

Target audience: [target]
Tone: [professional/friendly/persuasive]
Include:
- [element1]
- [element2]
- [element3]

Format: Introduction-Body(3 sections)-Conclusion

2. Code Review

You are a senior developer.

Review this code:
[code]

Analyze from these perspectives:
1. Bugs or potential issues
2. Performance optimization opportunities
3. Code readability/maintainability
4. Security vulnerabilities

Include corrected code examples for each issue.

3. Email Writing

Write a business email for this situation:

Situation: [description]
Recipient: [relationship/title]
Purpose: [request/thanks/apology/information]
Tone: [formal/friendly]
Length: [brief/detailed]

Key points to include:
- [point1]
- [point2]

4. Data Analysis

Analyze this data:
[data]

Analysis requests:
1. Identify main patterns/trends
2. Find outliers
3. Derive 3 insights
4. Suggest areas requiring further investigation

Explain results so non-experts can understand.

5. Brainstorming

Brainstorm on [topic/problem].

Constraints:
- Budget: [amount]
- Timeline: [time]
- Resources: [available resources]

Generate:
1. 3 traditional approaches
2. 3 creative/unconventional ideas
3. 2 high-risk-high-reward ideas

Include pros and cons for each idea.

9. Common Mistakes and Solutions

Mistake 1: Too Vague

Problem: "Write something good"

Solution: Add specifics—topic, length, tone, audience, format

Mistake 2: Information Overload

Problem: 10 requests in one prompt

Solution: Use prompt chaining to separate

Mistake 3: Negative Instructions

Problem: "Don't be verbose, don't use jargon"

Solution: Convert to positive instructions "Be concise, under 300 words, use layperson-friendly terms"

Mistake 4: Missing Context

Problem: "Review this code" (just throwing code)

Solution: Provide background "This code is for a real-time chat app's message sending feature. Python 3.11, Flask. Goal is performance optimization."

Mistake 5: No Iteration

Problem: Give up if first result isn't satisfactory

Solution: Provide feedback and iterate "Add more specific examples" "Make the tone friendlier" "Explain point 3 in more detail"



Glossary

TermDefinition
Zero-shotPrompting method with direct instructions, no examples
Few-shotMethod providing 1-3 examples for AI to learn patterns
Chain-of-ThoughtTechnique guiding AI to reason step by step
Role PromptingTechnique assigning a specific role/persona to AI
Prompt ChainingDividing complex tasks into sequential prompts
AnchoringTechnique controlling format by specifying response start
Self-ConsistencyGenerating multiple reasoning paths and selecting consistent answer

Update Log

DateChanges
2026-01-06Initial publication

© 2026 PRISM by Liabooks. All rights reserved.

Thoughts

Authors

Min Hwang

"17 years in the field, now telling the story of technology"

Related Articles