Strategies to Write Good Prompts for Large Language Models
- Metric Coders
- Mar 29
- 3 min read
Writing a good prompt for a large language model (LLM) is part art, part science. Whether you're generating marketing copy, summarizing research papers, writing code, or building AI-powered products—how you ask makes all the difference in what you get.

Good prompts lead to relevant, high-quality, and useful outputs. Poor prompts? Not so much.
Here are some practical strategies to craft effective prompts when working with LLMs like GPT-4:
1. Be Clear and Specific
The more specific you are, the better the model can understand your intent. Vague or abstract prompts lead to generic outputs.
❌ Write something about climate change.✅ Write a 150-word persuasive paragraph arguing why governments should invest in renewable energy to combat climate change.
2. Set the Role or Context
LLMs perform better when you assign them a role. It frames the response style and content.
🎭 You are a legal advisor. Explain the key elements of a non-disclosure agreement in simple terms.
You can also add persona, tone, or format details: Act as a witty travel blogger, or Respond in bullet points like a project manager.
3. Provide Examples (Few-Shot Prompting)
If your task is complex or has a specific format, show the model a few examples of the input and expected output.
Input: Translate to French: "How are you?" Output: Comment ça va ?
Input: Translate to French: "Good morning" Output:
The model continues the pattern you've established.
---
### 4. **Use Clear Structure and Delimiters**
Format matters. Use line breaks, headings, bullet points, and markers (e.g., `Input:` / `Output:` or triple quotes) to help the model understand what’s what.
> ```
Task: Summarize the paragraph below.
Text: """Global warming refers to the long-term rise in the average temperature of the Earth’s climate system..."""
Summary:
5. Define Constraints
Give the model boundaries. Word count, tone, style, format—these all guide the model.
Write a 100-word formal email apologizing for a delayed response.
Or:
Respond with a JSON object that includes the title, author, and main idea of the text.
6. Chain of Thought Prompting
Encourage reasoning by asking the model to explain its steps before giving an answer. This improves accuracy for complex tasks.
🧠 Let’s solve this step by step. A train leaves at 3:00 PM...
This works especially well for math, logic, and multi-step problems.
7. Iterate, Test, Refine
Prompt engineering is an iterative process. Try different versions, tweak phrasing, and test with diverse inputs.
Start with: Summarize this articleThen try: Summarize this article in two bullet points focused on main findings.
A/B testing is your friend.
8. Avoid Ambiguity
Models can get confused by open-ended or compound prompts. Keep it focused.
❌ What are some good books and how can I become a better reader?✅ List 3 classic fiction books for beginners. Then give 3 tips to improve reading habits.
9. Use System-Level Instructions (if supported)
Some models allow a “system prompt” to set global behavior. Use it to define tone, personality, or behavior.
🛠️ System prompt: “You are a helpful, concise assistant who explains technical concepts simply.”
10. Think Like a Developer, Not Just a User
If you're integrating prompts into apps or workflows, make them robust and modular. Use placeholders, templates, or prompt chaining to handle dynamic inputs.
Prompt template: "Write a {tone} product description for the following item: {product_name}. Emphasize: {key_features}"
---
## Wrapping Up
The quality of an LLM’s output is a direct reflection of your prompt design. Think of prompt crafting like writing a mini-specification for a very fast, very smart, but highly literal teammate.
The more intentional and structured your prompts, the better the results.
---
### TL;DR – Good Prompting Tips
- Be specific and unambiguous
- Give clear context and roles
- Use examples or format templates
- Define constraints (tone, length, format)
- Iterate and refine based on outputs
Whether you're a developer building with LLMs or a content creator using AI tools, strong prompting is your secret weapon. ✍️💡
---
Want a version tailored to devs, product managers, educators, or researchers? Let me know, and I can customize it!