Prompt Engineering 101: How to Get Exact Results from Any LLM
- Define precise roles to establish context for the model
- Use brackets or delimiters to isolate input data
- Request structured formats like JSON or tables
- Test variations to see which prompt works best.
Master basic prompting by defining clear roles, using formatting delimiters (like brackets or quotes), and specifying output structures. By telling the model who it is, what data to look at, and how to format the answer, you can get reliable results from any LLM.
Many users interact with Large Language Models (like ChatGPT, Claude, or Gemini) as if they are basic search engines. They type short, vague queries (e.g., “Write a marketing email” or “How do I grow my business?”) and are often disappointed when the AI outputs generic, clichéd, or irrelevant paragraphs.
To get high-value, precise results from any LLM, you must master the core principles of prompt engineering basics.
Prompt engineering is the practice of structuring your inputs so the AI model understands the exact context, constraints, tone, and format you require.
In this guide, we break down the fundamental framework of a perfect prompt, and show you how to write inputs that unlock the full analytical power of any language model.
—
The 4-Part Prompt Construction Framework
The most effective prompt layout consists of four key components: Role, Context, Task, and Constraints. While you do not need to use all four for every query, combining them guarantees high-quality outputs.
Step-by-Step Workflow:
- Step 1: 1. Role Definition
- Step 2: 2. Context & Background
- Step 3: 3. Clear Task
- Step 4: 4. Rules & Constraints
1. Role Definition (Who is the AI?)
Assigning a specific role forces the model to draw from relevant segments of its training data.
Weak:* “Write a blog post about SEO.”
Strong:* “Act as an expert B2B SaaS copywriter specializing in technical SEO tutorials.”
2. Context & Background (What does the AI need to know?)
Provide the background information, target audience, and current parameters.
Example:* "I am launching a custom WordPress theme targeting students who need fast page speeds for mobile reading. The website is launchpadai.online/."
3. Clear Task (What do you want the AI to do?)
State the exact output you require, using active verbs.
Example:* “Draft a 150-word introduction paragraph for our homepage that highlights our value proposition.”
4. Rules & Constraints (How should the AI behave?)
Set strict boundaries on tone, vocabulary, length, and formatting.
Example:* “Write in the first-person plural. Avoid clichéd marketing adjectives like ‘revolutionary’ or ‘cutting-edge’. Keep the sentences short.”
—
3 Advanced Prompting Techniques
Once you master the basic framework, you can apply advanced prompting techniques to solve complex tasks:
1. Few-Shot Prompting (Learning by Example)
Provide 2–3 examples of the exact output format you want. LLMs are highly effective at matching patterns.
Example:*
Example 1: “The app crashed when I clicked export.” -> Bug
Example 2: “I was charged twice this month.” -> Billing
Example 3: “I would love a dark mode option.” -> [AI will output: Feature Request]
2. Chain-of-Thought (CoT) Prompting
For math, coding, or complex strategy tasks, instruct the AI to show its step-by-step logic before writing the final answer. This reduces errors.
Prompt clause: “Think step-by-step. Write down your analytical logic for each stage in a scratchpad block before generating the final conclusion.”*
3. Output Formatting Rules
You can force the AI to output data in specific structures, such as Markdown tables, JSON code, CSV files, or bulleted lists.
Prompt clause: “Organize the summary into a Markdown table with the columns: Metric Name, Current Value, and Recommendation.”*
—
Comparison of Prompt Styles
| Input Style | Example | Output Quality | Best For |
|---|---|---|---|
| Conversational | “Tell me about time blocking.” | General, encyclopedic | Basic learning |
| Structured (Role + Task) | “Act as a productivity coach. Explain time blocking.” | Practical, actionable | Daily tasks |
| Bespoke (Role + Context + Rules) | “Act as a coach. Here is my calendar… Explain block rules without using jargon.” | High-precision, custom fit | Professional outputs |
—
The Role of Delimiters and Negative Prompts
To prevent the LLM from getting confused by long inputs, utilize delimiters to separate instructions from source data:
- Delimiters: Wrap your notes or raw text in distinct markers like “”” (triple quotes), — (triple dashes), or XML tags (e.g.,
… ). This prevents the AI from treating user data as instructions. - Negative Prompts: State clearly what the AI should not do. For example: “Do not use passive voice. Do not write an introductory summary. Do not output code without comments.”
- Prompt Length vs Attention: While modern LLMs accept large prompts, they prioritize the beginning and ending lines. Place your critical format constraints at the very bottom of your prompt to ensure the AI follows them.
Frequently Asked Questions
What is the “temperature” setting in LLM APIs?
Temperature controls the randomness of the model’s outputs. A low temperature (e.g. `0.1` or `0.2`) makes the AI predictable and focused, which is ideal for coding and research. A high temperature (e.g. `0.8` or `0.9`) makes the AI creative, which is ideal for brainstorming and storytelling.
How long can a prompt be?
Modern LLMs feature large “context windows,” allowing prompts to span thousands of words. You can paste entire chapters of text or code files alongside your instructions.
Why does the AI ignore my constraints sometimes?
If a prompt is too long or chaotic, the model can lose track of rules (known as “attention drift”). To prevent this, place your constraints and rules at the very end of the prompt, as LLMs pay higher attention to the beginning and end of inputs.
—
Related Resources
- Related Prompt: [Get our copyable Prompt Iteration Testing](/prompts/prompt-iteration-testing/) to quickly run this workflow.
- Related Template: [Download the Prompt Testing Worksheet](/templates/prompt-testing-worksheet/) to structure your documents.
- Related Guides: Read our detailed blueprints on [ChatGPT Custom Instructions for Productivity](/chatgpt-custom-instructions-productivity/) and [AI Copywriting: Maintaining Brand Voice](/ai-copywriting-maintaining-brand-voice/).
- Writing vague, single-sentence requests
- Assuming the model has access to current search info without checking
- Forgetting to specify formatting constraints
- Over-complicating prompt instructions.