Part of a 4-post series
In our previous article, we explored what LLMs are and how they predict the next word (token) in a sequence. We learned that transformer architecture helps LLMs understand context through self-attention mechanisms. Now that we understand how LLMs work under the hood, let's focus on something equally important: how we communicate with them.
The inputs we provide to LLMs, combined with their training data, significantly influence the quality and relevance of their responses. This is where prompt engineering becomes crucial—it's the bridge between human intent and AI understanding.
Think of an LLM as an incredibly knowledgeable conversation partner who has read millions of books, articles, and websites. Just like with any expert, the quality of your questions and instructions directly impacts the usefulness of their responses.
There are two primary ways we communicate with LLMs:
Prompts are the questions, instructions, or conversation starters you provide directly to an AI system. They're the visible part of your interaction—what you type into ChatGPT, Claude, or any other AI interface.
Example:
The difference? Context, specificity, and clear intent.
System messages work behind the scenes to shape how an AI responds. You typically don't see them, but they act like an instruction manual that defines the AI's behavior, tone, and approach.
System messages might instruct an AI to:
For example, a system message might tell the AI: "You are a patient coding tutor. Always provide step-by-step explanations with code examples. If the user makes an error, gently correct it and explain why."
Prompt engineering is the practice of crafting inputs that maximize the effectiveness of AI systems. It's both an art and a science—combining understanding of how LLMs work with practical techniques for clear communication.
As AI becomes more integrated into our daily workflows, prompt engineering is emerging as a valuable skill across industries. It's not just for developers; marketers, writers, researchers, and professionals in every field can benefit from learning how to communicate effectively with AI.
Instead of vague requests, provide clear, detailed instructions with relevant context.
Poor Example:"Write about dogs"
Better Example:"Write a 500-word article about the three most family-friendly dog breeds for households with children under 10. Include information about temperament, exercise needs, and grooming requirements."
Specify exactly how you want the response structured.
Poor Example:"Tell me about healthy eating"
Better Example:"Create a 7-day meal plan for heart-healthy eating. Format it as a table with columns for Day, Breakfast, Lunch, Dinner, and Snack. Include calorie estimates for each meal."
Give the AI a specific role or perspective to adopt.
Poor Example:"Explain blockchain"
Better Example:"You are a technology consultant explaining blockchain to a small business owner who is considering accepting cryptocurrency payments. Focus on practical benefits, risks, and implementation considerations."
Show the AI what you want through examples, and set clear boundaries.
Example:"Generate 5 social media post ideas for a sustainable fashion brand. Each post should:
Example format: 🌱 Did you know fast fashion produces 10% of global carbon emissions? Choose quality over quantity. What's your favorite sustainable brand? #SlowFashion #EcoStyle"
Encourage the AI to show its reasoning process by asking it to "think step by step."
Example:"A company's revenue increased by 25% in Q1 and decreased by 15% in Q2. If Q1 revenue was $400,000, what was the Q2 revenue? Please show your calculation step by step."
Provide examples of the desired input-output pattern before asking for your specific request.
Example: "Convert these technical terms into simple explanations:
API → A way for different software programs to talk to each other Database → A digital filing cabinet that stores organized information Cloud Computing → Using someone else's computers over the internet instead of your own
Now convert: Machine Learning → ?"
Start with a basic prompt and refine based on the results.
Initial Prompt: "Write a product description for wireless headphones"
Refined Prompt: "Write a compelling 150-word product description for premium wireless noise-canceling headphones targeting remote workers. Emphasize comfort during long calls, battery life, and sound quality. Use a professional but approachable tone and include a call-to-action."
"Create a LinkedIn post announcing our company's new sustainability initiative. The post should:
"Write a Python function that:
"Analyze this sales data and provide:
[Include your data here]"
As AI systems become more sophisticated, prompt engineering is evolving from simple question-asking to strategic communication design. We're seeing the emergence of:
You can find more resources to deepen your understanding here: Learn AI 🎁. I'll continue updating this page with valuable learning resources as I document my journey of building an AI agent.
Ready to put these techniques into practice? Start experimenting with your AI interactions today—you'll be amazed at how much better your results become with thoughtful prompt engineering!