n5321 | 2026年2月3日 16:51

Tags: AI


What are the key prompt engineering techniques?


  1. Few-shot Prompting: Include a few (input → output) example pairs in the prompt to teach the pattern.

  2. Zero-shot Prompting: Give a precise instruction without examples to state the task clearly.

  3. Chain-of-thought (CoT) Prompting: Ask for step-by-step reasoning before the final answer. This can be zero-shot, where we explicitly include “Think step by step” in the instruction, or few-shot, where we show some examples with step-by-step reasoning.

  4. Role-specific Prompting: Assign a persona, like “You are a financial advisor,” to set context for the LLM.

  5. Prompt Hierarchy: Define system, developer, and user instructions with different levels of authority. System prompts define high-level goals and set guardrails, while developer prompts define formatting rules and customize the LLM’s behavior.

Here are the key principles to keep in mind when engineering your prompts:

  • Begin simple, then refine.

  • Break a big task into smaller, more manageable subtasks.

  • Be specific about desired format, tone, and success criteria.

  • Provide just enough context to remove ambiguity.

Over to you: Which prompt engineering technique gave you the biggest jump in quality?