Prompt Engineering Cheat Sheet
Summarizes core prompting techniques such as few-shot examples, chain-of-thought, and system prompts for getting reliable output from large language models.
2 PagesBeginnerFeb 28, 2026
Core Techniques
Foundational prompting patterns.
- Zero-shot prompting- Asking the model to perform a task with only an instruction, no examples
- Few-shot prompting- Providing a handful of input/output examples in the prompt before the real query, to demonstrate the desired format
- Chain-of-thought (CoT)- Asking the model to reason step by step before giving a final answer, which improves accuracy on multi-step problems
- System prompt- A persistent instruction (role, tone, constraints) set once and applied across the conversation, separate from user turns
- Role prompting- Asking the model to respond "as" a persona (e.g., "You are a senior SQL reviewer") to steer tone and focus
A Well-Structured Prompt
Separate role/context, task, format, and constraints clearly.
text
SYSTEM: You are a technical writer who explains concepts to beginners.Use plain language and avoid jargon unless you define it.USER:Task: Summarize the following article in 3 bullet points.Constraints: Each bullet must be under 20 words. No introductory sentence.Article: <article text here>
Few-Shot Example Prompt
Show the model the input/output pattern before asking for a new one.
text
Classify the sentiment as Positive, Negative, or Neutral.Review: "The battery life is incredible and it charges fast."Sentiment: PositiveReview: "It arrived broken and support never replied."Sentiment: NegativeReview: "It's fine, does what it says on the box."Sentiment: NeutralReview: "Setup was confusing but the results were worth it."Sentiment:
Best Practices
What tends to move accuracy most in practice.
- Be explicit about output format- Specify JSON schema, bullet count, or word limits directly rather than hoping the model infers it
- Put instructions near long context- Repeat key instructions before and after long context -- models can under-weight instructions buried before a long document
- Iterate with real failure cases- Collect prompts that fail, adjust wording/examples, and re-test rather than guessing at improvements
- Ask for reasoning then the answer- For complex tasks, request step-by-step reasoning before the final answer, and extract only the final answer downstream
- Use delimiters- Wrap user-supplied content in triple quotes, XML tags, or markdown fences so the model can't confuse it with instructions
Pro Tip
For tasks needing a strict output format (JSON, CSV), show one concrete example of the exact format in the prompt rather than only describing it in words -- models follow a shown pattern far more reliably than a described one.
Was this cheat sheet helpful?
Explore Topics
#PromptEngineering#PromptEngineeringCheatSheet#DataScience#Beginner#CoreTechniques#AWellStructuredPrompt#Few#Shot#MachineLearning#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech
Professional Web Designing Services
- Responsive Websites
- E-commerce Solutions
- SEO Friendly Design
- Fast & Secure
- Support & Maintenance