Prompt Engineering Techniques

The Prompt Engineering Guide documents 18 major prompting techniques, ranging from foundational to cutting-edge. These are organized from simplest to most complex.

Foundational Techniques (confidence: high)

Zero-Shot Prompting

The model performs a task without any examples. Works well for simple tasks but degrades on complex or unfamiliar ones.

Few-Shot Prompting (In-Context Learning)

Providing demonstrations (input-output pairs) within the prompt. Enables the model to learn task structure from examples. Format matters — consistent formatting improves results significantly.

Chain-of-Thought (CoT)

Encourages step-by-step reasoning by including intermediate reasoning steps in the prompt. Dramatically improves performance on arithmetic, commonsense, and symbolic reasoning tasks. CoT is most effective when combined with few-shot examples.

Advanced Reasoning Techniques (confidence: high)

Self-Consistency

Samples multiple CoT reasoning paths and selects the majority answer. Improves reliability over single-path CoT by reducing variance in reasoning traces.

Tree-of-Thoughts (ToT)

Explores multiple reasoning paths simultaneously using BFS/DFS search over thought states. Each state is evaluated by the LLM itself. More compute-intensive but handles complex planning tasks better than linear CoT.

Generate Knowledge Prompting

The LLM first generates relevant factual knowledge about a question, then uses that knowledge as context to produce the final answer.

Agentic Techniques (confidence: high)

ReAct

Interleaves reasoning traces (“thoughts”) with task actions (tool calls, API queries). Creates an observable chain of reasoning + action for interpretable agent behavior. Foundation for modern LLM agent architectures.

Reflexion

Extends ReAct with a feedback loop: the agent receives verbal reinforcement from its own actions and environmental feedback, enabling self-correction over multiple episodes.

Automatic Reasoning and Tool-use (ART)

Uses a frozen LLM to generate intermediate reasoning steps, delegating tool calls to external programs. Combines CoT-style reasoning with program execution.

Generation and Search Techniques (confidence: high)

Automatic Prompt Engineer (APE)

Uses LLMs to generate and score candidate instructions automatically. The LLM proposes prompt variations, evaluates them against a metric, and selects the best performer — automating prompt optimization.

Active-Prompt

Identifies uncertain examples and asks humans to annotate them with CoT reasoning chains. These annotated examples are then used as few-shot demonstrations, targeting the model’s weakest areas.

Directional Stimulus Prompting (DSP)

A smaller “policy LM” generates hint keywords that guide a frozen LLM toward desired outputs. Decouples guidance from generation.

Program-Aided Language Models (PAL)

Delegates arithmetic and symbolic computation to an external Python interpreter. The LLM generates code, executes it, and uses the result. Eliminates arithmetic errors from LLMs.

Multimodal and Graph Techniques (confidence: medium)

Multimodal CoT

Two-stage reasoning for vision-language tasks: (1) rationale generation from image + text, (2) answer generation from rationale. Improves multimodal reasoning over direct answering.

GraphPrompt

A prompting framework for graph learning tasks. Adapts the prompting paradigm to graph neural networks by designing task-specific graph prompts.

Prompt Chaining

Breaking a complex task into sequential sub-prompts, where each prompt’s output feeds into the next. Enables modular, debuggable LLM pipelines.

Implications

The guide’s technique taxonomy reveals the trajectory of prompt engineering: from simple instruction-following to multi-step reasoning, agentic loops, automated optimization, and multimodal adaptation. The progression mirrors the evolution of LLM capabilities themselves.

prompt-engineering-guide | prompt-engineering-applications | react-prompting | tree-of-thoughts | chain-of-thought | self-consistency | few-shot-prompting | zero-shot-prompting | prompt-chaining | generate-knowledge-prompting | automatic-reasoning-tool-use | automatic-prompt-engineer | active-prompt | directional-stimulus-prompting | pal-program-aided-language-models | reflexion | multimodal-cot | graph-prompting

Sources

  • raw/external/www-promptingguide-ai-techniques-f9bd0064.md
  • raw/prompts/articles/promptingguide-pt-techniques.md
  • raw/prompts/articles/promptingguide-pt-techniques-zeroshot.md
  • raw/prompts/articles/promptingguide-pt-techniques-fewshot.md
  • raw/prompts/articles/promptingguide-pt-techniques-cot.md
  • raw/prompts/articles/promptingguide-pt-techniques-consistency.md
  • raw/prompts/articles/promptingguide-pt-techniques-knowledge.md
  • raw/prompts/articles/promptingguide-pt-techniques-prompt_chaining.md
  • raw/prompts/articles/promptingguide-pt-techniques-tot.md
  • raw/prompts/articles/promptingguide-pt-techniques-rag.md
  • raw/prompts/articles/promptingguide-pt-techniques-art.md
  • raw/prompts/articles/promptingguide-pt-techniques-ape.md
  • raw/prompts/articles/promptingguide-pt-techniques-activeprompt.md
  • raw/prompts/articles/promptingguide-pt-techniques-dsp.md
  • raw/prompts/articles/promptingguide-pt-techniques-pal.md
  • raw/prompts/articles/promptingguide-pt-techniques-react.md
  • raw/prompts/articles/promptingguide-pt-techniques-reflexion.md
  • raw/prompts/articles/promptingguide-pt-techniques-multimodalcot.md
  • raw/prompts/articles/promptingguide-pt-techniques-graph.md
  • raw/prompts/articles/taxonomy-synthesis.md