Prompt Engineering: Patterns for Better LLM Results

Good prompts decide the quality of LLM answers. The most important patterns at a glance:

System prompt

Defines role, tone and rules: “You are a support agent. Answer in German, max. 5 sentences, cite sources.” The system prompt affects the whole conversation.

Few-shot

Examples show the desired format:

Input: "reschedule meeting" → Category: Calendar
Input: "forgot password" → Category: Account
Input: "invoice missing" → Category:

Chain-of-thought

For math/logic: “Think step by step before answering.” Measurably improves accuracy.

Structured outputs

Request JSON or XML: “Answer as JSON: {"category": "...", "priority": 1-5}”. For code: fenced blocks.

Pitfalls

  • Vague instructions lead to vague results. Be specific.
  • Negative instructions (“don't mention”) are weaker — describe the desired positive state.
  • Long prompts cost tokens — include only what matters.

See also: AI & Automation.